From 7fa21065e9cda65a624983e953676f301da55ae1 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Fri, 8 May 2009 05:27:02 -0400 Subject: [PATCH] update to upstream sqlite 3.6.14 --- Makefile.vxworks | 49 +- VERSION | 2 +- configure.ac | 4 +- ext/async/README.txt | 164 + ext/async/sqlite3async.c | 1680 ++ ext/async/sqlite3async.h | 213 + main.mk | 4 +- src/.#expr.c.1.431 | 3392 +++ src/.#main.c.1.546 | 2200 ++ src/.#rowhash.c.1.3 | 387 + src/.#util.c.1.247 | 1006 + src/.#where.c.1.394 | 3578 +++ src/alter.c | 8 +- src/analyze.c | 7 +- src/attach.c | 41 +- src/auth.c | 47 +- src/btree.c | 310 +- src/btree.h | 4 +- src/build.c | 108 +- src/callback.c | 18 +- src/complete.c | 4 +- src/date.c | 7 +- src/delete.c | 35 +- src/expr.c | 300 +- src/func.c | 12 +- src/hash.c | 209 +- src/hash.h | 39 +- src/insert.c | 158 +- src/legacy.c | 32 +- src/main.c | 173 +- src/malloc.c | 4 +- src/memjournal.c | 4 +- src/os_win.c | 37 +- src/pager.c | 67 +- src/pager.h | 4 +- src/parse.y | 4 +- src/pcache1.c | 4 +- src/prepare.c | 21 +- src/printf.c | 22 +- src/resolve.c | 10 +- src/rowset.c | 298 +- src/select.c | 64 +- src/sqlite.h.in | 238 +- src/sqliteInt.h | 126 +- src/test1.c | 22 +- src/test3.c | 6 +- src/test8.c | 10 +- src/test_async.c | 1911 +- src/tokenize.c | 4 +- src/trigger.c | 9 +- src/update.c | 20 +- src/util.c | 158 +- src/vacuum.c | 21 +- src/vdbe.c | 288 +- src/vdbeInt.h | 6 +- src/vdbeapi.c | 39 +- src/vdbeaux.c | 25 +- src/vdbemem.c | 32 +- src/vtab.c | 4 +- src/where.c | 851 +- test/alias.test | 6 +- test/async.test | 20 +- test/async2.test | 16 +- test/async3.test | 12 +- test/async4.test | 149 + test/auth.test | 6 +- test/auth3.test | 4 +- test/bindxfer.test | 9 +- test/blob.test | 4 +- test/conflict.test | 4 +- test/count.test | 3 +- test/date.test | 7 +- test/exclusive.test | 8 +- test/func.test | 16 +- test/fuzz.test | 16 +- test/insert3.test | 8 +- test/jrnlmode.test | 17 +- test/jrnlmode3.test | 150 + test/lock2.test | 5 +- test/lock4.test | 3 +- test/main.test | 34 +- test/make-where7.tcl | 6 +- test/misc3.test | 32 +- test/mutex1.test | 14 +- test/rowhash.test | 56 + test/savepoint4.test | 6 +- test/select1.test | 7 +- test/select4.test | 14 +- test/shared7.test | 55 + test/table.test | 9 +- test/tempdb.test | 43 +- test/temptrigger.test | 4 +- test/tkt3461.test | 3 +- test/tkt3824.test | 99 + test/tkt3832.test | 37 + test/tkt3838.test | 37 + test/trans.test | 11 +- test/unique.test | 4 +- test/vtabD.test | 72 + test/where7.test | 47487 ++++++++++++++++++------------------- test/where8.test | 27 +- test/where8m.test | 19 +- test/where9.test | 24 +- tool/genfkey.test | 31 + 104 files changed, 38966 insertions(+), 28128 deletions(-) create mode 100644 ext/async/README.txt create mode 100644 ext/async/sqlite3async.c create mode 100644 ext/async/sqlite3async.h create mode 100644 src/.#expr.c.1.431 create mode 100644 src/.#main.c.1.546 create mode 100644 src/.#rowhash.c.1.3 create mode 100644 src/.#util.c.1.247 create mode 100644 src/.#where.c.1.394 create mode 100644 test/async4.test create mode 100644 test/jrnlmode3.test create mode 100644 test/rowhash.test create mode 100644 test/shared7.test create mode 100644 test/tkt3824.test create mode 100644 test/tkt3832.test create mode 100644 test/tkt3838.test create mode 100644 test/vtabD.test diff --git a/Makefile.vxworks b/Makefile.vxworks index 8dde391..6ca6303 100644 --- a/Makefile.vxworks +++ b/Makefile.vxworks @@ -188,19 +188,24 @@ NAWK = awk # 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 +TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) +TCCX_SHARED = $(TCC_SHARED) $(OPTS) -I. -I$(TOP)/src -I$(TOP) \ + -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3 \ + -I$(TOP)/ext/async # 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 \ - callback.o complete.o date.o delete.o \ - expr.o fault.o func.o global.o hash.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_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 \ - 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 \ + main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \ + memjournal.o \ + mutex.o mutex_noop.o mutex_os2.o mutex_unix.o mutex_w32.o \ + notify.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 \ table.o tokenize.o trigger.o \ @@ -209,6 +214,7 @@ LIBOBJ+= alter.o analyze.o attach.o auth.o \ walker.o where.o utf.o vtab.o + # All of the source code files. # SRC = \ @@ -248,10 +254,11 @@ SRC = \ $(TOP)/src/memjournal.c \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ + $(TOP)/src/mutex_noop.c \ $(TOP)/src/mutex_os2.c \ $(TOP)/src/mutex_unix.c \ $(TOP)/src/mutex_w32.c \ - $(TOP)/src/mutex_noop.c \ + $(TOP)/src/notify.c \ $(TOP)/src/os.c \ $(TOP)/src/os.h \ $(TOP)/src/os_common.h \ @@ -262,8 +269,8 @@ SRC = \ $(TOP)/src/pager.h \ $(TOP)/src/parse.y \ $(TOP)/src/pcache.c \ - $(TOP)/src/pcache1.c \ $(TOP)/src/pcache.h \ + $(TOP)/src/pcache1.c \ $(TOP)/src/pragma.c \ $(TOP)/src/prepare.c \ $(TOP)/src/printf.c \ @@ -329,8 +336,8 @@ SRC += \ $(TOP)/ext/fts3/fts3_tokenizer.c \ $(TOP)/ext/fts3/fts3_tokenizer1.c SRC += \ - $(TOP)/ext/icu/icu.c \ - $(TOP)/ext/icu/sqliteicu.h + $(TOP)/ext/icu/sqliteicu.h \ + $(TOP)/ext/icu/icu.c SRC += \ $(TOP)/ext/rtree/rtree.h \ $(TOP)/ext/rtree/rtree.c @@ -361,33 +368,41 @@ TESTSRC = \ $(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 \ #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/attach.c $(TOP)/src/backup.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/pcache1.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)/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/async/sqlite3async.c # Header files used by all library source files. # @@ -423,10 +438,13 @@ EXTHDR += \ $(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 += \ + $(TOP)/ext/icu/sqliteicu.h # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. @@ -551,6 +569,9 @@ fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR) fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR) $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c +fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR) + $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c + fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR) $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c diff --git a/VERSION b/VERSION index 3609cf7..f5c2a40 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.13 +3.6.14 diff --git a/configure.ac b/configure.ac index 3a227f6..441cf78 100644 --- a/configure.ac +++ b/configure.ac @@ -90,7 +90,7 @@ AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) dnl Make sure the local VERSION file matches this configure script -sqlite_version_sanity_check=`cat VERSION | tr -d '\n'` +sqlite_version_sanity_check=`cat $srcdir/VERSION | tr -d '\n'` if test "$PACKAGE_VERSION" != "$sqlite_version_sanity_check" ; then AC_MSG_ERROR([configure script is out of date: configure \$PACKAGE_VERSION = $PACKAGE_VERSION @@ -101,7 +101,7 @@ fi 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.55 $ +# $Revision: 1.56 $ ######### # Programs needed diff --git a/ext/async/README.txt b/ext/async/README.txt new file mode 100644 index 0000000..05acffe --- /dev/null +++ b/ext/async/README.txt @@ -0,0 +1,164 @@ + +Normally, when SQLite writes to a database file, it waits until the write +operation is finished before returning control to the calling application. +Since writing to the file-system is usually very slow compared with CPU +bound operations, this can be a performance bottleneck. This directory +contains an extension that causes SQLite to perform all write requests +using a separate thread running in the background. Although this does not +reduce the overall system resources (CPU, disk bandwidth etc.) at all, it +allows SQLite to return control to the caller quickly even when writing to +the database, eliminating the bottleneck. + + 1. Functionality + + 1.1 How it Works + 1.2 Limitations + 1.3 Locking and Concurrency + + 2. Compilation and Usage + + 3. Porting + + + +1. FUNCTIONALITY + + With asynchronous I/O, write requests are handled by a separate thread + running in the background. This means that the thread that initiates + a database write does not have to wait for (sometimes slow) disk I/O + to occur. The write seems to happen very quickly, though in reality + it is happening at its usual slow pace in the background. + + Asynchronous I/O appears to give better responsiveness, but at a price. + You lose the Durable property. With the default I/O backend of SQLite, + once a write completes, you know that the information you wrote is + safely on disk. With the asynchronous I/O, this is not the case. If + your program crashes or if a power loss occurs after the database + write but before the asynchronous write thread has completed, then the + database change might never make it to disk and the next user of the + database might not see your change. + + You lose Durability with asynchronous I/O, but you still retain the + other parts of ACID: Atomic, Consistent, and Isolated. Many + appliations get along fine without the Durablity. + + 1.1 How it Works + + Asynchronous I/O works by creating a special SQLite "vfs" structure + and registering it with sqlite3_vfs_register(). When files opened via + this vfs are written to (using the vfs xWrite() method), the data is not + written directly to disk, but is placed in the "write-queue" to be + handled by the background thread. + + When files opened with the asynchronous vfs are read from + (using the vfs xRead() method), the data is read from the file on + disk and the write-queue, so that from the point of view of + the vfs reader the xWrite() appears to have already completed. + + The special vfs is registered (and unregistered) by calls to the + API functions sqlite3async_initialize() and sqlite3async_shutdown(). + See section "Compilation and Usage" below for details. + + 1.2 Limitations + + In order to gain experience with the main ideas surrounding asynchronous + IO, this implementation is deliberately kept simple. Additional + capabilities may be added in the future. + + For example, as currently implemented, if writes are happening at a + steady stream that exceeds the I/O capability of the background writer + thread, the queue of pending write operations will grow without bound. + If this goes on for long enough, the host system could run out of memory. + A more sophisticated module could to keep track of the quantity of + pending writes and stop accepting new write requests when the queue of + pending writes grows too large. + + 1.3 Locking and Concurrency + + Multiple connections from within a single process that use this + implementation of asynchronous IO may access a single database + file concurrently. From the point of view of the user, if all + connections are from within a single process, there is no difference + between the concurrency offered by "normal" SQLite and SQLite + using the asynchronous backend. + + If file-locking is enabled (it is enabled by default), then connections + from multiple processes may also read and write the database file. + However concurrency is reduced as follows: + + * When a connection using asynchronous IO begins a database + transaction, the database is locked immediately. However the + lock is not released until after all relevant operations + in the write-queue have been flushed to disk. This means + (for example) that the database may remain locked for some + time after a "COMMIT" or "ROLLBACK" is issued. + + * If an application using asynchronous IO executes transactions + in quick succession, other database users may be effectively + locked out of the database. This is because when a BEGIN + is executed, a database lock is established immediately. But + when the corresponding COMMIT or ROLLBACK occurs, the lock + is not released until the relevant part of the write-queue + has been flushed through. As a result, if a COMMIT is followed + by a BEGIN before the write-queue is flushed through, the database + is never unlocked,preventing other processes from accessing + the database. + + File-locking may be disabled at runtime using the sqlite3async_control() + API (see below). This may improve performance when an NFS or other + network file-system, as the synchronous round-trips to the server be + required to establish file locks are avoided. However, if multiple + connections attempt to access the same database file when file-locking + is disabled, application crashes and database corruption is a likely + outcome. + + +2. COMPILATION AND USAGE + + The asynchronous IO extension consists of a single file of C code + (sqlite3async.c), and a header file (sqlite3async.h) that defines the + C API used by applications to activate and control the modules + functionality. + + To use the asynchronous IO extension, compile sqlite3async.c as + part of the application that uses SQLite. Then use the API defined + in sqlite3async.h to initialize and configure the module. + + The asynchronous IO VFS API is described in detail in comments in + sqlite3async.h. Using the API usually consists of the following steps: + + 1. Register the asynchronous IO VFS with SQLite by calling the + sqlite3async_initialize() function. + + 2. Create a background thread to perform write operations and call + sqlite3async_run(). + + 3. Use the normal SQLite API to read and write to databases via + the asynchronous IO VFS. + + Refer to sqlite3async.h for details. + + +3. PORTING + + Currently the asynchronous IO extension is compatible with win32 systems + and systems that support the pthreads interface, including Mac OSX, Linux, + and other varieties of Unix. + + To port the asynchronous IO extension to another platform, the user must + implement mutex and condition variable primitives for the new platform. + Currently there is no externally available interface to allow this, but + modifying the code within sqlite3async.c to include the new platforms + concurrency primitives is relatively easy. Search within sqlite3async.c + for the comment string "PORTING FUNCTIONS" for details. Then implement + new versions of each of the following: + + static void async_mutex_enter(int eMutex); + static void async_mutex_leave(int eMutex); + static void async_cond_wait(int eCond, int eMutex); + static void async_cond_signal(int eCond); + static void async_sched_yield(void); + + The functionality required of each of the above functions is described + in comments in sqlite3async.c. + diff --git a/ext/async/sqlite3async.c b/ext/async/sqlite3async.c new file mode 100644 index 0000000..9d912b1 --- /dev/null +++ b/ext/async/sqlite3async.c @@ -0,0 +1,1680 @@ +/* +** 2005 December 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. +** +************************************************************************* +** +** $Id: sqlite3async.c,v 1.6 2009/04/30 17:45:34 shane Exp $ +** +** This file contains the implementation of an asynchronous IO backend +** for SQLite. +*/ + +#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) + +#include "sqlite3async.h" +#include "sqlite3.h" +#include +#include +#include + +/* Useful macros used in several places */ +#define MIN(x,y) ((x)<(y)?(x):(y)) +#define MAX(x,y) ((x)>(y)?(x):(y)) + +#ifndef SQLITE_AMALGAMATION +/* Macro to mark parameters as unused and silence compiler warnings. */ +#define UNUSED_PARAMETER(x) (void)(x) +#endif + +/* Forward references */ +typedef struct AsyncWrite AsyncWrite; +typedef struct AsyncFile AsyncFile; +typedef struct AsyncFileData AsyncFileData; +typedef struct AsyncFileLock AsyncFileLock; +typedef struct AsyncLock AsyncLock; + +/* Enable for debugging */ +#ifndef NDEBUG +#include +static int sqlite3async_trace = 0; +# define ASYNC_TRACE(X) if( sqlite3async_trace ) asyncTrace X +static void asyncTrace(const char *zFormat, ...){ + char *z; + va_list ap; + va_start(ap, zFormat); + z = sqlite3_vmprintf(zFormat, ap); + va_end(ap); + fprintf(stderr, "[%d] %s", 0 /* (int)pthread_self() */, z); + sqlite3_free(z); +} +#else +# define ASYNC_TRACE(X) +#endif + +/* +** THREAD SAFETY NOTES +** +** Basic rules: +** +** * Both read and write access to the global write-op queue must be +** protected by the async.queueMutex. As are the async.ioError and +** async.nFile variables. +** +** * The async.pLock list and all AsyncLock and AsyncFileLock +** structures must be protected by the async.lockMutex mutex. +** +** * The file handles from the underlying system are not assumed to +** be thread safe. +** +** * See the last two paragraphs under "The Writer Thread" for +** an assumption to do with file-handle synchronization by the Os. +** +** Deadlock prevention: +** +** There are three mutex used by the system: the "writer" mutex, +** the "queue" mutex and the "lock" mutex. Rules are: +** +** * It is illegal to block on the writer mutex when any other mutex +** are held, and +** +** * It is illegal to block on the queue mutex when the lock mutex +** is held. +** +** i.e. mutex's must be grabbed in the order "writer", "queue", "lock". +** +** File system operations (invoked by SQLite thread): +** +** xOpen +** xDelete +** xFileExists +** +** File handle operations (invoked by SQLite thread): +** +** asyncWrite, asyncClose, asyncTruncate, asyncSync +** +** The operations above add an entry to the global write-op list. They +** prepare the entry, acquire the async.queueMutex momentarily while +** list pointers are manipulated to insert the new entry, then release +** the mutex and signal the writer thread to wake up in case it happens +** to be asleep. +** +** +** asyncRead, asyncFileSize. +** +** Read operations. Both of these read from both the underlying file +** first then adjust their result based on pending writes in the +** write-op queue. So async.queueMutex is held for the duration +** of these operations to prevent other threads from changing the +** queue in mid operation. +** +** +** asyncLock, asyncUnlock, asyncCheckReservedLock +** +** These primitives implement in-process locking using a hash table +** on the file name. Files are locked correctly for connections coming +** from the same process. But other processes cannot see these locks +** and will therefore not honor them. +** +** +** The writer thread: +** +** The async.writerMutex is used to make sure only there is only +** a single writer thread running at a time. +** +** Inside the writer thread is a loop that works like this: +** +** WHILE (write-op list is not empty) +** Do IO operation at head of write-op list +** Remove entry from head of write-op list +** END WHILE +** +** The async.queueMutex is always held during the test, and when the entry is removed from the head +** of the write-op list. Sometimes it is held for the interim +** period (while the IO is performed), and sometimes it is +** relinquished. It is relinquished if (a) the IO op is an +** ASYNC_CLOSE or (b) when the file handle was opened, two of +** the underlying systems handles were opened on the same +** file-system entry. +** +** If condition (b) above is true, then one file-handle +** (AsyncFile.pBaseRead) is used exclusively by sqlite threads to read the +** file, the other (AsyncFile.pBaseWrite) by sqlite3_async_flush() +** threads to perform write() operations. This means that read +** operations are not blocked by asynchronous writes (although +** asynchronous writes may still be blocked by reads). +** +** This assumes that the OS keeps two handles open on the same file +** properly in sync. That is, any read operation that starts after a +** write operation on the same file system entry has completed returns +** data consistent with the write. We also assume that if one thread +** reads a file while another is writing it all bytes other than the +** ones actually being written contain valid data. +** +** If the above assumptions are not true, set the preprocessor symbol +** SQLITE_ASYNC_TWO_FILEHANDLES to 0. +*/ + + +#ifndef NDEBUG +# define TESTONLY( X ) X +#else +# define TESTONLY( X ) +#endif + +/* +** PORTING FUNCTIONS +** +** There are two definitions of the following functions. One for pthreads +** compatible systems and one for Win32. These functions isolate the OS +** specific code required by each platform. +** +** The system uses three mutexes and a single condition variable. To +** block on a mutex, async_mutex_enter() is called. The parameter passed +** to async_mutex_enter(), which must be one of ASYNC_MUTEX_LOCK, +** ASYNC_MUTEX_QUEUE or ASYNC_MUTEX_WRITER, identifies which of the three +** mutexes to lock. Similarly, to unlock a mutex, async_mutex_leave() is +** called with a parameter identifying the mutex being unlocked. Mutexes +** are not recursive - it is an error to call async_mutex_enter() to +** lock a mutex that is already locked, or to call async_mutex_leave() +** to unlock a mutex that is not currently locked. +** +** The async_cond_wait() and async_cond_signal() functions are modelled +** on the pthreads functions with similar names. The first parameter to +** both functions is always ASYNC_COND_QUEUE. When async_cond_wait() +** is called the mutex identified by the second parameter must be held. +** The mutex is unlocked, and the calling thread simultaneously begins +** waiting for the condition variable to be signalled by another thread. +** After another thread signals the condition variable, the calling +** thread stops waiting, locks mutex eMutex and returns. The +** async_cond_signal() function is used to signal the condition variable. +** It is assumed that the mutex used by the thread calling async_cond_wait() +** is held by the caller of async_cond_signal() (otherwise there would be +** a race condition). +** +** It is guaranteed that no other thread will call async_cond_wait() when +** there is already a thread waiting on the condition variable. +** +** The async_sched_yield() function is called to suggest to the operating +** system that it would be a good time to shift the current thread off the +** CPU. The system will still work if this function is not implemented +** (it is not currently implemented for win32), but it might be marginally +** more efficient if it is. +*/ +static void async_mutex_enter(int eMutex); +static void async_mutex_leave(int eMutex); +static void async_cond_wait(int eCond, int eMutex); +static void async_cond_signal(int eCond); +static void async_sched_yield(void); + +/* +** There are also two definitions of the following. async_os_initialize() +** is called when the asynchronous VFS is first installed, and os_shutdown() +** is called when it is uninstalled (from within sqlite3async_shutdown()). +** +** For pthreads builds, both of these functions are no-ops. For win32, +** they provide an opportunity to initialize and finalize the required +** mutex and condition variables. +** +** If async_os_initialize() returns other than zero, then the initialization +** fails and SQLITE_ERROR is returned to the user. +*/ +static int async_os_initialize(void); +static void async_os_shutdown(void); + +/* Values for use as the 'eMutex' argument of the above functions. The +** integer values assigned to these constants are important for assert() +** statements that verify that mutexes are locked in the correct order. +** Specifically, it is unsafe to try to lock mutex N while holding a lock +** on mutex M if (M<=N). +*/ +#define ASYNC_MUTEX_LOCK 0 +#define ASYNC_MUTEX_QUEUE 1 +#define ASYNC_MUTEX_WRITER 2 + +/* Values for use as the 'eCond' argument of the above functions. */ +#define ASYNC_COND_QUEUE 0 + +/************************************************************************* +** Start of OS specific code. +*/ +#if SQLITE_OS_WIN || defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) + +#include + +/* The following block contains the win32 specific code. */ + +#define mutex_held(X) (GetCurrentThreadId()==primitives.aHolder[X]) + +static struct AsyncPrimitives { + int isInit; + DWORD aHolder[3]; + CRITICAL_SECTION aMutex[3]; + HANDLE aCond[1]; +} primitives = { 0 }; + +static int async_os_initialize(void){ + if( !primitives.isInit ){ + primitives.aCond[0] = CreateEvent(NULL, TRUE, FALSE, 0); + if( primitives.aCond[0]==NULL ){ + return 1; + } + InitializeCriticalSection(&primitives.aMutex[0]); + InitializeCriticalSection(&primitives.aMutex[1]); + InitializeCriticalSection(&primitives.aMutex[2]); + primitives.isInit = 1; + } + return 0; +} +static void async_os_shutdown(void){ + if( primitives.isInit ){ + DeleteCriticalSection(&primitives.aMutex[0]); + DeleteCriticalSection(&primitives.aMutex[1]); + DeleteCriticalSection(&primitives.aMutex[2]); + CloseHandle(primitives.aCond[0]); + primitives.isInit = 0; + } +} + +/* The following block contains the Win32 specific code. */ +static void async_mutex_enter(int eMutex){ + assert( eMutex==0 || eMutex==1 || eMutex==2 ); + assert( eMutex!=2 || (!mutex_held(0) && !mutex_held(1) && !mutex_held(2)) ); + assert( eMutex!=1 || (!mutex_held(0) && !mutex_held(1)) ); + assert( eMutex!=0 || (!mutex_held(0)) ); + EnterCriticalSection(&primitives.aMutex[eMutex]); + TESTONLY( primitives.aHolder[eMutex] = GetCurrentThreadId(); ) +} +static void async_mutex_leave(int eMutex){ + assert( eMutex==0 || eMutex==1 || eMutex==2 ); + assert( mutex_held(eMutex) ); + TESTONLY( primitives.aHolder[eMutex] = 0; ) + LeaveCriticalSection(&primitives.aMutex[eMutex]); +} +static void async_cond_wait(int eCond, int eMutex){ + ResetEvent(primitives.aCond[eCond]); + async_mutex_leave(eMutex); + WaitForSingleObject(primitives.aCond[eCond], INFINITE); + async_mutex_enter(eMutex); +} +static void async_cond_signal(int eCond){ + assert( mutex_held(ASYNC_MUTEX_QUEUE) ); + SetEvent(primitives.aCond[eCond]); +} +static void async_sched_yield(void){ + Sleep(0); +} +#else + +/* The following block contains the pthreads specific code. */ +#include +#include + +#define mutex_held(X) pthread_equal(primitives.aHolder[X], pthread_self()) + +static int async_os_initialize(void) {return 0;} +static void async_os_shutdown(void) {} + +static struct AsyncPrimitives { + pthread_mutex_t aMutex[3]; + pthread_cond_t aCond[1]; + pthread_t aHolder[3]; +} primitives = { + { PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER, + PTHREAD_MUTEX_INITIALIZER + } , { + PTHREAD_COND_INITIALIZER + } , { 0, 0, 0 } +}; + +static void async_mutex_enter(int eMutex){ + assert( eMutex==0 || eMutex==1 || eMutex==2 ); + assert( eMutex!=2 || (!mutex_held(0) && !mutex_held(1) && !mutex_held(2)) ); + assert( eMutex!=1 || (!mutex_held(0) && !mutex_held(1)) ); + assert( eMutex!=0 || (!mutex_held(0)) ); + pthread_mutex_lock(&primitives.aMutex[eMutex]); + TESTONLY( primitives.aHolder[eMutex] = pthread_self(); ) +} +static void async_mutex_leave(int eMutex){ + assert( eMutex==0 || eMutex==1 || eMutex==2 ); + assert( mutex_held(eMutex) ); + TESTONLY( primitives.aHolder[eMutex] = 0; ) + pthread_mutex_unlock(&primitives.aMutex[eMutex]); +} +static void async_cond_wait(int eCond, int eMutex){ + assert( eMutex==0 || eMutex==1 || eMutex==2 ); + assert( mutex_held(eMutex) ); + TESTONLY( primitives.aHolder[eMutex] = 0; ) + pthread_cond_wait(&primitives.aCond[eCond], &primitives.aMutex[eMutex]); + TESTONLY( primitives.aHolder[eMutex] = pthread_self(); ) +} +static void async_cond_signal(int eCond){ + assert( mutex_held(ASYNC_MUTEX_QUEUE) ); + pthread_cond_signal(&primitives.aCond[eCond]); +} +static void async_sched_yield(void){ + sched_yield(); +} +#endif +/* +** End of OS specific code. +*************************************************************************/ + +#define assert_mutex_is_held(X) assert( mutex_held(X) ) + + +#ifndef SQLITE_ASYNC_TWO_FILEHANDLES +/* #define SQLITE_ASYNC_TWO_FILEHANDLES 0 */ +#define SQLITE_ASYNC_TWO_FILEHANDLES 1 +#endif + +/* +** State information is held in the static variable "async" defined +** as the following structure. +** +** Both async.ioError and async.nFile are protected by async.queueMutex. +*/ +static struct TestAsyncStaticData { + AsyncWrite *pQueueFirst; /* Next write operation to be processed */ + AsyncWrite *pQueueLast; /* Last write operation on the list */ + AsyncLock *pLock; /* Linked list of all AsyncLock structures */ + volatile int ioDelay; /* Extra delay between write operations */ + volatile int eHalt; /* One of the SQLITEASYNC_HALT_XXX values */ + volatile int bLockFiles; /* Current value of "lockfiles" parameter */ + int ioError; /* True if an IO error has occurred */ + int nFile; /* Number of open files (from sqlite pov) */ +} async = { 0,0,0,0,0,1,0,0 }; + +/* Possible values of AsyncWrite.op */ +#define ASYNC_NOOP 0 +#define ASYNC_WRITE 1 +#define ASYNC_SYNC 2 +#define ASYNC_TRUNCATE 3 +#define ASYNC_CLOSE 4 +#define ASYNC_DELETE 5 +#define ASYNC_OPENEXCLUSIVE 6 +#define ASYNC_UNLOCK 7 + +/* Names of opcodes. Used for debugging only. +** Make sure these stay in sync with the macros above! +*/ +static const char *azOpcodeName[] = { + "NOOP", "WRITE", "SYNC", "TRUNCATE", "CLOSE", "DELETE", "OPENEX", "UNLOCK" +}; + +/* +** Entries on the write-op queue are instances of the AsyncWrite +** structure, defined here. +** +** The interpretation of the iOffset and nByte variables varies depending +** on the value of AsyncWrite.op: +** +** ASYNC_NOOP: +** No values used. +** +** ASYNC_WRITE: +** iOffset -> Offset in file to write to. +** nByte -> Number of bytes of data to write (pointed to by zBuf). +** +** ASYNC_SYNC: +** nByte -> flags to pass to sqlite3OsSync(). +** +** ASYNC_TRUNCATE: +** iOffset -> Size to truncate file to. +** nByte -> Unused. +** +** ASYNC_CLOSE: +** iOffset -> Unused. +** nByte -> Unused. +** +** ASYNC_DELETE: +** iOffset -> Contains the "syncDir" flag. +** nByte -> Number of bytes of zBuf points to (file name). +** +** ASYNC_OPENEXCLUSIVE: +** iOffset -> Value of "delflag". +** nByte -> Number of bytes of zBuf points to (file name). +** +** ASYNC_UNLOCK: +** nByte -> Argument to sqlite3OsUnlock(). +** +** +** For an ASYNC_WRITE operation, zBuf points to the data to write to the file. +** This space is sqlite3_malloc()d along with the AsyncWrite structure in a +** single blob, so is deleted when sqlite3_free() is called on the parent +** structure. +*/ +struct AsyncWrite { + AsyncFileData *pFileData; /* File to write data to or sync */ + int op; /* One of ASYNC_xxx etc. */ + sqlite_int64 iOffset; /* See above */ + int nByte; /* See above */ + char *zBuf; /* Data to write to file (or NULL if op!=ASYNC_WRITE) */ + AsyncWrite *pNext; /* Next write operation (to any file) */ +}; + +/* +** An instance of this structure is created for each distinct open file +** (i.e. if two handles are opened on the one file, only one of these +** structures is allocated) and stored in the async.aLock hash table. The +** keys for async.aLock are the full pathnames of the opened files. +** +** AsyncLock.pList points to the head of a linked list of AsyncFileLock +** structures, one for each handle currently open on the file. +** +** If the opened file is not a main-database (the SQLITE_OPEN_MAIN_DB is +** not passed to the sqlite3OsOpen() call), or if async.bLockFiles is +** false, variables AsyncLock.pFile and AsyncLock.eLock are never used. +** Otherwise, pFile is a file handle opened on the file in question and +** used to obtain the file-system locks required by database connections +** within this process. +** +** See comments above the asyncLock() function for more details on +** the implementation of database locking used by this backend. +*/ +struct AsyncLock { + char *zFile; + int nFile; + sqlite3_file *pFile; + int eLock; + AsyncFileLock *pList; + AsyncLock *pNext; /* Next in linked list headed by async.pLock */ +}; + +/* +** An instance of the following structure is allocated along with each +** AsyncFileData structure (see AsyncFileData.lock), but is only used if the +** file was opened with the SQLITE_OPEN_MAIN_DB. +*/ +struct AsyncFileLock { + int eLock; /* Internally visible lock state (sqlite pov) */ + int eAsyncLock; /* Lock-state with write-queue unlock */ + AsyncFileLock *pNext; +}; + +/* +** The AsyncFile structure is a subclass of sqlite3_file used for +** asynchronous IO. +** +** All of the actual data for the structure is stored in the structure +** pointed to by AsyncFile.pData, which is allocated as part of the +** sqlite3OsOpen() using sqlite3_malloc(). The reason for this is that the +** lifetime of the AsyncFile structure is ended by the caller after OsClose() +** is called, but the data in AsyncFileData may be required by the +** writer thread after that point. +*/ +struct AsyncFile { + sqlite3_io_methods *pMethod; + AsyncFileData *pData; +}; +struct AsyncFileData { + char *zName; /* Underlying OS filename - used for debugging */ + int nName; /* Number of characters in zName */ + sqlite3_file *pBaseRead; /* Read handle to the underlying Os file */ + sqlite3_file *pBaseWrite; /* Write handle to the underlying Os file */ + AsyncFileLock lock; /* Lock state for this handle */ + AsyncLock *pLock; /* AsyncLock object for this file system entry */ + AsyncWrite closeOp; /* Preallocated close operation */ +}; + +/* +** Add an entry to the end of the global write-op list. pWrite should point +** to an AsyncWrite structure allocated using sqlite3_malloc(). The writer +** thread will call sqlite3_free() to free the structure after the specified +** operation has been completed. +** +** Once an AsyncWrite structure has been added to the list, it becomes the +** property of the writer thread and must not be read or modified by the +** caller. +*/ +static void addAsyncWrite(AsyncWrite *pWrite){ + /* We must hold the queue mutex in order to modify the queue pointers */ + if( pWrite->op!=ASYNC_UNLOCK ){ + async_mutex_enter(ASYNC_MUTEX_QUEUE); + } + + /* Add the record to the end of the write-op queue */ + assert( !pWrite->pNext ); + if( async.pQueueLast ){ + assert( async.pQueueFirst ); + async.pQueueLast->pNext = pWrite; + }else{ + async.pQueueFirst = pWrite; + } + async.pQueueLast = pWrite; + ASYNC_TRACE(("PUSH %p (%s %s %d)\n", pWrite, azOpcodeName[pWrite->op], + pWrite->pFileData ? pWrite->pFileData->zName : "-", pWrite->iOffset)); + + if( pWrite->op==ASYNC_CLOSE ){ + async.nFile--; + } + + /* The writer thread might have been idle because there was nothing + ** on the write-op queue for it to do. So wake it up. */ + async_cond_signal(ASYNC_COND_QUEUE); + + /* Drop the queue mutex */ + if( pWrite->op!=ASYNC_UNLOCK ){ + async_mutex_leave(ASYNC_MUTEX_QUEUE); + } +} + +/* +** Increment async.nFile in a thread-safe manner. +*/ +static void incrOpenFileCount(void){ + /* We must hold the queue mutex in order to modify async.nFile */ + async_mutex_enter(ASYNC_MUTEX_QUEUE); + if( async.nFile==0 ){ + async.ioError = SQLITE_OK; + } + async.nFile++; + async_mutex_leave(ASYNC_MUTEX_QUEUE); +} + +/* +** This is a utility function to allocate and populate a new AsyncWrite +** structure and insert it (via addAsyncWrite() ) into the global list. +*/ +static int addNewAsyncWrite( + AsyncFileData *pFileData, + int op, + sqlite3_int64 iOffset, + int nByte, + const char *zByte +){ + AsyncWrite *p; + if( op!=ASYNC_CLOSE && async.ioError ){ + return async.ioError; + } + p = sqlite3_malloc(sizeof(AsyncWrite) + (zByte?nByte:0)); + if( !p ){ + /* The upper layer does not expect operations like OsWrite() to + ** return SQLITE_NOMEM. This is partly because under normal conditions + ** SQLite is required to do rollback without calling malloc(). So + ** if malloc() fails here, treat it as an I/O error. The above + ** layer knows how to handle that. + */ + return SQLITE_IOERR; + } + p->op = op; + p->iOffset = iOffset; + p->nByte = nByte; + p->pFileData = pFileData; + p->pNext = 0; + if( zByte ){ + p->zBuf = (char *)&p[1]; + memcpy(p->zBuf, zByte, nByte); + }else{ + p->zBuf = 0; + } + addAsyncWrite(p); + return SQLITE_OK; +} + +/* +** Close the file. This just adds an entry to the write-op list, the file is +** not actually closed. +*/ +static int asyncClose(sqlite3_file *pFile){ + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + + /* Unlock the file, if it is locked */ + async_mutex_enter(ASYNC_MUTEX_LOCK); + p->lock.eLock = 0; + async_mutex_leave(ASYNC_MUTEX_LOCK); + + addAsyncWrite(&p->closeOp); + return SQLITE_OK; +} + +/* +** Implementation of sqlite3OsWrite() for asynchronous files. Instead of +** writing to the underlying file, this function adds an entry to the end of +** the global AsyncWrite list. Either SQLITE_OK or SQLITE_NOMEM may be +** returned. +*/ +static int asyncWrite( + sqlite3_file *pFile, + const void *pBuf, + int amt, + sqlite3_int64 iOff +){ + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + return addNewAsyncWrite(p, ASYNC_WRITE, iOff, amt, pBuf); +} + +/* +** Read data from the file. First we read from the filesystem, then adjust +** the contents of the buffer based on ASYNC_WRITE operations in the +** write-op queue. +** +** This method holds the mutex from start to finish. +*/ +static int asyncRead( + sqlite3_file *pFile, + void *zOut, + int iAmt, + sqlite3_int64 iOffset +){ + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + int rc = SQLITE_OK; + sqlite3_int64 filesize; + int nRead; + sqlite3_file *pBase = p->pBaseRead; + + /* Grab the write queue mutex for the duration of the call */ + async_mutex_enter(ASYNC_MUTEX_QUEUE); + + /* If an I/O error has previously occurred in this virtual file + ** system, then all subsequent operations fail. + */ + if( async.ioError!=SQLITE_OK ){ + rc = async.ioError; + goto asyncread_out; + } + + if( pBase->pMethods ){ + rc = pBase->pMethods->xFileSize(pBase, &filesize); + if( rc!=SQLITE_OK ){ + goto asyncread_out; + } + nRead = (int)MIN(filesize - iOffset, iAmt); + if( nRead>0 ){ + rc = pBase->pMethods->xRead(pBase, zOut, nRead, iOffset); + ASYNC_TRACE(("READ %s %d bytes at %d\n", p->zName, nRead, iOffset)); + } + } + + if( rc==SQLITE_OK ){ + AsyncWrite *pWrite; + char *zName = p->zName; + + for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ + if( pWrite->op==ASYNC_WRITE && ( + (pWrite->pFileData==p) || + (zName && pWrite->pFileData->zName==zName) + )){ + sqlite3_int64 iBeginOut = (pWrite->iOffset-iOffset); + sqlite3_int64 iBeginIn = -iBeginOut; + int nCopy; + + if( iBeginIn<0 ) iBeginIn = 0; + if( iBeginOut<0 ) iBeginOut = 0; + nCopy = (int)MIN(pWrite->nByte-iBeginIn, iAmt-iBeginOut); + + if( nCopy>0 ){ + memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], nCopy); + ASYNC_TRACE(("OVERREAD %d bytes at %d\n", nCopy, iBeginOut+iOffset)); + } + } + } + } + +asyncread_out: + async_mutex_leave(ASYNC_MUTEX_QUEUE); + return rc; +} + +/* +** Truncate the file to nByte bytes in length. This just adds an entry to +** the write-op list, no IO actually takes place. +*/ +static int asyncTruncate(sqlite3_file *pFile, sqlite3_int64 nByte){ + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + return addNewAsyncWrite(p, ASYNC_TRUNCATE, nByte, 0, 0); +} + +/* +** Sync the file. This just adds an entry to the write-op list, the +** sync() is done later by sqlite3_async_flush(). +*/ +static int asyncSync(sqlite3_file *pFile, int flags){ + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + return addNewAsyncWrite(p, ASYNC_SYNC, 0, flags, 0); +} + +/* +** Read the size of the file. First we read the size of the file system +** entry, then adjust for any ASYNC_WRITE or ASYNC_TRUNCATE operations +** currently in the write-op list. +** +** This method holds the mutex from start to finish. +*/ +int asyncFileSize(sqlite3_file *pFile, sqlite3_int64 *piSize){ + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + int rc = SQLITE_OK; + sqlite3_int64 s = 0; + sqlite3_file *pBase; + + async_mutex_enter(ASYNC_MUTEX_QUEUE); + + /* Read the filesystem size from the base file. If pMethods is NULL, this + ** means the file hasn't been opened yet. In this case all relevant data + ** must be in the write-op queue anyway, so we can omit reading from the + ** file-system. + */ + pBase = p->pBaseRead; + if( pBase->pMethods ){ + rc = pBase->pMethods->xFileSize(pBase, &s); + } + + if( rc==SQLITE_OK ){ + AsyncWrite *pWrite; + for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ + if( pWrite->op==ASYNC_DELETE + && p->zName + && strcmp(p->zName, pWrite->zBuf)==0 + ){ + s = 0; + }else if( pWrite->pFileData && ( + (pWrite->pFileData==p) + || (p->zName && pWrite->pFileData->zName==p->zName) + )){ + switch( pWrite->op ){ + case ASYNC_WRITE: + s = MAX(pWrite->iOffset + (sqlite3_int64)(pWrite->nByte), s); + break; + case ASYNC_TRUNCATE: + s = MIN(s, pWrite->iOffset); + break; + } + } + } + *piSize = s; + } + async_mutex_leave(ASYNC_MUTEX_QUEUE); + return rc; +} + +/* +** Lock or unlock the actual file-system entry. +*/ +static int getFileLock(AsyncLock *pLock){ + int rc = SQLITE_OK; + AsyncFileLock *pIter; + int eRequired = 0; + + if( pLock->pFile ){ + for(pIter=pLock->pList; pIter; pIter=pIter->pNext){ + assert(pIter->eAsyncLock>=pIter->eLock); + if( pIter->eAsyncLock>eRequired ){ + eRequired = pIter->eAsyncLock; + assert(eRequired>=0 && eRequired<=SQLITE_LOCK_EXCLUSIVE); + } + } + + if( eRequired>pLock->eLock ){ + rc = pLock->pFile->pMethods->xLock(pLock->pFile, eRequired); + if( rc==SQLITE_OK ){ + pLock->eLock = eRequired; + } + } + else if( eRequiredeLock && eRequired<=SQLITE_LOCK_SHARED ){ + rc = pLock->pFile->pMethods->xUnlock(pLock->pFile, eRequired); + if( rc==SQLITE_OK ){ + pLock->eLock = eRequired; + } + } + } + + return rc; +} + +/* +** Return the AsyncLock structure from the global async.pLock list +** associated with the file-system entry identified by path zName +** (a string of nName bytes). If no such structure exists, return 0. +*/ +static AsyncLock *findLock(const char *zName, int nName){ + AsyncLock *p = async.pLock; + while( p && (p->nFile!=nName || memcmp(p->zFile, zName, nName)) ){ + p = p->pNext; + } + return p; +} + +/* +** The following two methods - asyncLock() and asyncUnlock() - are used +** to obtain and release locks on database files opened with the +** asynchronous backend. +*/ +static int asyncLock(sqlite3_file *pFile, int eLock){ + int rc = SQLITE_OK; + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + + if( p->zName ){ + async_mutex_enter(ASYNC_MUTEX_LOCK); + if( p->lock.eLockpLock; + AsyncFileLock *pIter; + assert(pLock && pLock->pList); + for(pIter=pLock->pList; pIter; pIter=pIter->pNext){ + if( pIter!=&p->lock && ( + (eLock==SQLITE_LOCK_EXCLUSIVE && pIter->eLock>=SQLITE_LOCK_SHARED) || + (eLock==SQLITE_LOCK_PENDING && pIter->eLock>=SQLITE_LOCK_RESERVED) || + (eLock==SQLITE_LOCK_RESERVED && pIter->eLock>=SQLITE_LOCK_RESERVED) || + (eLock==SQLITE_LOCK_SHARED && pIter->eLock>=SQLITE_LOCK_PENDING) + )){ + rc = SQLITE_BUSY; + } + } + if( rc==SQLITE_OK ){ + p->lock.eLock = eLock; + p->lock.eAsyncLock = MAX(p->lock.eAsyncLock, eLock); + } + assert(p->lock.eAsyncLock>=p->lock.eLock); + if( rc==SQLITE_OK ){ + rc = getFileLock(pLock); + } + } + async_mutex_leave(ASYNC_MUTEX_LOCK); + } + + ASYNC_TRACE(("LOCK %d (%s) rc=%d\n", eLock, p->zName, rc)); + return rc; +} +static int asyncUnlock(sqlite3_file *pFile, int eLock){ + int rc = SQLITE_OK; + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + if( p->zName ){ + AsyncFileLock *pLock = &p->lock; + async_mutex_enter(ASYNC_MUTEX_QUEUE); + async_mutex_enter(ASYNC_MUTEX_LOCK); + pLock->eLock = MIN(pLock->eLock, eLock); + rc = addNewAsyncWrite(p, ASYNC_UNLOCK, 0, eLock, 0); + async_mutex_leave(ASYNC_MUTEX_LOCK); + async_mutex_leave(ASYNC_MUTEX_QUEUE); + } + return rc; +} + +/* +** This function is called when the pager layer first opens a database file +** and is checking for a hot-journal. +*/ +static int asyncCheckReservedLock(sqlite3_file *pFile, int *pResOut){ + int ret = 0; + AsyncFileLock *pIter; + AsyncFileData *p = ((AsyncFile *)pFile)->pData; + + async_mutex_enter(ASYNC_MUTEX_LOCK); + for(pIter=p->pLock->pList; pIter; pIter=pIter->pNext){ + if( pIter->eLock>=SQLITE_LOCK_RESERVED ){ + ret = 1; + break; + } + } + async_mutex_leave(ASYNC_MUTEX_LOCK); + + ASYNC_TRACE(("CHECK-LOCK %d (%s)\n", ret, p->zName)); + *pResOut = ret; + return SQLITE_OK; +} + +/* +** sqlite3_file_control() implementation. +*/ +static int asyncFileControl(sqlite3_file *id, int op, void *pArg){ + switch( op ){ + case SQLITE_FCNTL_LOCKSTATE: { + async_mutex_enter(ASYNC_MUTEX_LOCK); + *(int*)pArg = ((AsyncFile*)id)->pData->lock.eLock; + async_mutex_leave(ASYNC_MUTEX_LOCK); + return SQLITE_OK; + } + } + return SQLITE_ERROR; +} + +/* +** Return the device characteristics and sector-size of the device. It +** is tricky to implement these correctly, as this backend might +** not have an open file handle at this point. +*/ +static int asyncSectorSize(sqlite3_file *pFile){ + UNUSED_PARAMETER(pFile); + return 512; +} +static int asyncDeviceCharacteristics(sqlite3_file *pFile){ + UNUSED_PARAMETER(pFile); + return 0; +} + +static int unlinkAsyncFile(AsyncFileData *pData){ + AsyncFileLock **ppIter; + int rc = SQLITE_OK; + + if( pData->zName ){ + AsyncLock *pLock = pData->pLock; + for(ppIter=&pLock->pList; *ppIter; ppIter=&((*ppIter)->pNext)){ + if( (*ppIter)==&pData->lock ){ + *ppIter = pData->lock.pNext; + break; + } + } + if( !pLock->pList ){ + AsyncLock **pp; + if( pLock->pFile ){ + pLock->pFile->pMethods->xClose(pLock->pFile); + } + for(pp=&async.pLock; *pp!=pLock; pp=&((*pp)->pNext)); + *pp = pLock->pNext; + sqlite3_free(pLock); + }else{ + rc = getFileLock(pLock); + } + } + + return rc; +} + +/* +** The parameter passed to this function is a copy of a 'flags' parameter +** passed to this modules xOpen() method. This function returns true +** if the file should be opened asynchronously, or false if it should +** be opened immediately. +** +** If the file is to be opened asynchronously, then asyncOpen() will add +** an entry to the event queue and the file will not actually be opened +** until the event is processed. Otherwise, the file is opened directly +** by the caller. +*/ +static int doAsynchronousOpen(int flags){ + return (flags&SQLITE_OPEN_CREATE) && ( + (flags&SQLITE_OPEN_MAIN_JOURNAL) || + (flags&SQLITE_OPEN_TEMP_JOURNAL) || + (flags&SQLITE_OPEN_DELETEONCLOSE) + ); +} + +/* +** Open a file. +*/ +static int asyncOpen( + sqlite3_vfs *pAsyncVfs, + const char *zName, + sqlite3_file *pFile, + int flags, + int *pOutFlags +){ + static sqlite3_io_methods async_methods = { + 1, /* iVersion */ + asyncClose, /* xClose */ + asyncRead, /* xRead */ + asyncWrite, /* xWrite */ + asyncTruncate, /* xTruncate */ + asyncSync, /* xSync */ + asyncFileSize, /* xFileSize */ + asyncLock, /* xLock */ + asyncUnlock, /* xUnlock */ + asyncCheckReservedLock, /* xCheckReservedLock */ + asyncFileControl, /* xFileControl */ + asyncSectorSize, /* xSectorSize */ + asyncDeviceCharacteristics /* xDeviceCharacteristics */ + }; + + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + AsyncFile *p = (AsyncFile *)pFile; + int nName = 0; + int rc = SQLITE_OK; + int nByte; + AsyncFileData *pData; + AsyncLock *pLock = 0; + char *z; + int isAsyncOpen = doAsynchronousOpen(flags); + + /* If zName is NULL, then the upper layer is requesting an anonymous file */ + if( zName ){ + nName = (int)strlen(zName)+1; + } + + nByte = ( + sizeof(AsyncFileData) + /* AsyncFileData structure */ + 2 * pVfs->szOsFile + /* AsyncFileData.pBaseRead and pBaseWrite */ + nName /* AsyncFileData.zName */ + ); + z = sqlite3_malloc(nByte); + if( !z ){ + return SQLITE_NOMEM; + } + memset(z, 0, nByte); + pData = (AsyncFileData*)z; + z += sizeof(pData[0]); + pData->pBaseRead = (sqlite3_file*)z; + z += pVfs->szOsFile; + pData->pBaseWrite = (sqlite3_file*)z; + pData->closeOp.pFileData = pData; + pData->closeOp.op = ASYNC_CLOSE; + + if( zName ){ + z += pVfs->szOsFile; + pData->zName = z; + pData->nName = nName; + memcpy(pData->zName, zName, nName); + } + + if( !isAsyncOpen ){ + int flagsout; + rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, &flagsout); + if( rc==SQLITE_OK && (flagsout&SQLITE_OPEN_READWRITE) ){ + rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseWrite, flags, 0); + } + if( pOutFlags ){ + *pOutFlags = flagsout; + } + } + + async_mutex_enter(ASYNC_MUTEX_LOCK); + + if( zName && rc==SQLITE_OK ){ + pLock = findLock(pData->zName, pData->nName); + if( !pLock ){ + int nByte = pVfs->szOsFile + sizeof(AsyncLock) + pData->nName + 1; + pLock = (AsyncLock *)sqlite3_malloc(nByte); + if( pLock ){ + memset(pLock, 0, nByte); + if( async.bLockFiles && (flags&SQLITE_OPEN_MAIN_DB) ){ + pLock->pFile = (sqlite3_file *)&pLock[1]; + rc = pVfs->xOpen(pVfs, pData->zName, pLock->pFile, flags, 0); + if( rc!=SQLITE_OK ){ + sqlite3_free(pLock); + pLock = 0; + } + } + if( pLock ){ + pLock->nFile = pData->nName; + pLock->zFile = &((char *)(&pLock[1]))[pVfs->szOsFile]; + memcpy(pLock->zFile, pData->zName, pLock->nFile); + pLock->pNext = async.pLock; + async.pLock = pLock; + } + }else{ + rc = SQLITE_NOMEM; + } + } + } + + if( rc==SQLITE_OK ){ + p->pMethod = &async_methods; + p->pData = pData; + + /* Link AsyncFileData.lock into the linked list of + ** AsyncFileLock structures for this file. + */ + if( zName ){ + pData->lock.pNext = pLock->pList; + pLock->pList = &pData->lock; + pData->zName = pLock->zFile; + } + }else{ + if( pData->pBaseRead->pMethods ){ + pData->pBaseRead->pMethods->xClose(pData->pBaseRead); + } + if( pData->pBaseWrite->pMethods ){ + pData->pBaseWrite->pMethods->xClose(pData->pBaseWrite); + } + sqlite3_free(pData); + } + + async_mutex_leave(ASYNC_MUTEX_LOCK); + + if( rc==SQLITE_OK ){ + incrOpenFileCount(); + pData->pLock = pLock; + } + + if( rc==SQLITE_OK && isAsyncOpen ){ + rc = addNewAsyncWrite(pData, ASYNC_OPENEXCLUSIVE, (sqlite3_int64)flags,0,0); + if( rc==SQLITE_OK ){ + if( pOutFlags ) *pOutFlags = flags; + }else{ + async_mutex_enter(ASYNC_MUTEX_LOCK); + unlinkAsyncFile(pData); + async_mutex_leave(ASYNC_MUTEX_LOCK); + sqlite3_free(pData); + } + } + if( rc!=SQLITE_OK ){ + p->pMethod = 0; + } + return rc; +} + +/* +** Implementation of sqlite3OsDelete. Add an entry to the end of the +** write-op queue to perform the delete. +*/ +static int asyncDelete(sqlite3_vfs *pAsyncVfs, const char *z, int syncDir){ + UNUSED_PARAMETER(pAsyncVfs); + return addNewAsyncWrite(0, ASYNC_DELETE, syncDir, (int)strlen(z)+1, z); +} + +/* +** Implementation of sqlite3OsAccess. This method holds the mutex from +** start to finish. +*/ +static int asyncAccess( + sqlite3_vfs *pAsyncVfs, + const char *zName, + int flags, + int *pResOut +){ + int rc; + int ret; + AsyncWrite *p; + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + + assert(flags==SQLITE_ACCESS_READWRITE + || flags==SQLITE_ACCESS_READ + || flags==SQLITE_ACCESS_EXISTS + ); + + async_mutex_enter(ASYNC_MUTEX_QUEUE); + rc = pVfs->xAccess(pVfs, zName, flags, &ret); + if( rc==SQLITE_OK && flags==SQLITE_ACCESS_EXISTS ){ + for(p=async.pQueueFirst; p; p = p->pNext){ + if( p->op==ASYNC_DELETE && 0==strcmp(p->zBuf, zName) ){ + ret = 0; + }else if( p->op==ASYNC_OPENEXCLUSIVE + && p->pFileData->zName + && 0==strcmp(p->pFileData->zName, zName) + ){ + ret = 1; + } + } + } + ASYNC_TRACE(("ACCESS(%s): %s = %d\n", + flags==SQLITE_ACCESS_READWRITE?"read-write": + flags==SQLITE_ACCESS_READ?"read":"exists" + , zName, ret) + ); + async_mutex_leave(ASYNC_MUTEX_QUEUE); + *pResOut = ret; + return rc; +} + +/* +** Fill in zPathOut with the full path to the file identified by zPath. +*/ +static int asyncFullPathname( + sqlite3_vfs *pAsyncVfs, + const char *zPath, + int nPathOut, + char *zPathOut +){ + int rc; + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + rc = pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); + + /* Because of the way intra-process file locking works, this backend + ** needs to return a canonical path. The following block assumes the + ** file-system uses unix style paths. + */ + if( rc==SQLITE_OK ){ + int i, j; + int n = nPathOut; + char *z = zPathOut; + 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 rc; +} +static void *asyncDlOpen(sqlite3_vfs *pAsyncVfs, const char *zPath){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + return pVfs->xDlOpen(pVfs, zPath); +} +static void asyncDlError(sqlite3_vfs *pAsyncVfs, int nByte, char *zErrMsg){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + pVfs->xDlError(pVfs, nByte, zErrMsg); +} +static void (*asyncDlSym( + sqlite3_vfs *pAsyncVfs, + void *pHandle, + const char *zSymbol +))(void){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + return pVfs->xDlSym(pVfs, pHandle, zSymbol); +} +static void asyncDlClose(sqlite3_vfs *pAsyncVfs, void *pHandle){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + pVfs->xDlClose(pVfs, pHandle); +} +static int asyncRandomness(sqlite3_vfs *pAsyncVfs, int nByte, char *zBufOut){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + return pVfs->xRandomness(pVfs, nByte, zBufOut); +} +static int asyncSleep(sqlite3_vfs *pAsyncVfs, int nMicro){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + return pVfs->xSleep(pVfs, nMicro); +} +static int asyncCurrentTime(sqlite3_vfs *pAsyncVfs, double *pTimeOut){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; + return pVfs->xCurrentTime(pVfs, pTimeOut); +} + +static sqlite3_vfs async_vfs = { + 1, /* iVersion */ + sizeof(AsyncFile), /* szOsFile */ + 0, /* mxPathname */ + 0, /* pNext */ + SQLITEASYNC_VFSNAME, /* zName */ + 0, /* pAppData */ + asyncOpen, /* xOpen */ + asyncDelete, /* xDelete */ + asyncAccess, /* xAccess */ + asyncFullPathname, /* xFullPathname */ + asyncDlOpen, /* xDlOpen */ + asyncDlError, /* xDlError */ + asyncDlSym, /* xDlSym */ + asyncDlClose, /* xDlClose */ + asyncRandomness, /* xDlError */ + asyncSleep, /* xDlSym */ + asyncCurrentTime /* xDlClose */ +}; + +/* +** This procedure runs in a separate thread, reading messages off of the +** write queue and processing them one by one. +** +** If async.writerHaltNow is true, then this procedure exits +** after processing a single message. +** +** If async.writerHaltWhenIdle is true, then this procedure exits when +** the write queue is empty. +** +** If both of the above variables are false, this procedure runs +** indefinately, waiting for operations to be added to the write queue +** and processing them in the order in which they arrive. +** +** An artifical delay of async.ioDelay milliseconds is inserted before +** each write operation in order to simulate the effect of a slow disk. +** +** Only one instance of this procedure may be running at a time. +*/ +static void asyncWriterThread(void){ + sqlite3_vfs *pVfs = (sqlite3_vfs *)(async_vfs.pAppData); + AsyncWrite *p = 0; + int rc = SQLITE_OK; + int holdingMutex = 0; + + async_mutex_enter(ASYNC_MUTEX_WRITER); + + while( async.eHalt!=SQLITEASYNC_HALT_NOW ){ + int doNotFree = 0; + sqlite3_file *pBase = 0; + + if( !holdingMutex ){ + async_mutex_enter(ASYNC_MUTEX_QUEUE); + } + while( (p = async.pQueueFirst)==0 ){ + if( async.eHalt!=SQLITEASYNC_HALT_NEVER ){ + async_mutex_leave(ASYNC_MUTEX_QUEUE); + break; + }else{ + ASYNC_TRACE(("IDLE\n")); + async_cond_wait(ASYNC_COND_QUEUE, ASYNC_MUTEX_QUEUE); + ASYNC_TRACE(("WAKEUP\n")); + } + } + if( p==0 ) break; + holdingMutex = 1; + + /* Right now this thread is holding the mutex on the write-op queue. + ** Variable 'p' points to the first entry in the write-op queue. In + ** the general case, we hold on to the mutex for the entire body of + ** the loop. + ** + ** However in the cases enumerated below, we relinquish the mutex, + ** perform the IO, and then re-request the mutex before removing 'p' from + ** the head of the write-op queue. The idea is to increase concurrency with + ** sqlite threads. + ** + ** * An ASYNC_CLOSE operation. + ** * An ASYNC_OPENEXCLUSIVE operation. For this one, we relinquish + ** the mutex, call the underlying xOpenExclusive() function, then + ** re-aquire the mutex before seting the AsyncFile.pBaseRead + ** variable. + ** * ASYNC_SYNC and ASYNC_WRITE operations, if + ** SQLITE_ASYNC_TWO_FILEHANDLES was set at compile time and two + ** file-handles are open for the particular file being "synced". + */ + if( async.ioError!=SQLITE_OK && p->op!=ASYNC_CLOSE ){ + p->op = ASYNC_NOOP; + } + if( p->pFileData ){ + pBase = p->pFileData->pBaseWrite; + if( + p->op==ASYNC_CLOSE || + p->op==ASYNC_OPENEXCLUSIVE || + (pBase->pMethods && (p->op==ASYNC_SYNC || p->op==ASYNC_WRITE) ) + ){ + async_mutex_leave(ASYNC_MUTEX_QUEUE); + holdingMutex = 0; + } + if( !pBase->pMethods ){ + pBase = p->pFileData->pBaseRead; + } + } + + switch( p->op ){ + case ASYNC_NOOP: + break; + + case ASYNC_WRITE: + assert( pBase ); + ASYNC_TRACE(("WRITE %s %d bytes at %d\n", + p->pFileData->zName, p->nByte, p->iOffset)); + rc = pBase->pMethods->xWrite(pBase, (void *)(p->zBuf), p->nByte, p->iOffset); + break; + + case ASYNC_SYNC: + assert( pBase ); + ASYNC_TRACE(("SYNC %s\n", p->pFileData->zName)); + rc = pBase->pMethods->xSync(pBase, p->nByte); + break; + + case ASYNC_TRUNCATE: + assert( pBase ); + ASYNC_TRACE(("TRUNCATE %s to %d bytes\n", + p->pFileData->zName, p->iOffset)); + rc = pBase->pMethods->xTruncate(pBase, p->iOffset); + break; + + case ASYNC_CLOSE: { + AsyncFileData *pData = p->pFileData; + ASYNC_TRACE(("CLOSE %s\n", p->pFileData->zName)); + if( pData->pBaseWrite->pMethods ){ + pData->pBaseWrite->pMethods->xClose(pData->pBaseWrite); + } + if( pData->pBaseRead->pMethods ){ + pData->pBaseRead->pMethods->xClose(pData->pBaseRead); + } + + /* Unlink AsyncFileData.lock from the linked list of AsyncFileLock + ** structures for this file. Obtain the async.lockMutex mutex + ** before doing so. + */ + async_mutex_enter(ASYNC_MUTEX_LOCK); + rc = unlinkAsyncFile(pData); + async_mutex_leave(ASYNC_MUTEX_LOCK); + + if( !holdingMutex ){ + async_mutex_enter(ASYNC_MUTEX_QUEUE); + holdingMutex = 1; + } + assert_mutex_is_held(ASYNC_MUTEX_QUEUE); + async.pQueueFirst = p->pNext; + sqlite3_free(pData); + doNotFree = 1; + break; + } + + case ASYNC_UNLOCK: { + AsyncWrite *pIter; + AsyncFileData *pData = p->pFileData; + int eLock = p->nByte; + + /* When a file is locked by SQLite using the async backend, it is + ** locked within the 'real' file-system synchronously. When it is + ** unlocked, an ASYNC_UNLOCK event is added to the write-queue to + ** unlock the file asynchronously. The design of the async backend + ** requires that the 'real' file-system file be locked from the + ** time that SQLite first locks it (and probably reads from it) + ** until all asynchronous write events that were scheduled before + ** SQLite unlocked the file have been processed. + ** + ** This is more complex if SQLite locks and unlocks the file multiple + ** times in quick succession. For example, if SQLite does: + ** + ** lock, write, unlock, lock, write, unlock + ** + ** Each "lock" operation locks the file immediately. Each "write" + ** and "unlock" operation adds an event to the event queue. If the + ** second "lock" operation is performed before the first "unlock" + ** operation has been processed asynchronously, then the first + ** "unlock" cannot be safely processed as is, since this would mean + ** the file was unlocked when the second "write" operation is + ** processed. To work around this, when processing an ASYNC_UNLOCK + ** operation, SQLite: + ** + ** 1) Unlocks the file to the minimum of the argument passed to + ** the xUnlock() call and the current lock from SQLite's point + ** of view, and + ** + ** 2) Only unlocks the file at all if this event is the last + ** ASYNC_UNLOCK event on this file in the write-queue. + */ + assert( holdingMutex==1 ); + assert( async.pQueueFirst==p ); + for(pIter=async.pQueueFirst->pNext; pIter; pIter=pIter->pNext){ + if( pIter->pFileData==pData && pIter->op==ASYNC_UNLOCK ) break; + } + if( !pIter ){ + async_mutex_enter(ASYNC_MUTEX_LOCK); + pData->lock.eAsyncLock = MIN( + pData->lock.eAsyncLock, MAX(pData->lock.eLock, eLock) + ); + assert(pData->lock.eAsyncLock>=pData->lock.eLock); + rc = getFileLock(pData->pLock); + async_mutex_leave(ASYNC_MUTEX_LOCK); + } + break; + } + + case ASYNC_DELETE: + ASYNC_TRACE(("DELETE %s\n", p->zBuf)); + rc = pVfs->xDelete(pVfs, p->zBuf, (int)p->iOffset); + break; + + case ASYNC_OPENEXCLUSIVE: { + int flags = (int)p->iOffset; + AsyncFileData *pData = p->pFileData; + ASYNC_TRACE(("OPEN %s flags=%d\n", p->zBuf, (int)p->iOffset)); + assert(pData->pBaseRead->pMethods==0 && pData->pBaseWrite->pMethods==0); + rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, 0); + assert( holdingMutex==0 ); + async_mutex_enter(ASYNC_MUTEX_QUEUE); + holdingMutex = 1; + break; + } + + default: assert(!"Illegal value for AsyncWrite.op"); + } + + /* If we didn't hang on to the mutex during the IO op, obtain it now + ** so that the AsyncWrite structure can be safely removed from the + ** global write-op queue. + */ + if( !holdingMutex ){ + async_mutex_enter(ASYNC_MUTEX_QUEUE); + holdingMutex = 1; + } + /* ASYNC_TRACE(("UNLINK %p\n", p)); */ + if( p==async.pQueueLast ){ + async.pQueueLast = 0; + } + if( !doNotFree ){ + assert_mutex_is_held(ASYNC_MUTEX_QUEUE); + async.pQueueFirst = p->pNext; + sqlite3_free(p); + } + assert( holdingMutex ); + + /* An IO error has occurred. We cannot report the error back to the + ** connection that requested the I/O since the error happened + ** asynchronously. The connection has already moved on. There + ** really is nobody to report the error to. + ** + ** The file for which the error occurred may have been a database or + ** journal file. Regardless, none of the currently queued operations + ** associated with the same database should now be performed. Nor should + ** any subsequently requested IO on either a database or journal file + ** handle for the same database be accepted until the main database + ** file handle has been closed and reopened. + ** + ** Furthermore, no further IO should be queued or performed on any file + ** handle associated with a database that may have been part of a + ** multi-file transaction that included the database associated with + ** the IO error (i.e. a database ATTACHed to the same handle at some + ** point in time). + */ + if( rc!=SQLITE_OK ){ + async.ioError = rc; + } + + if( async.ioError && !async.pQueueFirst ){ + async_mutex_enter(ASYNC_MUTEX_LOCK); + if( 0==async.pLock ){ + async.ioError = SQLITE_OK; + } + async_mutex_leave(ASYNC_MUTEX_LOCK); + } + + /* Drop the queue mutex before continuing to the next write operation + ** in order to give other threads a chance to work with the write queue. + */ + if( !async.pQueueFirst || !async.ioError ){ + async_mutex_leave(ASYNC_MUTEX_QUEUE); + holdingMutex = 0; + if( async.ioDelay>0 ){ + pVfs->xSleep(pVfs, async.ioDelay*1000); + }else{ + async_sched_yield(); + } + } + } + + async_mutex_leave(ASYNC_MUTEX_WRITER); + return; +} + +/* +** Install the asynchronous VFS. +*/ +int sqlite3async_initialize(const char *zParent, int isDefault){ + int rc = SQLITE_OK; + if( async_vfs.pAppData==0 ){ + sqlite3_vfs *pParent = sqlite3_vfs_find(zParent); + if( !pParent || async_os_initialize() ){ + rc = SQLITE_ERROR; + }else if( SQLITE_OK!=(rc = sqlite3_vfs_register(&async_vfs, isDefault)) ){ + async_os_shutdown(); + }else{ + async_vfs.pAppData = (void *)pParent; + async_vfs.mxPathname = ((sqlite3_vfs *)async_vfs.pAppData)->mxPathname; + } + } + return rc; +} + +/* +** Uninstall the asynchronous VFS. +*/ +void sqlite3async_shutdown(void){ + if( async_vfs.pAppData ){ + async_os_shutdown(); + sqlite3_vfs_unregister((sqlite3_vfs *)&async_vfs); + async_vfs.pAppData = 0; + } +} + +/* +** Process events on the write-queue. +*/ +void sqlite3async_run(void){ + asyncWriterThread(); +} + +/* +** Control/configure the asynchronous IO system. +*/ +int sqlite3async_control(int op, ...){ + va_list ap; + va_start(ap, op); + switch( op ){ + case SQLITEASYNC_HALT: { + int eWhen = va_arg(ap, int); + if( eWhen!=SQLITEASYNC_HALT_NEVER + && eWhen!=SQLITEASYNC_HALT_NOW + && eWhen!=SQLITEASYNC_HALT_IDLE + ){ + return SQLITE_MISUSE; + } + async.eHalt = eWhen; + async_mutex_enter(ASYNC_MUTEX_QUEUE); + async_cond_signal(ASYNC_COND_QUEUE); + async_mutex_leave(ASYNC_MUTEX_QUEUE); + break; + } + + case SQLITEASYNC_DELAY: { + int iDelay = va_arg(ap, int); + if( iDelay<0 ){ + return SQLITE_MISUSE; + } + async.ioDelay = iDelay; + break; + } + + case SQLITEASYNC_LOCKFILES: { + int bLock = va_arg(ap, int); + async_mutex_enter(ASYNC_MUTEX_QUEUE); + if( async.nFile || async.pQueueFirst ){ + async_mutex_leave(ASYNC_MUTEX_QUEUE); + return SQLITE_MISUSE; + } + async.bLockFiles = bLock; + async_mutex_leave(ASYNC_MUTEX_QUEUE); + break; + } + + case SQLITEASYNC_GET_HALT: { + int *peWhen = va_arg(ap, int *); + *peWhen = async.eHalt; + break; + } + case SQLITEASYNC_GET_DELAY: { + int *piDelay = va_arg(ap, int *); + *piDelay = async.ioDelay; + break; + } + case SQLITEASYNC_GET_LOCKFILES: { + int *piDelay = va_arg(ap, int *); + *piDelay = async.bLockFiles; + break; + } + + default: + return SQLITE_ERROR; + } + return SQLITE_OK; +} + +#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) */ + diff --git a/ext/async/sqlite3async.h b/ext/async/sqlite3async.h new file mode 100644 index 0000000..100dfff --- /dev/null +++ b/ext/async/sqlite3async.h @@ -0,0 +1,213 @@ + +#ifndef __SQLITEASYNC_H_ +#define __SQLITEASYNC_H_ 1 + +#define SQLITEASYNC_VFSNAME "sqlite3async" + +/* +** THREAD SAFETY NOTES: +** +** Of the four API functions in this file, the following are not threadsafe: +** +** sqlite3async_initialize() +** sqlite3async_shutdown() +** +** Care must be taken that neither of these functions is called while +** another thread may be calling either any sqlite3async_XXX() function +** or an sqlite3_XXX() API function related to a database handle that +** is using the asynchronous IO VFS. +** +** These functions: +** +** sqlite3async_run() +** sqlite3async_control() +** +** are threadsafe. It is quite safe to call either of these functions even +** if another thread may also be calling one of them or an sqlite3_XXX() +** function related to a database handle that uses the asynchronous IO VFS. +*/ + +/* +** Initialize the asynchronous IO VFS and register it with SQLite using +** sqlite3_vfs_register(). If the asynchronous VFS is already initialized +** and registered, this function is a no-op. The asynchronous IO VFS +** is registered as "sqlite3async". +** +** The asynchronous IO VFS does not make operating system IO requests +** directly. Instead, it uses an existing VFS implementation for all +** required file-system operations. If the first parameter to this function +** is NULL, then the current default VFS is used for IO. If it is not +** NULL, then it must be the name of an existing VFS. In other words, the +** first argument to this function is passed to sqlite3_vfs_find() to +** locate the VFS to use for all real IO operations. This VFS is known +** as the "parent VFS". +** +** If the second parameter to this function is non-zero, then the +** asynchronous IO VFS is registered as the default VFS for all SQLite +** database connections within the process. Otherwise, the asynchronous IO +** VFS is only used by connections opened using sqlite3_open_v2() that +** specifically request VFS "sqlite3async". +** +** If a parent VFS cannot be located, then SQLITE_ERROR is returned. +** In the unlikely event that operating system specific initialization +** fails (win32 systems create the required critical section and event +** objects within this function), then SQLITE_ERROR is also returned. +** Finally, if the call to sqlite3_vfs_register() returns an error, then +** the error code is returned to the user by this function. In all three +** of these cases, intialization has failed and the asynchronous IO VFS +** is not registered with SQLite. +** +** Otherwise, if no error occurs, SQLITE_OK is returned. +*/ +int sqlite3async_initialize(const char *zParent, int isDefault); + +/* +** This function unregisters the asynchronous IO VFS using +** sqlite3_vfs_unregister(). +** +** On win32 platforms, this function also releases the small number of +** critical section and event objects created by sqlite3async_initialize(). +*/ +void sqlite3async_shutdown(); + +/* +** This function may only be called when the asynchronous IO VFS is +** installed (after a call to sqlite3async_initialize()). It processes +** zero or more queued write operations before returning. It is expected +** (but not required) that this function will be called by a different +** thread than those threads that use SQLite. The "background thread" +** that performs IO. +** +** How many queued write operations are performed before returning +** depends on the global setting configured by passing the SQLITEASYNC_HALT +** verb to sqlite3async_control() (see below for details). By default +** this function never returns - it processes all pending operations and +** then blocks waiting for new ones. +** +** If multiple simultaneous calls are made to sqlite3async_run() from two +** or more threads, then the calls are serialized internally. +*/ +void sqlite3async_run(); + +/* +** This function may only be called when the asynchronous IO VFS is +** installed (after a call to sqlite3async_initialize()). It is used +** to query or configure various parameters that affect the operation +** of the asynchronous IO VFS. At present there are three parameters +** supported: +** +** * The "halt" parameter, which configures the circumstances under +** which the sqlite3async_run() parameter is configured. +** +** * The "delay" parameter. Setting the delay parameter to a non-zero +** value causes the sqlite3async_run() function to sleep for the +** configured number of milliseconds between each queued write +** operation. +** +** * The "lockfiles" parameter. This parameter determines whether or +** not the asynchronous IO VFS locks the database files it operates +** on. Disabling file locking can improve throughput. +** +** This function is always passed two arguments. When setting the value +** of a parameter, the first argument must be one of SQLITEASYNC_HALT, +** SQLITEASYNC_DELAY or SQLITEASYNC_LOCKFILES. The second argument must +** be passed the new value for the parameter as type "int". +** +** When querying the current value of a paramter, the first argument must +** be one of SQLITEASYNC_GET_HALT, GET_DELAY or GET_LOCKFILES. The second +** argument to this function must be of type (int *). The current value +** of the queried parameter is copied to the memory pointed to by the +** second argument. For example: +** +** int eCurrentHalt; +** int eNewHalt = SQLITEASYNC_HALT_IDLE; +** +** sqlite3async_control(SQLITEASYNC_HALT, eNewHalt); +** sqlite3async_control(SQLITEASYNC_GET_HALT, &eCurrentHalt); +** assert( eNewHalt==eCurrentHalt ); +** +** See below for more detail on each configuration parameter. +** +** SQLITEASYNC_HALT: +** +** This is used to set the value of the "halt" parameter. The second +** argument must be one of the SQLITEASYNC_HALT_XXX symbols defined +** below (either NEVER, IDLE and NOW). +** +** If the parameter is set to NEVER, then calls to sqlite3async_run() +** never return. This is the default setting. If the parameter is set +** to IDLE, then calls to sqlite3async_run() return as soon as the +** queue of pending write operations is empty. If the parameter is set +** to NOW, then calls to sqlite3async_run() return as quickly as +** possible, without processing any pending write requests. +** +** If an attempt is made to set this parameter to an integer value other +** than SQLITEASYNC_HALT_NEVER, IDLE or NOW, then sqlite3async_control() +** returns SQLITE_MISUSE and the current value of the parameter is not +** modified. +** +** Modifying the "halt" parameter affects calls to sqlite3async_run() +** made by other threads that are currently in progress. +** +** SQLITEASYNC_DELAY: +** +** This is used to set the value of the "delay" parameter. If set to +** a non-zero value, then after completing a pending write request, the +** sqlite3async_run() function sleeps for the configured number of +** milliseconds. +** +** If an attempt is made to set this parameter to a negative value, +** sqlite3async_control() returns SQLITE_MISUSE and the current value +** of the parameter is not modified. +** +** Modifying the "delay" parameter affects calls to sqlite3async_run() +** made by other threads that are currently in progress. +** +** SQLITEASYNC_LOCKFILES: +** +** This is used to set the value of the "lockfiles" parameter. This +** parameter must be set to either 0 or 1. If set to 1, then the +** asynchronous IO VFS uses the xLock() and xUnlock() methods of the +** parent VFS to lock database files being read and/or written. If +** the parameter is set to 0, then these locks are omitted. +** +** This parameter may only be set when there are no open database +** connections using the VFS and the queue of pending write requests +** is empty. Attempting to set it when this is not true, or to set it +** to a value other than 0 or 1 causes sqlite3async_control() to return +** SQLITE_MISUSE and the value of the parameter to remain unchanged. +** +** If this parameter is set to zero, then it is only safe to access the +** database via the asynchronous IO VFS from within a single process. If +** while writing to the database via the asynchronous IO VFS the database +** is also read or written from within another process, or via another +** connection that does not use the asynchronous IO VFS within the same +** process, the results are undefined (and may include crashes or database +** corruption). +** +** Alternatively, if this parameter is set to 1, then it is safe to access +** the database from multiple connections within multiple processes using +** either the asynchronous IO VFS or the parent VFS directly. +*/ +int sqlite3async_control(int op, ...); + +/* +** Values that can be used as the first argument to sqlite3async_control(). +*/ +#define SQLITEASYNC_HALT 1 +#define SQLITEASYNC_GET_HALT 2 +#define SQLITEASYNC_DELAY 3 +#define SQLITEASYNC_GET_DELAY 4 +#define SQLITEASYNC_LOCKFILES 5 +#define SQLITEASYNC_GET_LOCKFILES 6 + +/* +** If the first argument to sqlite3async_control() is SQLITEASYNC_HALT, +** the second argument should be one of the following. +*/ +#define SQLITEASYNC_HALT_NEVER 0 /* Never halt (default value) */ +#define SQLITEASYNC_HALT_NOW 1 /* Halt as soon as possible */ +#define SQLITEASYNC_HALT_IDLE 2 /* Halt when write-queue is empty */ + +#endif /* ifndef __SQLITEASYNC_H_ */ + diff --git a/main.mk b/main.mk index 718ba49..8ae0ba7 100644 --- a/main.mk +++ b/main.mk @@ -46,6 +46,7 @@ # TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3 +TCCX += -I$(TOP)/ext/async # Object files for the SQLite library. # @@ -255,7 +256,8 @@ TESTSRC2 = \ $(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_tokenizer.c \ + $(TOP)/ext/async/sqlite3async.c # Header files used by all library source files. # diff --git a/src/.#expr.c.1.431 b/src/.#expr.c.1.431 new file mode 100644 index 0000000..a0a7194 --- /dev/null +++ b/src/.#expr.c.1.431 @@ -0,0 +1,3392 @@ +/* +** 2001 September 15 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This file contains routines used for analyzing expressions and +** for generating VDBE code that evaluates expressions in SQLite. +** +** $Id: expr.c,v 1.431 2009/05/01 21:13:37 drh Exp $ +*/ +#include "sqliteInt.h" + +/* +** Return the 'affinity' of the expression pExpr if any. +** +** If pExpr is a column, a reference to a column via an 'AS' alias, +** or a sub-select with a column as the return value, then the +** affinity of that column is returned. Otherwise, 0x00 is returned, +** indicating no affinity for the expression. +** +** i.e. the WHERE clause expresssions in the following statements all +** have an affinity: +** +** CREATE TABLE t1(a); +** SELECT * FROM t1 WHERE a; +** SELECT a AS b FROM t1 WHERE b; +** SELECT * FROM t1 WHERE (select a from t1); +*/ +char sqlite3ExprAffinity(Expr *pExpr){ + int op = pExpr->op; + if( op==TK_SELECT ){ + assert( pExpr->flags&EP_xIsSelect ); + return sqlite3ExprAffinity(pExpr->x.pSelect->pEList->a[0].pExpr); + } +#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 + ){ + /* 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 ); + return pExpr->pTab->aCol[j].affinity; + } + return pExpr->affinity; +} + +/* +** Set the collating sequence for expression pExpr to be the collating +** sequence named by pToken. Return a pointer to the revised expression. +** The collating sequence is marked as "explicit" using the EP_ExpCollate +** flag. An explicit collating sequence will override implicit +** collating sequences. +*/ +Expr *sqlite3ExprSetColl(Parse *pParse, Expr *pExpr, Token *pCollName){ + char *zColl = 0; /* Dequoted name of collation sequence */ + CollSeq *pColl; + sqlite3 *db = pParse->db; + zColl = sqlite3NameFromToken(db, pCollName); + if( pExpr && zColl ){ + pColl = sqlite3LocateCollSeq(pParse, zColl, -1); + if( pColl ){ + pExpr->pColl = pColl; + pExpr->flags |= EP_ExpCollate; + } + } + sqlite3DbFree(db, zColl); + return pExpr; +} + +/* +** Return the default collation sequence for the expression pExpr. If +** there is no default collation type, return 0. +*/ +CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){ + CollSeq *pColl = 0; + Expr *p = pExpr; + 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 ){ + /* 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 ){ + sqlite3 *db = pParse->db; + zColl = p->pTab->aCol[j].zColl; + pColl = sqlite3FindCollSeq(db, ENC(db), zColl, -1, 0); + pExpr->pColl = pColl; + } + break; + } + if( op!=TK_CAST && op!=TK_UPLUS ){ + break; + } + p = p->pLeft; + } + if( sqlite3CheckCollSeq(pParse, pColl) ){ + pColl = 0; + } + return pColl; +} + +/* +** pExpr is an operand of a comparison operator. aff2 is the +** type affinity of the other operand. This routine returns the +** type affinity that should be used for the comparison operator. +*/ +char sqlite3CompareAffinity(Expr *pExpr, char aff2){ + char aff1 = sqlite3ExprAffinity(pExpr); + if( aff1 && aff2 ){ + /* Both sides of the comparison are columns. If one has numeric + ** affinity, use that. Otherwise use no affinity. + */ + if( sqlite3IsNumericAffinity(aff1) || sqlite3IsNumericAffinity(aff2) ){ + return SQLITE_AFF_NUMERIC; + }else{ + return SQLITE_AFF_NONE; + } + }else if( !aff1 && !aff2 ){ + /* Neither side of the comparison is a column. Compare the + ** results directly. + */ + return SQLITE_AFF_NONE; + }else{ + /* One side is a column, the other is not. Use the columns affinity. */ + assert( aff1==0 || aff2==0 ); + return (aff1 + aff2); + } +} + +/* +** pExpr is a comparison operator. Return the type affinity that should +** be applied to both operands prior to doing the comparison. +*/ +static char comparisonAffinity(Expr *pExpr){ + char aff; + assert( pExpr->op==TK_EQ || pExpr->op==TK_IN || pExpr->op==TK_LT || + pExpr->op==TK_GT || pExpr->op==TK_GE || pExpr->op==TK_LE || + pExpr->op==TK_NE ); + assert( pExpr->pLeft ); + aff = sqlite3ExprAffinity(pExpr->pLeft); + if( pExpr->pRight ){ + aff = sqlite3CompareAffinity(pExpr->pRight, aff); + }else if( ExprHasProperty(pExpr, EP_xIsSelect) ){ + aff = sqlite3CompareAffinity(pExpr->x.pSelect->pEList->a[0].pExpr, aff); + }else if( !aff ){ + aff = SQLITE_AFF_NONE; + } + return aff; +} + +/* +** pExpr is a comparison expression, eg. '=', '<', IN(...) etc. +** idx_affinity is the affinity of an indexed column. Return true +** if the index with affinity idx_affinity may be used to implement +** the comparison in pExpr. +*/ +int sqlite3IndexAffinityOk(Expr *pExpr, char idx_affinity){ + char aff = comparisonAffinity(pExpr); + switch( aff ){ + case SQLITE_AFF_NONE: + return 1; + case SQLITE_AFF_TEXT: + return idx_affinity==SQLITE_AFF_TEXT; + default: + return sqlite3IsNumericAffinity(idx_affinity); + } +} + +/* +** 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; + return aff; +} + +/* +** Return a pointer to the collation sequence that should be used by +** a binary comparison operator comparing pLeft and pRight. +** +** If the left hand expression has a collating sequence type, then it is +** used. Otherwise the collation sequence for the right hand expression +** is used, or the default (BINARY) if neither expression has a collating +** type. +** +** Argument pRight (but not pLeft) may be a null pointer. In this case, +** it is not considered. +*/ +CollSeq *sqlite3BinaryCompareCollSeq( + Parse *pParse, + Expr *pLeft, + Expr *pRight +){ + CollSeq *pColl; + assert( pLeft ); + if( pLeft->flags & EP_ExpCollate ){ + assert( pLeft->pColl ); + pColl = pLeft->pColl; + }else if( pRight && pRight->flags & EP_ExpCollate ){ + assert( pRight->pColl ); + pColl = pRight->pColl; + }else{ + pColl = sqlite3ExprCollSeq(pParse, pLeft); + if( !pColl ){ + pColl = sqlite3ExprCollSeq(pParse, pRight); + } + } + return pColl; +} + +/* +** Generate the operands for a comparison operation. Before +** generating the code for each operand, set the EP_AnyAff +** flag on the expression so that it will be able to used a +** cached column value that has previously undergone an +** affinity change. +*/ +static void codeCompareOperands( + Parse *pParse, /* Parsing and code generating context */ + Expr *pLeft, /* The left operand */ + int *pRegLeft, /* Register where left operand is stored */ + int *pFreeLeft, /* Free this register when done */ + Expr *pRight, /* The right operand */ + int *pRegRight, /* Register where right operand is stored */ + int *pFreeRight /* Write temp register for right operand there */ +){ + while( pLeft->op==TK_UPLUS ) pLeft = pLeft->pLeft; + pLeft->flags |= EP_AnyAff; + *pRegLeft = sqlite3ExprCodeTemp(pParse, pLeft, pFreeLeft); + while( pRight->op==TK_UPLUS ) pRight = pRight->pLeft; + pRight->flags |= EP_AnyAff; + *pRegRight = sqlite3ExprCodeTemp(pParse, pRight, pFreeRight); +} + +/* +** Generate code for a comparison operator. +*/ +static int codeCompare( + Parse *pParse, /* The parsing (and code generating) context */ + Expr *pLeft, /* The left operand */ + Expr *pRight, /* The right operand */ + int opcode, /* The comparison opcode */ + int in1, int in2, /* Register holding operands */ + int dest, /* Jump here if true. */ + int jumpIfNull /* If true, jump if either operand is NULL */ +){ + int p5; + int addr; + CollSeq *p4; + + 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); + if( (p5 & SQLITE_AFF_MASK)!=SQLITE_AFF_NONE ){ + sqlite3ExprCacheAffinityChange(pParse, in1, 1); + sqlite3ExprCacheAffinityChange(pParse, in2, 1); + } + return addr; +} + +#if SQLITE_MAX_EXPR_DEPTH>0 +/* +** Check that argument nHeight is less than or equal to the maximum +** expression depth allowed. If it is not, leave an error message in +** pParse. +*/ +int sqlite3ExprCheckHeight(Parse *pParse, int nHeight){ + int rc = SQLITE_OK; + int mxHeight = pParse->db->aLimit[SQLITE_LIMIT_EXPR_DEPTH]; + if( nHeight>mxHeight ){ + sqlite3ErrorMsg(pParse, + "Expression tree is too large (maximum depth %d)", mxHeight + ); + rc = SQLITE_ERROR; + } + return rc; +} + +/* The following three functions, heightOfExpr(), heightOfExprList() +** and heightOfSelect(), are used to determine the maximum height +** of any expression tree referenced by the structure passed as the +** first argument. +** +** If this maximum height is greater than the current value pointed +** to by pnHeight, the second parameter, then set *pnHeight to that +** value. +*/ +static void heightOfExpr(Expr *p, int *pnHeight){ + if( p ){ + if( p->nHeight>*pnHeight ){ + *pnHeight = p->nHeight; + } + } +} +static void heightOfExprList(ExprList *p, int *pnHeight){ + if( p ){ + int i; + for(i=0; inExpr; i++){ + heightOfExpr(p->a[i].pExpr, pnHeight); + } + } +} +static void heightOfSelect(Select *p, int *pnHeight){ + if( p ){ + heightOfExpr(p->pWhere, pnHeight); + heightOfExpr(p->pHaving, pnHeight); + heightOfExpr(p->pLimit, pnHeight); + heightOfExpr(p->pOffset, pnHeight); + heightOfExprList(p->pEList, pnHeight); + heightOfExprList(p->pGroupBy, pnHeight); + heightOfExprList(p->pOrderBy, pnHeight); + heightOfSelect(p->pPrior, pnHeight); + } +} + +/* +** Set the Expr.nHeight variable in the structure passed as an +** argument. An expression with no children, Expr.pList or +** Expr.pSelect member has a height of 1. Any other expression +** has a height equal to the maximum height of any other +** referenced Expr plus one. +*/ +static void exprSetHeight(Expr *p){ + int nHeight = 0; + heightOfExpr(p->pLeft, &nHeight); + heightOfExpr(p->pRight, &nHeight); + if( ExprHasProperty(p, EP_xIsSelect) ){ + heightOfSelect(p->x.pSelect, &nHeight); + }else{ + heightOfExprList(p->x.pList, &nHeight); + } + p->nHeight = nHeight + 1; +} + +/* +** Set the Expr.nHeight variable using the exprSetHeight() function. If +** the height is greater than the maximum allowed expression depth, +** leave an error in pParse. +*/ +void sqlite3ExprSetHeight(Parse *pParse, Expr *p){ + exprSetHeight(p); + sqlite3ExprCheckHeight(pParse, p->nHeight); +} + +/* +** Return the maximum height of any expression tree referenced +** by the select statement passed as an argument. +*/ +int sqlite3SelectExprHeight(Select *p){ + int nHeight = 0; + heightOfSelect(p, &nHeight); + return nHeight; +} +#else + #define exprSetHeight(y) +#endif /* SQLITE_MAX_EXPR_DEPTH>0 */ + +/* +** Construct a new expression node and return a pointer to it. Memory +** for this node is obtained from sqlite3_malloc(). The calling function +** is responsible for making sure the node eventually gets freed. +*/ +Expr *sqlite3Expr( + sqlite3 *db, /* Handle for sqlite3DbMallocZero() (may be null) */ + int op, /* Expression opcode */ + Expr *pLeft, /* Left operand */ + Expr *pRight, /* Right operand */ + const Token *pToken /* Argument token */ +){ + Expr *pNew; + pNew = sqlite3DbMallocZero(db, sizeof(Expr)); + if( pNew==0 ){ + /* When malloc fails, delete pLeft and pRight. Expressions passed to + ** this function must always be allocated with sqlite3Expr() for this + ** reason. + */ + sqlite3ExprDelete(db, pLeft); + sqlite3ExprDelete(db, pRight); + return 0; + } + pNew->op = (u8)op; + pNew->pLeft = pLeft; + pNew->pRight = pRight; + pNew->iAgg = -1; + pNew->span.z = (u8*)""; + if( pToken ){ + int c; + assert( pToken->dyn==0 ); + pNew->span = *pToken; + if( pToken->n>=2 + && ((c = pToken->z[0])=='\'' || c=='"' || c=='[' || c=='`') ){ + sqlite3TokenCopy(db, &pNew->token, pToken); + if( pNew->token.z ){ + pNew->token.n = sqlite3Dequote((char*)pNew->token.z); + assert( pNew->token.n==sqlite3Strlen30((char*)pNew->token.z) ); + } + if( c=='"' ) pNew->flags |= EP_DblQuoted; + }else{ + pNew->token = *pToken; + } + pNew->token.quoted = 0; + }else if( pLeft ){ + if( pRight ){ + if( pRight->span.dyn==0 && pLeft->span.dyn==0 ){ + sqlite3ExprSpan(pNew, &pLeft->span, &pRight->span); + } + if( pRight->flags & EP_ExpCollate ){ + pNew->flags |= EP_ExpCollate; + pNew->pColl = pRight->pColl; + } + } + if( pLeft->flags & EP_ExpCollate ){ + pNew->flags |= EP_ExpCollate; + pNew->pColl = pLeft->pColl; + } + } + + exprSetHeight(pNew); + return pNew; +} + +/* +** Works like sqlite3Expr() except that it takes an extra Parse* +** argument and notifies the associated connection object if malloc fails. +*/ +Expr *sqlite3PExpr( + Parse *pParse, /* Parsing context */ + int op, /* Expression opcode */ + Expr *pLeft, /* Left operand */ + Expr *pRight, /* Right operand */ + const Token *pToken /* Argument token */ +){ + Expr *p = sqlite3Expr(pParse->db, op, pLeft, pRight, pToken); + if( p ){ + sqlite3ExprCheckHeight(pParse, p->nHeight); + } + return p; +} + +/* +** When doing a nested parse, you can include terms in an expression +** that look like this: #1 #2 ... These terms refer to registers +** in the virtual machine. #N is the N-th register. +** +** This routine is called by the parser to deal with on of those terms. +** It immediately generates code to store the value in a memory location. +** The returns an expression that will code to extract the value from +** that memory location as needed. +*/ +Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){ + Vdbe *v = pParse->pVdbe; + Expr *p; + if( pParse->nested==0 ){ + sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", pToken); + return sqlite3PExpr(pParse, TK_NULL, 0, 0, 0); + } + if( v==0 ) return 0; + p = sqlite3PExpr(pParse, TK_REGISTER, 0, 0, pToken); + if( p==0 ){ + return 0; /* Malloc failed */ + } + p->iTable = atoi((char*)&pToken->z[1]); + return p; +} + +/* +** Join two expressions using an AND operator. If either expression is +** NULL, then just return the other expression. +*/ +Expr *sqlite3ExprAnd(sqlite3 *db, Expr *pLeft, Expr *pRight){ + if( pLeft==0 ){ + return pRight; + }else if( pRight==0 ){ + return pLeft; + }else{ + return sqlite3Expr(db, TK_AND, pLeft, pRight, 0); + } +} + +/* +** Set the Expr.span field of the given expression to span all +** text between the two given tokens. Both tokens must be pointing +** at the same string. +*/ +void sqlite3ExprSpan(Expr *pExpr, Token *pLeft, Token *pRight){ + assert( pRight!=0 ); + assert( pLeft!=0 ); + if( pExpr ){ + pExpr->span.z = pLeft->z; + /* The following assert() may fail when this is called + ** via sqlite3PExpr()/sqlite3Expr() from addWhereTerm(). */ + /* assert(pRight->z >= pLeft->z); */ + pExpr->span.n = pRight->n + (unsigned)(pRight->z - pLeft->z); + } +} + +/* +** Construct a new expression node for a function with multiple +** arguments. +*/ +Expr *sqlite3ExprFunction(Parse *pParse, ExprList *pList, Token *pToken){ + Expr *pNew; + sqlite3 *db = pParse->db; + assert( pToken ); + pNew = sqlite3DbMallocZero(db, sizeof(Expr) ); + if( pNew==0 ){ + sqlite3ExprListDelete(db, pList); /* Avoid memory leak when malloc fails */ + return 0; + } + pNew->op = TK_FUNCTION; + pNew->x.pList = pList; + assert( !ExprHasProperty(pNew, EP_xIsSelect) ); + assert( pToken->dyn==0 ); + pNew->span = *pToken; + sqlite3TokenCopy(db, &pNew->token, pToken); + sqlite3ExprSetHeight(pParse, pNew); + return pNew; +} + +/* +** Assign a variable number to an expression that encodes a wildcard +** in the original SQL statement. +** +** Wildcards consisting of a single "?" are assigned the next sequential +** variable number. +** +** Wildcards of the form "?nnn" are assigned the number "nnn". We make +** sure "nnn" is not too be to avoid a denial of service attack when +** the SQL statement comes from an external source. +** +** Wildcards of the form ":aaa" or "$aaa" are assigned the same number +** as the previous instance of the same wildcard. Or if this is the first +** instance of the wildcard, the next sequenial variable number is +** assigned. +*/ +void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ + Token *pToken; + sqlite3 *db = pParse->db; + + if( pExpr==0 ) return; + pToken = &pExpr->token; + assert( pToken->n>=1 ); + assert( pToken->z!=0 ); + assert( pToken->z[0]!=0 ); + if( pToken->n==1 ){ + /* Wildcard of the form "?". Assign the next variable number */ + pExpr->iTable = ++pParse->nVar; + }else if( pToken->z[0]=='?' ){ + /* Wildcard of the form "?nnn". Convert "nnn" to an integer and + ** use it as the variable number */ + int i; + pExpr->iTable = i = atoi((char*)&pToken->z[1]); + testcase( i==0 ); + testcase( i==1 ); + testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]-1 ); + testcase( i==db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ); + if( i<1 || i>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ + sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d", + db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER]); + } + if( i>pParse->nVar ){ + pParse->nVar = i; + } + }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; + n = pToken->n; + for(i=0; inVarExpr; i++){ + Expr *pE; + if( (pE = pParse->apVarExpr[i])!=0 + && pE->token.n==n + && memcmp(pE->token.z, pToken->z, n)==0 ){ + pExpr->iTable = pE->iTable; + break; + } + } + if( i>=pParse->nVarExpr ){ + pExpr->iTable = ++pParse->nVar; + if( pParse->nVarExpr>=pParse->nVarExprAlloc-1 ){ + pParse->nVarExprAlloc += pParse->nVarExprAlloc + 10; + pParse->apVarExpr = + sqlite3DbReallocOrFree( + db, + pParse->apVarExpr, + pParse->nVarExprAlloc*sizeof(pParse->apVarExpr[0]) + ); + } + if( !db->mallocFailed ){ + assert( pParse->apVarExpr!=0 ); + pParse->apVarExpr[pParse->nVarExpr++] = pExpr; + } + } + } + if( !pParse->nErr && pParse->nVar>db->aLimit[SQLITE_LIMIT_VARIABLE_NUMBER] ){ + sqlite3ErrorMsg(pParse, "too many SQL variables"); + } +} + +/* +** Clear an expression structure without deleting the structure itself. +** Substructure is deleted. +*/ +void sqlite3ExprClear(sqlite3 *db, Expr *p){ + if( p->token.dyn ) sqlite3DbFree(db, (char*)p->token.z); + if( !ExprHasAnyProperty(p, EP_TokenOnly|EP_SpanToken) ){ + if( p->span.dyn ) sqlite3DbFree(db, (char*)p->span.z); + if( ExprHasProperty(p, EP_Reduced) ){ + /* Subtrees are part of the same memory allocation when EP_Reduced set */ + if( p->pLeft ) sqlite3ExprClear(db, p->pLeft); + if( p->pRight ) sqlite3ExprClear(db, p->pRight); + }else{ + /* Subtrees are separate allocations when EP_Reduced is clear */ + sqlite3ExprDelete(db, p->pLeft); + sqlite3ExprDelete(db, p->pRight); + } + /* x.pSelect and x.pList are always separately allocated */ + if( ExprHasProperty(p, EP_xIsSelect) ){ + sqlite3SelectDelete(db, p->x.pSelect); + }else{ + sqlite3ExprListDelete(db, p->x.pList); + } + } +} + +/* +** Recursively delete an expression tree. +*/ +void sqlite3ExprDelete(sqlite3 *db, Expr *p){ + if( p==0 ) return; + sqlite3ExprClear(db, p); + sqlite3DbFree(db, p); +} + +/* +** Return the number of bytes allocated for the expression structure +** passed as the first argument. This is always one of EXPR_FULLSIZE, +** EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. +*/ +static int exprStructSize(Expr *p){ + if( ExprHasProperty(p, EP_TokenOnly) ) return EXPR_TOKENONLYSIZE; + if( ExprHasProperty(p, EP_SpanToken) ) return EXPR_SPANTOKENSIZE; + if( ExprHasProperty(p, EP_Reduced) ) return EXPR_REDUCEDSIZE; + return EXPR_FULLSIZE; +} + +/* +** sqlite3ExprDup() has been called to create a copy of expression p with +** the EXPRDUP_XXX flags passed as the second argument. This function +** returns the space required for the copy of the Expr structure only. +** This is always one of EXPR_FULLSIZE, EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE. +*/ +static int dupedExprStructSize(Expr *p, int flags){ + int nSize; + if( 0==(flags&EXPRDUP_REDUCE) ){ + nSize = EXPR_FULLSIZE; + }else if( p->pLeft || p->pRight || p->pColl || p->x.pList ){ + nSize = EXPR_REDUCEDSIZE; + }else if( flags&EXPRDUP_SPAN ){ + nSize = EXPR_SPANTOKENSIZE; + }else{ + nSize = EXPR_TOKENONLYSIZE; + } + return nSize; +} + +/* +** sqlite3ExprDup() has been called to create a copy of expression p with +** the EXPRDUP_XXX passed as the second argument. This function returns +** the space in bytes required to store the copy of the Expr structure +** and the copies of the Expr.token.z and Expr.span.z (if applicable) +** string buffers. +*/ +static int dupedExprNodeSize(Expr *p, int flags){ + int nByte = dupedExprStructSize(p, flags) + (p->token.z ? p->token.n + 1 : 0); + if( (flags&EXPRDUP_SPAN)!=0 + && (p->token.z!=p->span.z || p->token.n!=p->span.n) + ){ + nByte += p->span.n; + } + return ROUND8(nByte); +} + +/* +** Return the number of bytes required to create a duplicate of the +** expression passed as the first argument. The second argument is a +** mask containing EXPRDUP_XXX flags. +** +** The value returned includes space to create a copy of the Expr struct +** itself and the buffer referred to by Expr.token, if any. If the +** EXPRDUP_SPAN flag is set, then space to create a copy of the buffer +** refered to by Expr.span is also included. +** +** If the EXPRDUP_REDUCE flag is set, then the return value includes +** space to duplicate all Expr nodes in the tree formed by Expr.pLeft +** and Expr.pRight variables (but not for any structures pointed to or +** descended from the Expr.x.pList or Expr.x.pSelect variables). +*/ +static int dupedExprSize(Expr *p, int flags){ + int nByte = 0; + if( p ){ + nByte = dupedExprNodeSize(p, flags); + if( flags&EXPRDUP_REDUCE ){ + int f = flags&(~EXPRDUP_SPAN); + nByte += dupedExprSize(p->pLeft, f) + dupedExprSize(p->pRight, f); + } + } + return nByte; +} + +/* +** This function is similar to sqlite3ExprDup(), except that if pzBuffer +** is not NULL then *pzBuffer is assumed to point to a buffer large enough +** to store the copy of expression p, the copies of p->token and p->span +** (if applicable), and the copies of the p->pLeft and p->pRight expressions, +** if any. Before returning, *pzBuffer is set to the first byte passed the +** portion of the buffer copied into by this function. +*/ +static Expr *exprDup(sqlite3 *db, Expr *p, int flags, u8 **pzBuffer){ + Expr *pNew = 0; /* Value to return */ + if( p ){ + const int isRequireSpan = (flags&EXPRDUP_SPAN); + const int isReduced = (flags&EXPRDUP_REDUCE); + u8 *zAlloc; + + assert( pzBuffer==0 || isReduced ); + + /* Figure out where to write the new Expr structure. */ + if( pzBuffer ){ + zAlloc = *pzBuffer; + }else{ + zAlloc = sqlite3DbMallocRaw(db, dupedExprSize(p, flags)); + } + pNew = (Expr *)zAlloc; + + if( pNew ){ + /* Set nNewSize to the size allocated for the structure pointed to + ** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or + ** EXPR_TOKENONLYSIZE. nToken is set to the number of bytes consumed + ** by the copy of the p->token.z string (if any). + */ + const int nNewSize = dupedExprStructSize(p, flags); + const int nToken = (p->token.z ? p->token.n + 1 : 0); + if( isReduced ){ + assert( ExprHasProperty(p, EP_Reduced)==0 ); + memcpy(zAlloc, p, nNewSize); + }else{ + int nSize = exprStructSize(p); + memcpy(zAlloc, p, nSize); + memset(&zAlloc[nSize], 0, EXPR_FULLSIZE-nSize); + } + + /* Set the EP_Reduced and EP_TokenOnly flags appropriately. */ + pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_SpanToken); + switch( nNewSize ){ + case EXPR_REDUCEDSIZE: pNew->flags |= EP_Reduced; break; + case EXPR_TOKENONLYSIZE: pNew->flags |= EP_TokenOnly; break; + case EXPR_SPANTOKENSIZE: pNew->flags |= EP_SpanToken; break; + } + + /* Copy the p->token string, if any. */ + if( nToken ){ + unsigned char *zToken = &zAlloc[nNewSize]; + memcpy(zToken, p->token.z, nToken-1); + zToken[nToken-1] = '\0'; + pNew->token.dyn = 0; + pNew->token.z = zToken; + } + + if( 0==((p->flags|pNew->flags) & EP_TokenOnly) ){ + /* Fill in the pNew->span token, if required. */ + if( isRequireSpan ){ + if( p->token.z!=p->span.z || p->token.n!=p->span.n ){ + pNew->span.z = &zAlloc[nNewSize+nToken]; + memcpy((char *)pNew->span.z, p->span.z, p->span.n); + pNew->span.dyn = 0; + }else{ + pNew->span.z = pNew->token.z; + pNew->span.n = pNew->token.n; + } + }else{ + pNew->span.z = 0; + pNew->span.n = 0; + } + } + + if( 0==((p->flags|pNew->flags) & (EP_TokenOnly|EP_SpanToken)) ){ + /* Fill in the pNew->x.pSelect or pNew->x.pList member. */ + if( ExprHasProperty(p, EP_xIsSelect) ){ + pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, isReduced); + }else{ + pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, isReduced); + } + } + + /* Fill in pNew->pLeft and pNew->pRight. */ + if( ExprHasAnyProperty(pNew, EP_Reduced|EP_TokenOnly|EP_SpanToken) ){ + zAlloc += dupedExprNodeSize(p, flags); + if( ExprHasProperty(pNew, EP_Reduced) ){ + pNew->pLeft = exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc); + pNew->pRight = exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc); + } + if( pzBuffer ){ + *pzBuffer = zAlloc; + } + }else if( !ExprHasAnyProperty(p, EP_TokenOnly|EP_SpanToken) ){ + pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0); + pNew->pRight = sqlite3ExprDup(db, p->pRight, 0); + } + } + } + return pNew; +} + +/* +** The following group of routines make deep copies of expressions, +** expression lists, ID lists, and select statements. The copies can +** be deleted (by being passed to their respective ...Delete() routines) +** without effecting the originals. +** +** The expression list, ID, and source lists return by sqlite3ExprListDup(), +** sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded +** by subsequent calls to sqlite*ListAppend() routines. +** +** Any tables that the SrcList might point to are not duplicated. +** +** The flags parameter contains a combination of the EXPRDUP_XXX flags. If +** the EXPRDUP_SPAN flag is set in the argument parameter, then the +** Expr.span field of the input expression is copied. If EXPRDUP_SPAN is +** clear, then the Expr.span field of the returned expression structure +** is zeroed. +** +** If the EXPRDUP_REDUCE flag is set, then the structure returned is a +** truncated version of the usual Expr structure that will be stored as +** part of the in-memory representation of the database schema. +*/ +Expr *sqlite3ExprDup(sqlite3 *db, Expr *p, int flags){ + return exprDup(db, p, flags, 0); +} +void sqlite3TokenCopy(sqlite3 *db, Token *pTo, const Token *pFrom){ + if( pTo->dyn ) sqlite3DbFree(db, (char*)pTo->z); + if( pFrom->z ){ + pTo->n = pFrom->n; + pTo->z = (u8*)sqlite3DbStrNDup(db, (char*)pFrom->z, pFrom->n); + pTo->dyn = 1; + }else{ + pTo->z = 0; + } +} +ExprList *sqlite3ExprListDup(sqlite3 *db, ExprList *p, int flags){ + ExprList *pNew; + struct ExprList_item *pItem, *pOldItem; + int i; + if( p==0 ) return 0; + pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); + if( pNew==0 ) return 0; + pNew->iECursor = 0; + pNew->nExpr = pNew->nAlloc = p->nExpr; + pNew->a = pItem = sqlite3DbMallocRaw(db, p->nExpr*sizeof(p->a[0]) ); + if( pItem==0 ){ + sqlite3DbFree(db, pNew); + return 0; + } + pOldItem = p->a; + for(i=0; inExpr; i++, pItem++, pOldItem++){ + Expr *pNewExpr; + Expr *pOldExpr = pOldItem->pExpr; + pItem->pExpr = pNewExpr = sqlite3ExprDup(db, pOldExpr, flags); + pItem->zName = sqlite3DbStrDup(db, pOldItem->zName); + pItem->sortOrder = pOldItem->sortOrder; + pItem->done = 0; + pItem->iCol = pOldItem->iCol; + pItem->iAlias = pOldItem->iAlias; + } + return pNew; +} + +/* +** If cursors, triggers, views and subqueries are all omitted from +** the build, then none of the following routines, except for +** sqlite3SelectDup(), can be called. sqlite3SelectDup() is sometimes +** called with a NULL argument. +*/ +#if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_TRIGGER) \ + || !defined(SQLITE_OMIT_SUBQUERY) +SrcList *sqlite3SrcListDup(sqlite3 *db, SrcList *p, int flags){ + SrcList *pNew; + int i; + int nByte; + if( p==0 ) return 0; + nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); + pNew = sqlite3DbMallocRaw(db, nByte ); + if( pNew==0 ) return 0; + pNew->nSrc = pNew->nAlloc = p->nSrc; + for(i=0; inSrc; i++){ + struct SrcList_item *pNewItem = &pNew->a[i]; + struct SrcList_item *pOldItem = &p->a[i]; + Table *pTab; + pNewItem->zDatabase = sqlite3DbStrDup(db, pOldItem->zDatabase); + pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); + pNewItem->zAlias = sqlite3DbStrDup(db, pOldItem->zAlias); + pNewItem->jointype = pOldItem->jointype; + pNewItem->iCursor = pOldItem->iCursor; + pNewItem->isPopulated = pOldItem->isPopulated; + pNewItem->zIndex = sqlite3DbStrDup(db, pOldItem->zIndex); + pNewItem->notIndexed = pOldItem->notIndexed; + pNewItem->pIndex = pOldItem->pIndex; + pTab = pNewItem->pTab = pOldItem->pTab; + if( pTab ){ + pTab->nRef++; + } + pNewItem->pSelect = sqlite3SelectDup(db, pOldItem->pSelect, flags); + pNewItem->pOn = sqlite3ExprDup(db, pOldItem->pOn, flags); + pNewItem->pUsing = sqlite3IdListDup(db, pOldItem->pUsing); + pNewItem->colUsed = pOldItem->colUsed; + } + return pNew; +} +IdList *sqlite3IdListDup(sqlite3 *db, IdList *p){ + IdList *pNew; + int i; + if( p==0 ) return 0; + pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) ); + if( pNew==0 ) return 0; + pNew->nId = pNew->nAlloc = p->nId; + pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) ); + if( pNew->a==0 ){ + sqlite3DbFree(db, pNew); + return 0; + } + for(i=0; inId; i++){ + struct IdList_item *pNewItem = &pNew->a[i]; + struct IdList_item *pOldItem = &p->a[i]; + pNewItem->zName = sqlite3DbStrDup(db, pOldItem->zName); + pNewItem->idx = pOldItem->idx; + } + return pNew; +} +Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){ + Select *pNew; + if( p==0 ) return 0; + pNew = sqlite3DbMallocRaw(db, sizeof(*p) ); + if( pNew==0 ) return 0; + /* Always make a copy of the span for top-level expressions in the + ** expression list. The logic in SELECT processing that determines + ** the names of columns in the result set needs this information */ + pNew->pEList = sqlite3ExprListDup(db, p->pEList, flags|EXPRDUP_SPAN); + pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags); + pNew->pWhere = sqlite3ExprDup(db, p->pWhere, flags); + pNew->pGroupBy = sqlite3ExprListDup(db, p->pGroupBy, flags); + pNew->pHaving = sqlite3ExprDup(db, p->pHaving, flags); + pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, flags); + pNew->op = p->op; + pNew->pPrior = sqlite3SelectDup(db, p->pPrior, flags); + pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags); + pNew->pOffset = sqlite3ExprDup(db, p->pOffset, flags); + pNew->iLimit = 0; + pNew->iOffset = 0; + pNew->selFlags = p->selFlags & ~SF_UsesEphemeral; + pNew->pRightmost = 0; + pNew->addrOpenEphm[0] = -1; + pNew->addrOpenEphm[1] = -1; + pNew->addrOpenEphm[2] = -1; + return pNew; +} +#else +Select *sqlite3SelectDup(sqlite3 *db, Select *p, int flags){ + assert( p==0 ); + return 0; +} +#endif + + +/* +** Add a new element to the end of an expression list. If pList is +** initially NULL, then create a new expression list. +*/ +ExprList *sqlite3ExprListAppend( + Parse *pParse, /* Parsing context */ + ExprList *pList, /* List to which to append. Might be NULL */ + Expr *pExpr, /* Expression to be appended */ + Token *pName /* AS keyword for the expression */ +){ + sqlite3 *db = pParse->db; + if( pList==0 ){ + pList = sqlite3DbMallocZero(db, sizeof(ExprList) ); + if( pList==0 ){ + goto no_mem; + } + assert( pList->nAlloc==0 ); + } + if( pList->nAlloc<=pList->nExpr ){ + struct ExprList_item *a; + int n = pList->nAlloc*2 + 4; + 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]); + } + assert( pList->a!=0 ); + if( pExpr || pName ){ + struct ExprList_item *pItem = &pList->a[pList->nExpr++]; + memset(pItem, 0, sizeof(*pItem)); + pItem->zName = sqlite3NameFromToken(db, pName); + pItem->pExpr = pExpr; + pItem->iAlias = 0; + } + return pList; + +no_mem: + /* Avoid leaking memory if malloc has failed. */ + sqlite3ExprDelete(db, pExpr); + sqlite3ExprListDelete(db, pList); + return 0; +} + +/* +** If the expression list pEList contains more than iLimit elements, +** leave an error message in pParse. +*/ +void sqlite3ExprListCheckLength( + Parse *pParse, + ExprList *pEList, + const char *zObject +){ + int mx = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; + testcase( pEList && pEList->nExpr==mx ); + testcase( pEList && pEList->nExpr==mx+1 ); + if( pEList && pEList->nExpr>mx ){ + sqlite3ErrorMsg(pParse, "too many columns in %s", zObject); + } +} + +/* +** Delete an entire expression list. +*/ +void sqlite3ExprListDelete(sqlite3 *db, ExprList *pList){ + int i; + struct ExprList_item *pItem; + if( pList==0 ) return; + assert( pList->a!=0 || (pList->nExpr==0 && pList->nAlloc==0) ); + assert( pList->nExpr<=pList->nAlloc ); + for(pItem=pList->a, i=0; inExpr; i++, pItem++){ + sqlite3ExprDelete(db, pItem->pExpr); + sqlite3DbFree(db, pItem->zName); + } + sqlite3DbFree(db, pList->a); + sqlite3DbFree(db, pList); +} + +/* +** These routines are Walker callbacks. Walker.u.pi is a pointer +** to an integer. These routines are checking an expression to see +** if it is a constant. Set *Walker.u.pi to 0 if the expression is +** not constant. +** +** These callback routines are used to implement the following: +** +** sqlite3ExprIsConstant() +** sqlite3ExprIsConstantNotJoin() +** sqlite3ExprIsConstantOrFunction() +** +*/ +static int exprNodeIsConstant(Walker *pWalker, Expr *pExpr){ + + /* If pWalker->u.i is 3 then any term of the expression that comes from + ** the ON or USING clauses of a join disqualifies the expression + ** from being considered constant. */ + if( pWalker->u.i==3 && ExprHasAnyProperty(pExpr, EP_FromJoin) ){ + pWalker->u.i = 0; + return WRC_Abort; + } + + switch( pExpr->op ){ + /* Consider functions to be constant if all their arguments are constant + ** and pWalker->u.i==2 */ + case TK_FUNCTION: + if( pWalker->u.i==2 ) return 0; + /* Fall through */ + case TK_ID: + case TK_COLUMN: + case TK_AGG_FUNCTION: + case TK_AGG_COLUMN: +#ifndef SQLITE_OMIT_SUBQUERY + case TK_SELECT: + case TK_EXISTS: + 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_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); + pWalker->u.i = 0; + return WRC_Abort; +} +static int exprIsConst(Expr *p, int initFlag){ + Walker w; + w.u.i = initFlag; + w.xExprCallback = exprNodeIsConstant; + w.xSelectCallback = selectNodeIsConstant; + sqlite3WalkExpr(&w, p); + return w.u.i; +} + +/* +** Walk an expression tree. Return 1 if the expression is constant +** and 0 if it involves variables or function calls. +** +** For the purposes of this function, a double-quoted string (ex: "abc") +** is considered a variable but a single-quoted string (ex: 'abc') is +** a constant. +*/ +int sqlite3ExprIsConstant(Expr *p){ + return exprIsConst(p, 1); +} + +/* +** Walk an expression tree. Return 1 if the expression is constant +** that does no originate from the ON or USING clauses of a join. +** Return 0 if it involves variables or function calls or terms from +** an ON or USING clause. +*/ +int sqlite3ExprIsConstantNotJoin(Expr *p){ + return exprIsConst(p, 3); +} + +/* +** Walk an expression tree. Return 1 if the expression is constant +** or a function call with constant arguments. Return and 0 if there +** are any variables. +** +** For the purposes of this function, a double-quoted string (ex: "abc") +** is considered a variable but a single-quoted string (ex: 'abc') is +** a constant. +*/ +int sqlite3ExprIsConstantOrFunction(Expr *p){ + return exprIsConst(p, 2); +} + +/* +** If the expression p codes a constant integer that is small enough +** to fit in a 32-bit integer, return 1 and put the value of the integer +** in *pValue. If the expression is not an integer or if it is too big +** to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged. +*/ +int sqlite3ExprIsInteger(Expr *p, int *pValue){ + int rc = 0; + if( p->flags & EP_IntValue ){ + *pValue = p->iTable; + return 1; + } + switch( p->op ){ + case TK_INTEGER: { + rc = sqlite3GetInt32((char*)p->token.z, pValue); + break; + } + case TK_UPLUS: { + rc = sqlite3ExprIsInteger(p->pLeft, pValue); + break; + } + case TK_UMINUS: { + int v; + if( sqlite3ExprIsInteger(p->pLeft, &v) ){ + *pValue = -v; + rc = 1; + } + break; + } + default: break; + } + if( rc ){ + p->op = TK_INTEGER; + p->flags |= EP_IntValue; + p->iTable = *pValue; + } + return rc; +} + +/* +** Return TRUE if the given string is a row-id column name. +*/ +int sqlite3IsRowid(const char *z){ + if( sqlite3StrICmp(z, "_ROWID_")==0 ) return 1; + if( sqlite3StrICmp(z, "ROWID")==0 ) return 1; + if( sqlite3StrICmp(z, "OID")==0 ) return 1; + return 0; +} + +/* +** Return true if the IN operator optimization is enabled and +** the SELECT statement p exists and is of the +** simple form: +** +** SELECT FROM +** +** If this is the case, it may be possible to use an existing table +** or index instead of generating an epheremal table. +*/ +#ifndef SQLITE_OMIT_SUBQUERY +static int isCandidateForInOpt(Select *p){ + SrcList *pSrc; + ExprList *pEList; + Table *pTab; + 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 */ + } + 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->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 */ + pEList = p->pEList; + if( pEList->nExpr!=1 ) return 0; /* One column in the result set */ + if( pEList->a[0].pExpr->op!=TK_COLUMN ) return 0; /* Result is a column */ + return 1; +} +#endif /* SQLITE_OMIT_SUBQUERY */ + +/* +** This function is used by the implementation of the IN (...) operator. +** It's job is to find or create a b-tree structure that may be used +** either to test for membership of the (...) set or to iterate through +** its members, skipping duplicates. +** +** The cursor opened on the structure (database table, database index +** or ephermal table) is stored in pX->iTable before this function returns. +** The returned value indicates the structure type, as follows: +** +** IN_INDEX_ROWID - The cursor was opened on a database table. +** IN_INDEX_INDEX - The cursor was opened on a database index. +** IN_INDEX_EPH - The cursor was opened on a specially created and +** populated epheremal table. +** +** An existing structure may only be used if the SELECT is of the simple +** form: +** +** SELECT FROM
+** +** If prNotFound parameter is 0, then the structure will be used to iterate +** through the set members, skipping any duplicates. In this case an +** epheremal table must be used unless the selected is guaranteed +** to be unique - either because it is an INTEGER PRIMARY KEY or it +** is unique by virtue of a constraint or implicit index. +** +** If the prNotFound parameter is not 0, then the structure will be used +** for fast set membership tests. In this case an epheremal table must +** be used unless is an INTEGER PRIMARY KEY or an index can +** be found with as its left-most column. +** +** When the structure is being used for set membership tests, the user +** needs to know whether or not the structure contains an SQL NULL +** value in order to correctly evaluate expressions like "X IN (Y, Z)". +** If there is a chance that the structure may contain a NULL value at +** runtime, then a register is allocated and the register number written +** to *prNotFound. If there is no chance that the structure contains a +** NULL value, then *prNotFound is left unchanged. +** +** If a register is allocated and its location stored in *prNotFound, then +** its initial value is NULL. If the structure does not remain constant +** for the duration of the query (i.e. the set is a correlated sub-select), +** the value of the allocated register is reset to NULL each time the +** structure is repopulated. This allows the caller to use vdbe code +** equivalent to the following: +** +** if( register==NULL ){ +** has_null = +** register = 1 +** } +** +** in order to avoid running the +** test more often than is necessary. +*/ +#ifndef SQLITE_OMIT_SUBQUERY +int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){ + Select *p; + int eType = 0; + int iTab = pParse->nTab++; + int mustBeUnique = !prNotFound; + + /* The follwing if(...) expression is true if the SELECT is of the + ** simple form: + ** + ** SELECT FROM
+ ** + ** If this is the case, it may be possible to use an existing table + ** or index instead of generating an epheremal table. + */ + p = (ExprHasProperty(pX, EP_xIsSelect) ? pX->x.pSelect : 0); + if( isCandidateForInOpt(p) ){ + sqlite3 *db = pParse->db; /* Database connection */ + Expr *pExpr = p->pEList->a[0].pExpr; /* Expression */ + int iCol = pExpr->iColumn; /* Index of column */ + Vdbe *v = sqlite3GetVdbe(pParse); /* Virtual machine being coded */ + Table *pTab = p->pSrc->a[0].pTab; /* Table
. */ + int iDb; /* Database idx for pTab */ + + /* Code an OP_VerifyCookie and OP_TableLock for
. */ + iDb = sqlite3SchemaToIndex(db, pTab->pSchema); + sqlite3CodeVerifySchema(pParse, iDb); + sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); + + /* This function is only called from two places. In both cases the vdbe + ** has already been allocated. So assume sqlite3GetVdbe() is always + ** successful here. + */ + assert(v); + if( iCol<0 ){ + int iMem = ++pParse->nMem; + int iAddr; + sqlite3VdbeUsesBtree(v, iDb); + + iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem); + sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem); + + sqlite3OpenTable(pParse, iTab, iDb, pTab, OP_OpenRead); + eType = IN_INDEX_ROWID; + + sqlite3VdbeJumpHere(v, iAddr); + }else{ + Index *pIdx; /* Iterator variable */ + + /* The collation sequence used by the comparison. If an index is to + ** be used in place of a temp-table, it must be ordered according + ** to this collation sequence. */ + CollSeq *pReq = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pExpr); + + /* Check that the affinity that will be used to perform the + ** comparison is the same as the affinity of the column. If + ** it is not, it is not possible to use any index. + */ + char aff = comparisonAffinity(pX); + int affinity_ok = (pTab->aCol[iCol].affinity==aff||aff==SQLITE_AFF_NONE); + + for(pIdx=pTab->pIndex; pIdx && eType==0 && affinity_ok; pIdx=pIdx->pNext){ + if( (pIdx->aiColumn[0]==iCol) + && (pReq==sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], -1, 0)) + && (!mustBeUnique || (pIdx->nColumn==1 && pIdx->onError!=OE_None)) + ){ + int iMem = ++pParse->nMem; + int iAddr; + char *pKey; + + pKey = (char *)sqlite3IndexKeyinfo(pParse, pIdx); + iDb = sqlite3SchemaToIndex(db, pIdx->pSchema); + sqlite3VdbeUsesBtree(v, iDb); + + iAddr = sqlite3VdbeAddOp1(v, OP_If, iMem); + sqlite3VdbeAddOp2(v, OP_Integer, 1, iMem); + + sqlite3VdbeAddOp4(v, OP_OpenRead, iTab, pIdx->tnum, iDb, + pKey,P4_KEYINFO_HANDOFF); + VdbeComment((v, "%s", pIdx->zName)); + eType = IN_INDEX_INDEX; + + sqlite3VdbeJumpHere(v, iAddr); + if( prNotFound && !pTab->aCol[iCol].notNull ){ + *prNotFound = ++pParse->nMem; + } + } + } + } + } + + if( eType==0 ){ + int rMayHaveNull = 0; + eType = IN_INDEX_EPH; + if( prNotFound ){ + *prNotFound = rMayHaveNull = ++pParse->nMem; + }else if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){ + eType = IN_INDEX_ROWID; + } + sqlite3CodeSubselect(pParse, pX, rMayHaveNull, eType==IN_INDEX_ROWID); + }else{ + pX->iTable = iTab; + } + return eType; +} +#endif + +/* +** Generate code for scalar subqueries used as an expression +** and IN operators. Examples: +** +** (SELECT a FROM b) -- subquery +** EXISTS (SELECT a FROM b) -- EXISTS subquery +** x IN (4,5,11) -- IN operator with list on right-hand side +** x IN (SELECT a FROM b) -- IN operator with subquery on the right +** +** The pExpr parameter describes the expression that contains the IN +** operator or subquery. +** +** If parameter isRowid is non-zero, then expression pExpr is guaranteed +** to be of the form " IN (?, ?, ?)", where is a reference +** to some integer key column of a table B-Tree. In this case, use an +** intkey B-Tree to store the set of IN(...) values instead of the usual +** (slower) variable length keys B-Tree. +*/ +#ifndef SQLITE_OMIT_SUBQUERY +void sqlite3CodeSubselect( + Parse *pParse, + Expr *pExpr, + int rMayHaveNull, + int isRowid +){ + int testAddr = 0; /* One-time test address */ + Vdbe *v = sqlite3GetVdbe(pParse); + if( v==0 ) return; + sqlite3ExprCachePush(pParse); + + /* This code must be run in its entirety every time it is encountered + ** if any of the following is true: + ** + ** * The right-hand side is a correlated subquery + ** * The right-hand side is an expression list containing variables + ** * We are inside a trigger + ** + ** If all of the above are false, then we can run this code just once + ** save the results, and reuse the same result on subsequent invocations. + */ + if( !ExprHasAnyProperty(pExpr, EP_VarSelect) && !pParse->trigStack ){ + int mem = ++pParse->nMem; + sqlite3VdbeAddOp1(v, OP_If, mem); + testAddr = sqlite3VdbeAddOp2(v, OP_Integer, 1, mem); + assert( testAddr>0 || pParse->db->mallocFailed ); + } + + switch( pExpr->op ){ + case TK_IN: { + char affinity; + KeyInfo keyInfo; + int addr; /* Address of OP_OpenEphemeral instruction */ + Expr *pLeft = pExpr->pLeft; + + if( rMayHaveNull ){ + sqlite3VdbeAddOp2(v, OP_Null, 0, rMayHaveNull); + } + + affinity = sqlite3ExprAffinity(pLeft); + + /* Whether this is an 'x IN(SELECT...)' or an 'x IN()' + ** expression it is handled the same way. A virtual table is + ** filled with single-field index keys representing the results + ** from the SELECT or the . + ** + ** If the 'x' expression is a column value, or the SELECT... + ** statement returns a column value, then the affinity of that + ** column is used to build the index keys. If both 'x' and the + ** SELECT... statement are columns, then numeric affinity is used + ** if either column has NUMERIC or INTEGER affinity. If neither + ** 'x' nor the SELECT... statement are columns, then numeric affinity + ** is used. + */ + pExpr->iTable = pParse->nTab++; + addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, !isRowid); + memset(&keyInfo, 0, sizeof(keyInfo)); + keyInfo.nField = 1; + + if( ExprHasProperty(pExpr, EP_xIsSelect) ){ + /* Case 1: expr IN (SELECT ...) + ** + ** Generate code to write the results of the select into the temporary + ** table allocated and opened above. + */ + SelectDest dest; + ExprList *pEList; + + assert( !isRowid ); + sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable); + dest.affinity = (u8)affinity; + assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); + if( sqlite3Select(pParse, pExpr->x.pSelect, &dest) ){ + return; + } + pEList = pExpr->x.pSelect->pEList; + if( pEList && pEList->nExpr>0 ){ + keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft, + pEList->a[0].pExpr); + } + }else if( pExpr->x.pList ){ + /* Case 2: expr IN (exprlist) + ** + ** For each expression, build an index key from the evaluation and + ** store it in the temporary table. If is a column, then use + ** that columns affinity when building index keys. If is not + ** a column, use numeric affinity. + */ + int i; + ExprList *pList = pExpr->x.pList; + struct ExprList_item *pItem; + int r1, r2, r3; + + if( !affinity ){ + affinity = SQLITE_AFF_NONE; + } + keyInfo.aColl[0] = sqlite3ExprCollSeq(pParse, pExpr->pLeft); + + /* Loop through each expression in . */ + r1 = sqlite3GetTempReg(pParse); + r2 = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Null, 0, r2); + for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){ + Expr *pE2 = pItem->pExpr; + + /* If the expression is not constant then we will need to + ** disable the test that was generated above that makes sure + ** this code only executes once. Because for a non-constant + ** expression we need to rerun this code each time. + */ + if( testAddr && !sqlite3ExprIsConstant(pE2) ){ + sqlite3VdbeChangeToNoop(v, testAddr-1, 2); + testAddr = 0; + } + + /* Evaluate the expression and insert it into the temp table */ + r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); + if( isRowid ){ + sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, sqlite3VdbeCurrentAddr(v)+2); + sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3); + }else{ + sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1); + sqlite3ExprCacheAffinityChange(pParse, r3, 1); + sqlite3VdbeAddOp2(v, OP_IdxInsert, pExpr->iTable, r2); + } + } + sqlite3ReleaseTempReg(pParse, r1); + sqlite3ReleaseTempReg(pParse, r2); + } + if( !isRowid ){ + sqlite3VdbeChangeP4(v, addr, (void *)&keyInfo, P4_KEYINFO); + } + break; + } + + case TK_EXISTS: + case TK_SELECT: { + /* This has to be a scalar SELECT. Generate code to put the + ** value of this select in a memory cell and record the number + ** of the memory cell in iColumn. + */ + static const Token one = { (u8*)"1", 0, 0, 1 }; + Select *pSel; + SelectDest dest; + + assert( ExprHasProperty(pExpr, EP_xIsSelect) ); + pSel = pExpr->x.pSelect; + sqlite3SelectDestInit(&dest, 0, ++pParse->nMem); + if( pExpr->op==TK_SELECT ){ + dest.eDest = SRT_Mem; + sqlite3VdbeAddOp2(v, OP_Null, 0, dest.iParm); + VdbeComment((v, "Init subquery result")); + }else{ + dest.eDest = SRT_Exists; + sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iParm); + VdbeComment((v, "Init EXISTS result")); + } + sqlite3ExprDelete(pParse->db, pSel->pLimit); + pSel->pLimit = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, &one); + if( sqlite3Select(pParse, pSel, &dest) ){ + return; + } + pExpr->iColumn = dest.iParm; + break; + } + } + + if( testAddr ){ + sqlite3VdbeJumpHere(v, testAddr-1); + } + sqlite3ExprCachePop(pParse, 1); + + return; +} +#endif /* SQLITE_OMIT_SUBQUERY */ + +/* +** Duplicate an 8-byte value +*/ +static char *dup8bytes(Vdbe *v, const char *in){ + char *out = sqlite3DbMallocRaw(sqlite3VdbeDb(v), 8); + if( out ){ + memcpy(out, in, 8); + } + return out; +} + +/* +** Generate an instruction that will put the floating point +** value described by z[0..n-1] into register iMem. +** +** The z[] string will probably not be zero-terminated. But the +** 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; + sqlite3AtoF(z, &value); + if( sqlite3IsNaN(value) ){ + sqlite3VdbeAddOp2(v, OP_Null, 0, iMem); + }else{ + if( negateFlag ) value = -value; + zV = dup8bytes(v, (char*)&value); + sqlite3VdbeAddOp4(v, OP_Real, 0, iMem, 0, zV, P4_REAL); + } + } +} + + +/* +** Generate an instruction that will put the integer describe by +** text z[0..n-1] into register iMem. +** +** The z[] string will probably not be zero-terminated. But the +** z[n] character is guaranteed to be something that does not look +** like the continuation of the number. +*/ +static void codeInteger(Vdbe *v, Expr *pExpr, int negFlag, int iMem){ + const char *z; + if( pExpr->flags & EP_IntValue ){ + int i = pExpr->iTable; + 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]) ); + if( sqlite3GetInt32(z, &i) ){ + if( negFlag ) i = -i; + sqlite3VdbeAddOp2(v, OP_Integer, i, iMem); + }else if( sqlite3FitsIn64Bits(z, negFlag) ){ + i64 value; + char *zV; + sqlite3Atoi64(z, &value); + if( negFlag ) value = -value; + zV = dup8bytes(v, (char*)&value); + sqlite3VdbeAddOp4(v, OP_Int64, 0, iMem, 0, zV, P4_INT64); + }else{ + codeReal(v, z, n, negFlag, iMem); + } + } +} + +/* +** Clear a cache entry. +*/ +static void cacheEntryClear(Parse *pParse, struct yColCache *p){ + if( p->tempReg ){ + if( pParse->nTempRegaTempReg) ){ + pParse->aTempReg[pParse->nTempReg++] = p->iReg; + } + p->tempReg = 0; + } +} + + +/* +** Record in the column cache that a particular column from a +** particular table is stored in a particular register. +*/ +void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int iReg){ + int i; + int minLru; + int idxLru; + struct yColCache *p; + + /* First replace any existing entry */ + for(i=0, p=pParse->aColCache; iiReg && p->iTable==iTab && p->iColumn==iCol ){ + cacheEntryClear(pParse, p); + p->iLevel = pParse->iCacheLevel; + p->iReg = iReg; + p->affChange = 0; + p->lru = pParse->iCacheCnt++; + return; + } + } + if( iReg<=0 ) return; + + /* Find an empty slot and replace it */ + for(i=0, p=pParse->aColCache; iiReg==0 ){ + p->iLevel = pParse->iCacheLevel; + p->iTable = iTab; + p->iColumn = iCol; + p->iReg = iReg; + p->affChange = 0; + p->tempReg = 0; + p->lru = pParse->iCacheCnt++; + return; + } + } + + /* Replace the last recently used */ + minLru = 0x7fffffff; + idxLru = -1; + for(i=0, p=pParse->aColCache; ilrulru; + } + } + if( idxLru>=0 ){ + p = &pParse->aColCache[idxLru]; + p->iLevel = pParse->iCacheLevel; + p->iTable = iTab; + p->iColumn = iCol; + p->iReg = iReg; + p->affChange = 0; + p->tempReg = 0; + p->lru = pParse->iCacheCnt++; + return; + } +} + +/* +** Indicate that a register is being overwritten. Purge the register +** from the column cache. +*/ +void sqlite3ExprCacheRemove(Parse *pParse, int iReg){ + int i; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg==iReg ){ + cacheEntryClear(pParse, p); + p->iReg = 0; + } + } +} + +/* +** Remember the current column cache context. Any new entries added +** added to the column cache after this call are removed when the +** corresponding pop occurs. +*/ +void sqlite3ExprCachePush(Parse *pParse){ + pParse->iCacheLevel++; +} + +/* +** Remove from the column cache any entries that were added since the +** the previous N Push operations. In other words, restore the cache +** to the state it was in N Pushes ago. +*/ +void sqlite3ExprCachePop(Parse *pParse, int N){ + int i; + struct yColCache *p; + assert( N>0 ); + assert( pParse->iCacheLevel>=N ); + pParse->iCacheLevel -= N; + for(i=0, p=pParse->aColCache; iiReg && p->iLevel>pParse->iCacheLevel ){ + cacheEntryClear(pParse, p); + p->iReg = 0; + } + } +} + +/* +** Generate code that will extract the iColumn-th column from +** table pTab and store the column value in a register. An effort +** is made to store the column value in register iReg, but this is +** not guaranteed. The location of the column value is returned. +** +** There must be an open cursor to pTab in iTable when this routine +** is called. If iColumn<0 then code is generated that extracts the rowid. +** +** This routine might attempt to reuse the value of the column that +** has already been loaded into a register. The value will always +** be used if it has not undergone any affinity changes. But if +** an affinity change has occurred, then the cached value will only be +** used if allowAffChng is true. +*/ +int sqlite3ExprCodeGetColumn( + Parse *pParse, /* Parsing and code generating context */ + Table *pTab, /* Description of the table we are reading from */ + int iColumn, /* Index of the table column */ + int iTable, /* The cursor pointing to the table */ + int iReg, /* Store results here */ + int allowAffChng /* True if prior affinity changes are OK */ +){ + Vdbe *v = pParse->pVdbe; + int i; + struct yColCache *p; + + for(i=0, p=pParse->aColCache; iiReg>0 && p->iTable==iTable && p->iColumn==iColumn + && (!p->affChange || allowAffChng) ){ +#if 0 + sqlite3VdbeAddOp0(v, OP_Noop); + VdbeComment((v, "OPT: tab%d.col%d -> r%d", iTable, iColumn, p->iReg)); +#endif + p->lru = pParse->iCacheCnt++; + p->tempReg = 0; /* This pins the register, but also leaks it */ + return p->iReg; + } + } + assert( v!=0 ); + if( iColumn<0 ){ + sqlite3VdbeAddOp2(v, OP_Rowid, iTable, iReg); + }else if( pTab==0 ){ + sqlite3VdbeAddOp3(v, OP_Column, iTable, iColumn, iReg); + }else{ + int op = IsVirtual(pTab) ? OP_VColumn : OP_Column; + sqlite3VdbeAddOp3(v, op, iTable, iColumn, iReg); + sqlite3ColumnDefault(v, pTab, iColumn); +#ifndef SQLITE_OMIT_FLOATING_POINT + if( pTab->aCol[iColumn].affinity==SQLITE_AFF_REAL ){ + sqlite3VdbeAddOp1(v, OP_RealAffinity, iReg); + } +#endif + } + sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); + return iReg; +} + +/* +** Clear all column cache entries. +*/ +void sqlite3ExprCacheClear(Parse *pParse){ + int i; + struct yColCache *p; + + for(i=0, p=pParse->aColCache; iiReg ){ + cacheEntryClear(pParse, p); + p->iReg = 0; + } + } +} + +/* +** Record the fact that an affinity change has occurred on iCount +** registers starting with iStart. +*/ +void sqlite3ExprCacheAffinityChange(Parse *pParse, int iStart, int iCount){ + int iEnd = iStart + iCount - 1; + int i; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg; + if( r>=iStart && r<=iEnd ){ + p->affChange = 1; + } + } +} + +/* +** Generate code to move content from registers iFrom...iFrom+nReg-1 +** over to iTo..iTo+nReg-1. Keep the column cache up-to-date. +*/ +void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iTo, int nReg){ + int i; + struct yColCache *p; + if( iFrom==iTo ) return; + sqlite3VdbeAddOp3(pParse->pVdbe, OP_Move, iFrom, iTo, nReg); + for(i=0, p=pParse->aColCache; iiReg; + if( x>=iFrom && xiReg += iTo-iFrom; + } + } +} + +/* +** Generate code to copy content from registers iFrom...iFrom+nReg-1 +** over to iTo..iTo+nReg-1. +*/ +void sqlite3ExprCodeCopy(Parse *pParse, int iFrom, int iTo, int nReg){ + int i; + if( iFrom==iTo ) return; + for(i=0; ipVdbe, OP_Copy, iFrom+i, iTo+i); + } +} + +/* +** Return true if any register in the range iFrom..iTo (inclusive) +** is used as part of the column cache. +*/ +static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){ + int i; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg; + if( r>=iFrom && r<=iTo ) return 1; + } + return 0; +} + +/* +** If the last instruction coded is an ephemeral copy of any of +** the registers in the nReg registers beginning with iReg, then +** convert the last instruction from OP_SCopy to OP_Copy. +*/ +void sqlite3ExprHardCopy(Parse *pParse, int iReg, int nReg){ + int addr; + VdbeOp *pOp; + Vdbe *v; + + v = pParse->pVdbe; + addr = sqlite3VdbeCurrentAddr(v); + pOp = sqlite3VdbeGetOp(v, addr-1); + assert( pOp || pParse->db->mallocFailed ); + if( pOp && pOp->opcode==OP_SCopy && pOp->p1>=iReg && pOp->p1opcode = OP_Copy; + } +} + +/* +** Generate code to store the value of the iAlias-th alias in register +** target. The first time this is called, pExpr is evaluated to compute +** the value of the alias. The value is stored in an auxiliary register +** and the number of that register is returned. On subsequent calls, +** the register number is returned without generating any code. +** +** Note that in order for this to work, code must be generated in the +** same order that it is executed. +** +** Aliases are numbered starting with 1. So iAlias is in the range +** of 1 to pParse->nAlias inclusive. +** +** 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){ +#if 0 + sqlite3 *db = pParse->db; + int iReg; + if( pParse->nAliasAllocnAlias ){ + pParse->aAlias = sqlite3DbReallocOrFree(db, pParse->aAlias, + 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->iCacheLevel>0 ){ + iReg = sqlite3ExprCodeTarget(pParse, pExpr, target); + }else{ + iReg = ++pParse->nMem; + sqlite3ExprCode(pParse, pExpr, iReg); + pParse->aAlias[iAlias-1] = iReg; + } + } + return iReg; +#else + UNUSED_PARAMETER(iAlias); + return sqlite3ExprCodeTarget(pParse, pExpr, target); +#endif +} + +/* +** Generate code into the current Vdbe to evaluate the given +** expression. Attempt to store the results in register "target". +** Return the register where results are stored. +** +** With this routine, there is no guarantee that results will +** be stored in target. The result might be stored in some other +** register if it is convenient to do so. The calling function +** must check the return code and move the results to the desired +** register. +*/ +int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ + Vdbe *v = pParse->pVdbe; /* The VM under construction */ + int op; /* The opcode being coded */ + int inReg = target; /* Results stored in register inReg */ + int regFree1 = 0; /* If non-zero free this temporary register */ + int regFree2 = 0; /* If non-zero free this temporary register */ + int r1, r2, r3, r4; /* Various register numbers */ + sqlite3 *db; + + db = pParse->db; + assert( v!=0 || db->mallocFailed ); + assert( target>0 && target<=pParse->nMem ); + if( v==0 ) return 0; + + if( pExpr==0 ){ + op = TK_NULL; + }else{ + op = pExpr->op; + } + switch( op ){ + case TK_AGG_COLUMN: { + AggInfo *pAggInfo = pExpr->pAggInfo; + struct AggInfo_col *pCol = &pAggInfo->aCol[pExpr->iAgg]; + if( !pAggInfo->directMode ){ + assert( pCol->iMem>0 ); + inReg = pCol->iMem; + break; + }else if( pAggInfo->useSortingIdx ){ + sqlite3VdbeAddOp3(v, OP_Column, pAggInfo->sortingIdx, + pCol->iSorterColumn, target); + break; + } + /* Otherwise, fall thru into the TK_COLUMN case */ + } + case TK_COLUMN: { + if( pExpr->iTable<0 ){ + /* This only happens when coding check constraints */ + assert( pParse->ckBase>0 ); + inReg = pExpr->iColumn + pParse->ckBase; + }else{ + testcase( (pExpr->flags & EP_AnyAff)!=0 ); + inReg = sqlite3ExprCodeGetColumn(pParse, pExpr->pTab, + pExpr->iColumn, pExpr->iTable, target, + pExpr->flags & EP_AnyAff); + } + break; + } + case TK_INTEGER: { + codeInteger(v, pExpr, 0, target); + break; + } + case TK_FLOAT: { + codeReal(v, (char*)pExpr->token.z, pExpr->token.n, 0, target); + break; + } + case TK_STRING: { + sqlite3VdbeAddOp4(v, OP_String8, 0, target, 0, + (char*)pExpr->token.z, pExpr->token.n); + break; + } + case TK_NULL: { + sqlite3VdbeAddOp2(v, OP_Null, 0, target); + break; + } +#ifndef SQLITE_OMIT_BLOB_LITERAL + case TK_BLOB: { + int n; + const char *z; + char *zBlob; + 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]=='\'' ); + n = pExpr->token.n - 3; + z = (char*)pExpr->token.z + 2; + zBlob = sqlite3HexToBlob(sqlite3VdbeDb(v), z, n); + sqlite3VdbeAddOp4(v, OP_Blob, n/2, target, 0, zBlob, P4_DYNAMIC); + break; + } +#endif + case TK_VARIABLE: { + int iPrior; + VdbeOp *pOp; + if( pExpr->token.n<=1 + && (iPrior = sqlite3VdbeCurrentAddr(v)-1)>=0 + && (pOp = sqlite3VdbeGetOp(v, iPrior))->opcode==OP_Variable + && pOp->p1+pOp->p3==pExpr->iTable + && pOp->p2+pOp->p3==target + && pOp->p4.z==0 + ){ + /* If the previous instruction was a copy of the previous unnamed + ** parameter into the previous register, then simply increment the + ** repeat count on the prior instruction rather than making a new + ** instruction. + */ + pOp->p3++; + }else{ + sqlite3VdbeAddOp3(v, OP_Variable, pExpr->iTable, target, 1); + if( pExpr->token.n>1 ){ + sqlite3VdbeChangeP4(v, -1, (char*)pExpr->token.z, pExpr->token.n); + } + } + break; + } + case TK_REGISTER: { + inReg = pExpr->iTable; + break; + } + case TK_AS: { + inReg = codeAlias(pParse, pExpr->iTable, pExpr->pLeft, target); + break; + } +#ifndef SQLITE_OMIT_CAST + case TK_CAST: { + /* Expressions of the form: CAST(pLeft AS token) */ + int aff, to_op; + inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); + aff = sqlite3AffinityType(&pExpr->token); + to_op = aff - SQLITE_AFF_TEXT + OP_ToText; + assert( to_op==OP_ToText || aff!=SQLITE_AFF_TEXT ); + assert( to_op==OP_ToBlob || aff!=SQLITE_AFF_NONE ); + assert( to_op==OP_ToNumeric || aff!=SQLITE_AFF_NUMERIC ); + assert( to_op==OP_ToInt || aff!=SQLITE_AFF_INTEGER ); + assert( to_op==OP_ToReal || aff!=SQLITE_AFF_REAL ); + 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; + } +#endif /* SQLITE_OMIT_CAST */ + case TK_LT: + case TK_LE: + case TK_GT: + case TK_GE: + case TK_NE: + case TK_EQ: { + assert( TK_LT==OP_Lt ); + assert( TK_LE==OP_Le ); + assert( TK_GT==OP_Gt ); + assert( TK_GE==OP_Ge ); + assert( TK_EQ==OP_Eq ); + assert( TK_NE==OP_Ne ); + testcase( op==TK_LT ); + testcase( op==TK_LE ); + testcase( op==TK_GT ); + testcase( op==TK_GE ); + testcase( op==TK_EQ ); + testcase( op==TK_NE ); + codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, + pExpr->pRight, &r2, ®Free2); + codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, + r1, r2, inReg, SQLITE_STOREP2); + testcase( regFree1==0 ); + testcase( regFree2==0 ); + break; + } + case TK_AND: + case TK_OR: + case TK_PLUS: + case TK_STAR: + case TK_MINUS: + case TK_REM: + case TK_BITAND: + case TK_BITOR: + case TK_SLASH: + case TK_LSHIFT: + case TK_RSHIFT: + case TK_CONCAT: { + assert( TK_AND==OP_And ); + assert( TK_OR==OP_Or ); + assert( TK_PLUS==OP_Add ); + assert( TK_MINUS==OP_Subtract ); + assert( TK_REM==OP_Remainder ); + assert( TK_BITAND==OP_BitAnd ); + assert( TK_BITOR==OP_BitOr ); + assert( TK_SLASH==OP_Divide ); + assert( TK_LSHIFT==OP_ShiftLeft ); + assert( TK_RSHIFT==OP_ShiftRight ); + assert( TK_CONCAT==OP_Concat ); + testcase( op==TK_AND ); + testcase( op==TK_OR ); + testcase( op==TK_PLUS ); + testcase( op==TK_MINUS ); + testcase( op==TK_REM ); + testcase( op==TK_BITAND ); + testcase( op==TK_BITOR ); + testcase( op==TK_SLASH ); + testcase( op==TK_LSHIFT ); + testcase( op==TK_RSHIFT ); + testcase( op==TK_CONCAT ); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pRight, ®Free2); + sqlite3VdbeAddOp3(v, op, r2, r1, target); + testcase( regFree1==0 ); + testcase( regFree2==0 ); + 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); + }else{ + regFree1 = r1 = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Integer, 0, r1); + r2 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free2); + sqlite3VdbeAddOp3(v, OP_Subtract, r2, r1, target); + testcase( regFree2==0 ); + } + inReg = target; + break; + } + case TK_BITNOT: + 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); + break; + } + case TK_ISNULL: + case TK_NOTNULL: { + int addr; + assert( TK_ISNULL==OP_IsNull ); + assert( TK_NOTNULL==OP_NotNull ); + testcase( op==TK_ISNULL ); + testcase( op==TK_NOTNULL ); + sqlite3VdbeAddOp2(v, OP_Integer, 1, target); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + testcase( regFree1==0 ); + addr = sqlite3VdbeAddOp1(v, op, r1); + sqlite3VdbeAddOp2(v, OP_AddImm, target, -1); + sqlite3VdbeJumpHere(v, addr); + break; + } + case TK_AGG_FUNCTION: { + AggInfo *pInfo = pExpr->pAggInfo; + if( pInfo==0 ){ + sqlite3ErrorMsg(pParse, "misuse of aggregate: %T", + &pExpr->span); + }else{ + inReg = pInfo->aFunc[pExpr->iAgg].iMem; + } + break; + } + case TK_CONST_FUNC: + case TK_FUNCTION: { + ExprList *pFarg; /* List of function arguments */ + int nFarg; /* Number of function arguments */ + FuncDef *pDef; /* The function definition object */ + int nId; /* Length of the function name in bytes */ + const char *zId; /* The function name */ + int constMask = 0; /* Mask of function arguments that are constant */ + int i; /* Loop counter */ + u8 enc = ENC(db); /* The text encoding used by this database */ + CollSeq *pColl = 0; /* A collating sequence */ + + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + testcase( op==TK_CONST_FUNC ); + testcase( op==TK_FUNCTION ); + if( ExprHasAnyProperty(pExpr, EP_TokenOnly|EP_SpanToken) ){ + pFarg = 0; + }else{ + pFarg = pExpr->x.pList; + } + nFarg = pFarg ? pFarg->nExpr : 0; + zId = (char*)pExpr->token.z; + nId = pExpr->token.n; + pDef = sqlite3FindFunction(db, zId, nId, nFarg, enc, 0); + assert( pDef!=0 ); + if( pFarg ){ + r1 = sqlite3GetTempRange(pParse, nFarg); + sqlite3ExprCodeExprList(pParse, pFarg, r1, 1); + }else{ + r1 = 0; + } +#ifndef SQLITE_OMIT_VIRTUALTABLE + /* Possibly overload the function if the first argument is + ** a virtual table column. + ** + ** For infix functions (LIKE, GLOB, REGEXP, and MATCH) use the + ** second argument, not the first, as the argument to test to + ** see if it is a column in a virtual table. This is done because + ** the left operand of infix functions (the operand we want to + ** control overloading) ends up as the second argument to the + ** function. The expression "A glob B" is equivalent to + ** "glob(B,A). We want to use the A in "A glob B" to test + ** for function overloading. But we use the B term in "glob(B,A)". + */ + if( nFarg>=2 && (pExpr->flags & EP_InfixFunc) ){ + pDef = sqlite3VtabOverloadFunction(db, pDef, nFarg, pFarg->a[1].pExpr); + }else if( nFarg>0 ){ + pDef = sqlite3VtabOverloadFunction(db, pDef, nFarg, pFarg->a[0].pExpr); + } +#endif + for(i=0; ia[i].pExpr) ){ + constMask |= (1<flags & SQLITE_FUNC_NEEDCOLL)!=0 && !pColl ){ + pColl = sqlite3ExprCollSeq(pParse, pFarg->a[i].pExpr); + } + } + if( pDef->flags & SQLITE_FUNC_NEEDCOLL ){ + 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)nFarg); + if( nFarg ){ + sqlite3ReleaseTempRange(pParse, r1, nFarg); + } + sqlite3ExprCacheAffinityChange(pParse, r1, nFarg); + break; + } +#ifndef SQLITE_OMIT_SUBQUERY + case TK_EXISTS: + case TK_SELECT: { + testcase( op==TK_EXISTS ); + testcase( op==TK_SELECT ); + if( pExpr->iColumn==0 ){ + sqlite3CodeSubselect(pParse, pExpr, 0, 0); + } + inReg = pExpr->iColumn; + break; + } + case TK_IN: { + int rNotFound = 0; + int rMayHaveNull = 0; + int j2, j3, j4, j5; + char affinity; + int eType; + + VdbeNoopComment((v, "begin IN expr r%d", target)); + eType = sqlite3FindInIndex(pParse, pExpr, &rMayHaveNull); + if( rMayHaveNull ){ + rNotFound = ++pParse->nMem; + } + + /* Figure out the affinity to use to create a key from the results + ** of the expression. affinityStr stores a static string suitable for + ** P4 of OP_MakeRecord. + */ + affinity = comparisonAffinity(pExpr); + + + /* Code the from " IN (...)". The temporary table + ** pExpr->iTable contains the values that make up the (...) set. + */ + sqlite3ExprCachePush(pParse); + sqlite3ExprCode(pParse, pExpr->pLeft, target); + j2 = sqlite3VdbeAddOp1(v, OP_IsNull, target); + if( eType==IN_INDEX_ROWID ){ + j3 = sqlite3VdbeAddOp1(v, OP_MustBeInt, target); + j4 = sqlite3VdbeAddOp3(v, OP_NotExists, pExpr->iTable, 0, target); + sqlite3VdbeAddOp2(v, OP_Integer, 1, target); + j5 = sqlite3VdbeAddOp0(v, OP_Goto); + sqlite3VdbeJumpHere(v, j3); + sqlite3VdbeJumpHere(v, j4); + sqlite3VdbeAddOp2(v, OP_Integer, 0, target); + }else{ + r2 = regFree2 = sqlite3GetTempReg(pParse); + + /* Create a record and test for set membership. If the set contains + ** the value, then jump to the end of the test code. The target + ** register still contains the true (1) value written to it earlier. + */ + sqlite3VdbeAddOp4(v, OP_MakeRecord, target, 1, r2, &affinity, 1); + sqlite3VdbeAddOp2(v, OP_Integer, 1, target); + j5 = sqlite3VdbeAddOp3(v, OP_Found, pExpr->iTable, 0, r2); + + /* If the set membership test fails, then the result of the + ** "x IN (...)" expression must be either 0 or NULL. If the set + ** contains no NULL values, then the result is 0. If the set + ** contains one or more NULL values, then the result of the + ** expression is also NULL. + */ + if( rNotFound==0 ){ + /* This branch runs if it is known at compile time (now) that + ** the set contains no NULL values. This happens as the result + ** of a "NOT NULL" constraint in the database schema. No need + ** to test the data structure at runtime in this case. + */ + sqlite3VdbeAddOp2(v, OP_Integer, 0, target); + }else{ + /* This block populates the rNotFound register with either NULL + ** or 0 (an integer value). If the data structure contains one + ** or more NULLs, then set rNotFound to NULL. Otherwise, set it + ** to 0. If register rMayHaveNull is already set to some value + ** other than NULL, then the test has already been run and + ** rNotFound is already populated. + */ + static const char nullRecord[] = { 0x02, 0x00 }; + j3 = sqlite3VdbeAddOp1(v, OP_NotNull, rMayHaveNull); + sqlite3VdbeAddOp2(v, OP_Null, 0, rNotFound); + sqlite3VdbeAddOp4(v, OP_Blob, 2, rMayHaveNull, 0, + nullRecord, P4_STATIC); + j4 = sqlite3VdbeAddOp3(v, OP_Found, pExpr->iTable, 0, rMayHaveNull); + sqlite3VdbeAddOp2(v, OP_Integer, 0, rNotFound); + sqlite3VdbeJumpHere(v, j4); + sqlite3VdbeJumpHere(v, j3); + + /* Copy the value of register rNotFound (which is either NULL or 0) + ** into the target register. This will be the result of the + ** expression. + */ + sqlite3VdbeAddOp2(v, OP_Copy, rNotFound, target); + } + } + sqlite3VdbeJumpHere(v, j2); + sqlite3VdbeJumpHere(v, j5); + sqlite3ExprCachePop(pParse, 1); + VdbeComment((v, "end IN expr r%d", target)); + break; + } +#endif + /* + ** x BETWEEN y AND z + ** + ** This is equivalent to + ** + ** x>=y AND x<=z + ** + ** X is stored in pExpr->pLeft. + ** Y is stored in pExpr->pList->a[0].pExpr. + ** Z is stored in pExpr->pList->a[1].pExpr. + */ + case TK_BETWEEN: { + Expr *pLeft = pExpr->pLeft; + struct ExprList_item *pLItem = pExpr->x.pList->a; + Expr *pRight = pLItem->pExpr; + + codeCompareOperands(pParse, pLeft, &r1, ®Free1, + pRight, &r2, ®Free2); + testcase( regFree1==0 ); + testcase( regFree2==0 ); + r3 = sqlite3GetTempReg(pParse); + r4 = sqlite3GetTempReg(pParse); + codeCompare(pParse, pLeft, pRight, OP_Ge, + r1, r2, r3, SQLITE_STOREP2); + pLItem++; + pRight = pLItem->pExpr; + sqlite3ReleaseTempReg(pParse, regFree2); + r2 = sqlite3ExprCodeTemp(pParse, pRight, ®Free2); + testcase( regFree2==0 ); + codeCompare(pParse, pLeft, pRight, OP_Le, r1, r2, r4, SQLITE_STOREP2); + sqlite3VdbeAddOp3(v, OP_And, r3, r4, target); + sqlite3ReleaseTempReg(pParse, r3); + sqlite3ReleaseTempReg(pParse, r4); + break; + } + case TK_UPLUS: { + inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); + break; + } + + /* + ** Form A: + ** CASE x WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END + ** + ** Form B: + ** CASE WHEN e1 THEN r1 WHEN e2 THEN r2 ... WHEN eN THEN rN ELSE y END + ** + ** Form A is can be transformed into the equivalent form B as follows: + ** CASE WHEN x=e1 THEN r1 WHEN x=e2 THEN r2 ... + ** WHEN x=eN THEN rN ELSE y END + ** + ** X (if it exists) is in pExpr->pLeft. + ** Y is in pExpr->pRight. The Y is also optional. If there is no + ** ELSE clause and no other term matches, then the result of the + ** exprssion is NULL. + ** Ei is in pExpr->pList->a[i*2] and Ri is pExpr->pList->a[i*2+1]. + ** + ** The result of the expression is the Ri for the first matching Ei, + ** or if there is no matching Ei, the ELSE term Y, or if there is + ** no ELSE term, NULL. + */ + case TK_CASE: { + int endLabel; /* GOTO label for end of CASE stmt */ + int nextCase; /* GOTO label for next WHEN clause */ + int nExpr; /* 2x number of WHEN terms */ + int i; /* Loop counter */ + 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) */ + VVA_ONLY( int iCacheLevel = pParse->iCacheLevel; ) + + assert( !ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList ); + assert((pExpr->x.pList->nExpr % 2) == 0); + assert(pExpr->x.pList->nExpr > 0); + pEList = pExpr->x.pList; + aListelem = pEList->a; + nExpr = pEList->nExpr; + endLabel = sqlite3VdbeMakeLabel(v); + if( (pX = pExpr->pLeft)!=0 ){ + cacheX = *pX; + testcase( pX->op==TK_COLUMN || pX->op==TK_REGISTER ); + cacheX.iTable = sqlite3ExprCodeTemp(pParse, pX, ®Free1); + testcase( regFree1==0 ); + cacheX.op = TK_REGISTER; + opCompare.op = TK_EQ; + opCompare.pLeft = &cacheX; + pTest = &opCompare; + } + for(i=0; iop==TK_COLUMN || pTest->op==TK_REGISTER ); + sqlite3ExprIfFalse(pParse, pTest, nextCase, SQLITE_JUMPIFNULL); + testcase( aListelem[i+1].pExpr->op==TK_COLUMN ); + testcase( aListelem[i+1].pExpr->op==TK_REGISTER ); + sqlite3ExprCode(pParse, aListelem[i+1].pExpr, target); + sqlite3VdbeAddOp2(v, OP_Goto, 0, endLabel); + sqlite3ExprCachePop(pParse, 1); + sqlite3VdbeResolveLabel(v, nextCase); + } + if( pExpr->pRight ){ + sqlite3ExprCachePush(pParse); + sqlite3ExprCode(pParse, pExpr->pRight, target); + sqlite3ExprCachePop(pParse, 1); + }else{ + sqlite3VdbeAddOp2(v, OP_Null, 0, target); + } + assert( db->mallocFailed || pParse->nErr>0 + || pParse->iCacheLevel==iCacheLevel ); + sqlite3VdbeResolveLabel(v, endLabel); + break; + } +#ifndef SQLITE_OMIT_TRIGGER + case TK_RAISE: { + if( !pParse->trigStack ){ + sqlite3ErrorMsg(pParse, + "RAISE() may only be used within a trigger-program"); + return 0; + } + if( pExpr->affinity!=OE_Ignore ){ + assert( pExpr->affinity==OE_Rollback || + pExpr->affinity == OE_Abort || + pExpr->affinity == OE_Fail ); + sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->affinity, 0, + (char*)pExpr->token.z, pExpr->token.n); + } else { + assert( pExpr->affinity == OE_Ignore ); + sqlite3VdbeAddOp2(v, OP_ContextPop, 0, 0); + sqlite3VdbeAddOp2(v, OP_Goto, 0, pParse->trigStack->ignoreJump); + VdbeComment((v, "raise(IGNORE)")); + } + break; + } +#endif + } + sqlite3ReleaseTempReg(pParse, regFree1); + sqlite3ReleaseTempReg(pParse, regFree2); + return inReg; +} + +/* +** Generate code to evaluate an expression and store the results +** into a register. Return the register number where the results +** are stored. +** +** If the register is a temporary register that can be deallocated, +** then write its number into *pReg. If the result register is not +** a temporary, then set *pReg to zero. +*/ +int sqlite3ExprCodeTemp(Parse *pParse, Expr *pExpr, int *pReg){ + int r1 = sqlite3GetTempReg(pParse); + int r2 = sqlite3ExprCodeTarget(pParse, pExpr, r1); + if( r2==r1 ){ + *pReg = r1; + }else{ + sqlite3ReleaseTempReg(pParse, r1); + *pReg = 0; + } + return r2; +} + +/* +** Generate code that will evaluate expression pExpr and store the +** results in register target. The results are guaranteed to appear +** in register target. +*/ +int sqlite3ExprCode(Parse *pParse, Expr *pExpr, int target){ + int inReg; + + assert( target>0 && target<=pParse->nMem ); + inReg = sqlite3ExprCodeTarget(pParse, pExpr, target); + assert( pParse->pVdbe || pParse->db->mallocFailed ); + if( inReg!=target && pParse->pVdbe ){ + sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, inReg, target); + } + return target; +} + +/* +** Generate code that evalutes the given expression and puts the result +** in register target. +** +** Also make a copy of the expression results into another "cache" register +** and modify the expression so that the next time it is evaluated, +** the result is a copy of the cache register. +** +** This routine is used for expressions that are used multiple +** times. They are evaluated once and the results of the expression +** are reused. +*/ +int sqlite3ExprCodeAndCache(Parse *pParse, Expr *pExpr, int target){ + Vdbe *v = pParse->pVdbe; + int inReg; + inReg = sqlite3ExprCode(pParse, pExpr, target); + assert( target>0 ); + if( pExpr->op!=TK_REGISTER ){ + int iMem; + iMem = ++pParse->nMem; + sqlite3VdbeAddOp2(v, OP_Copy, inReg, iMem); + pExpr->iTable = iMem; + pExpr->op = TK_REGISTER; + } + return inReg; +} + +/* +** Return TRUE if pExpr is an constant expression that is appropriate +** for factoring out of a loop. Appropriate expressions are: +** +** * Any expression that evaluates to two or more opcodes. +** +** * Any OP_Integer, OP_Real, OP_String, OP_Blob, OP_Null, +** or OP_Variable that does not need to be placed in a +** specific register. +** +** There is no point in factoring out single-instruction constant +** expressions that need to be placed in a particular register. +** We could factor them out, but then we would end up adding an +** OP_SCopy instruction to move the value into the correct register +** later. We might as well just use the original instruction and +** avoid the OP_SCopy. +*/ +static int isAppropriateForFactoring(Expr *p){ + if( !sqlite3ExprIsConstantNotJoin(p) ){ + return 0; /* Only constant expressions are appropriate for factoring */ + } + if( (p->flags & EP_FixedDest)==0 ){ + return 1; /* Any constant without a fixed destination is appropriate */ + } + while( p->op==TK_UPLUS ) p = p->pLeft; + switch( p->op ){ +#ifndef SQLITE_OMIT_BLOB_LITERAL + case TK_BLOB: +#endif + case TK_VARIABLE: + case TK_INTEGER: + case TK_FLOAT: + case TK_NULL: + case TK_STRING: { + testcase( p->op==TK_BLOB ); + testcase( p->op==TK_VARIABLE ); + testcase( p->op==TK_INTEGER ); + testcase( p->op==TK_FLOAT ); + testcase( p->op==TK_NULL ); + testcase( p->op==TK_STRING ); + /* Single-instruction constants with a fixed destination are + ** better done in-line. If we factor them, they will just end + ** up generating an OP_SCopy to move the value to the destination + ** register. */ + return 0; + } + case TK_UMINUS: { + if( p->pLeft->op==TK_FLOAT || p->pLeft->op==TK_INTEGER ){ + return 0; + } + break; + } + default: { + break; + } + } + return 1; +} + +/* +** If pExpr is a constant expression that is appropriate for +** factoring out of a loop, then evaluate the expression +** into a register and convert the expression into a TK_REGISTER +** expression. +*/ +static int evalConstExpr(Walker *pWalker, Expr *pExpr){ + Parse *pParse = pWalker->pParse; + switch( pExpr->op ){ + case TK_REGISTER: { + return 1; + } + case TK_FUNCTION: + case TK_AGG_FUNCTION: + case TK_CONST_FUNC: { + /* The arguments to a function have a fixed destination. + ** Mark them this way to avoid generated unneeded OP_SCopy + ** instructions. + */ + ExprList *pList = pExpr->x.pList; + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + if( pList ){ + int i = pList->nExpr; + struct ExprList_item *pItem = pList->a; + for(; i>0; i--, pItem++){ + if( pItem->pExpr ) pItem->pExpr->flags |= EP_FixedDest; + } + } + break; + } + } + if( isAppropriateForFactoring(pExpr) ){ + int r1 = ++pParse->nMem; + int r2; + r2 = sqlite3ExprCodeTarget(pParse, pExpr, r1); + if( r1!=r2 ) sqlite3ReleaseTempReg(pParse, r1); + pExpr->op = TK_REGISTER; + pExpr->iTable = r2; + return WRC_Prune; + } + return WRC_Continue; +} + +/* +** Preevaluate constant subexpressions within pExpr and store the +** results in registers. Modify pExpr so that the constant subexpresions +** are TK_REGISTER opcodes that refer to the precomputed values. +*/ +void sqlite3ExprCodeConstants(Parse *pParse, Expr *pExpr){ + Walker w; + w.xExprCallback = evalConstExpr; + w.xSelectCallback = 0; + w.pParse = pParse; + sqlite3WalkExpr(&w, pExpr); +} + + +/* +** Generate code that pushes the value of every element of the given +** expression list into a sequence of registers beginning at target. +** +** Return the number of elements evaluated. +*/ +int sqlite3ExprCodeExprList( + Parse *pParse, /* Parsing context */ + ExprList *pList, /* The expression list to be coded */ + int target, /* Where to write results */ + int doHardCopy /* Make a hard copy of every element */ +){ + struct ExprList_item *pItem; + int i, n; + assert( pList!=0 ); + assert( target>0 ); + n = pList->nExpr; + for(pItem=pList->a, i=0; iiAlias ){ + int iReg = codeAlias(pParse, pItem->iAlias, pItem->pExpr, target+i); + Vdbe *v = sqlite3GetVdbe(pParse); + if( iReg!=target+i ){ + sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target+i); + } + }else{ + sqlite3ExprCode(pParse, pItem->pExpr, target+i); + } + if( doHardCopy ){ + sqlite3ExprHardCopy(pParse, target, n); + } + } + return n; +} + +/* +** Generate code for a boolean expression such that a jump is made +** to the label "dest" if the expression is true but execution +** continues straight thru if the expression is false. +** +** If the expression evaluates to NULL (neither true nor false), then +** take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL. +** +** This code depends on the fact that certain token values (ex: TK_EQ) +** are the same as opcode values (ex: OP_Eq) that implement the corresponding +** operation. Special comments in vdbe.c and the mkopcodeh.awk script in +** the make process cause these values to align. Assert()s in the code +** below verify that the numbers are aligned correctly. +*/ +void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ + Vdbe *v = pParse->pVdbe; + int op = 0; + int regFree1 = 0; + int regFree2 = 0; + int r1, r2; + + assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); + if( v==0 || pExpr==0 ) return; + op = pExpr->op; + switch( op ){ + case TK_AND: { + int d2 = sqlite3VdbeMakeLabel(v); + testcase( jumpIfNull==0 ); + sqlite3ExprCachePush(pParse); + sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2,jumpIfNull^SQLITE_JUMPIFNULL); + sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); + sqlite3VdbeResolveLabel(v, d2); + sqlite3ExprCachePop(pParse, 1); + break; + } + case TK_OR: { + testcase( jumpIfNull==0 ); + sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); + sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); + break; + } + case TK_NOT: { + testcase( jumpIfNull==0 ); + sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); + break; + } + case TK_LT: + case TK_LE: + case TK_GT: + case TK_GE: + case TK_NE: + case TK_EQ: { + assert( TK_LT==OP_Lt ); + assert( TK_LE==OP_Le ); + assert( TK_GT==OP_Gt ); + assert( TK_GE==OP_Ge ); + assert( TK_EQ==OP_Eq ); + assert( TK_NE==OP_Ne ); + testcase( op==TK_LT ); + testcase( op==TK_LE ); + testcase( op==TK_GT ); + testcase( op==TK_GE ); + testcase( op==TK_EQ ); + testcase( op==TK_NE ); + testcase( jumpIfNull==0 ); + codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, + pExpr->pRight, &r2, ®Free2); + codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, + r1, r2, dest, jumpIfNull); + testcase( regFree1==0 ); + testcase( regFree2==0 ); + break; + } + case TK_ISNULL: + case TK_NOTNULL: { + assert( TK_ISNULL==OP_IsNull ); + assert( TK_NOTNULL==OP_NotNull ); + testcase( op==TK_ISNULL ); + testcase( op==TK_NOTNULL ); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + sqlite3VdbeAddOp2(v, op, r1, dest); + testcase( regFree1==0 ); + break; + } + case TK_BETWEEN: { + /* x BETWEEN y AND z + ** + ** Is equivalent to + ** + ** x>=y AND x<=z + ** + ** Code it as such, taking care to do the common subexpression + ** elementation of x. + */ + Expr exprAnd; + Expr compLeft; + Expr compRight; + Expr exprX; + + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + exprX = *pExpr->pLeft; + exprAnd.op = TK_AND; + exprAnd.pLeft = &compLeft; + exprAnd.pRight = &compRight; + compLeft.op = TK_GE; + compLeft.pLeft = &exprX; + compLeft.pRight = pExpr->x.pList->a[0].pExpr; + compRight.op = TK_LE; + compRight.pLeft = &exprX; + compRight.pRight = pExpr->x.pList->a[1].pExpr; + exprX.iTable = sqlite3ExprCodeTemp(pParse, &exprX, ®Free1); + testcase( regFree1==0 ); + exprX.op = TK_REGISTER; + testcase( jumpIfNull==0 ); + sqlite3ExprIfTrue(pParse, &exprAnd, dest, jumpIfNull); + break; + } + default: { + r1 = sqlite3ExprCodeTemp(pParse, pExpr, ®Free1); + sqlite3VdbeAddOp3(v, OP_If, r1, dest, jumpIfNull!=0); + testcase( regFree1==0 ); + testcase( jumpIfNull==0 ); + break; + } + } + sqlite3ReleaseTempReg(pParse, regFree1); + sqlite3ReleaseTempReg(pParse, regFree2); +} + +/* +** Generate code for a boolean expression such that a jump is made +** to the label "dest" if the expression is false but execution +** continues straight thru if the expression is true. +** +** If the expression evaluates to NULL (neither true nor false) then +** jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull +** is 0. +*/ +void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ + Vdbe *v = pParse->pVdbe; + int op = 0; + int regFree1 = 0; + int regFree2 = 0; + int r1, r2; + + assert( jumpIfNull==SQLITE_JUMPIFNULL || jumpIfNull==0 ); + if( v==0 || pExpr==0 ) return; + + /* The value of pExpr->op and op are related as follows: + ** + ** pExpr->op op + ** --------- ---------- + ** TK_ISNULL OP_NotNull + ** TK_NOTNULL OP_IsNull + ** TK_NE OP_Eq + ** TK_EQ OP_Ne + ** TK_GT OP_Le + ** TK_LE OP_Gt + ** TK_GE OP_Lt + ** TK_LT OP_Ge + ** + ** For other values of pExpr->op, op is undefined and unused. + ** The value of TK_ and OP_ constants are arranged such that we + ** can compute the mapping above using the following expression. + ** Assert()s verify that the computation is correct. + */ + op = ((pExpr->op+(TK_ISNULL&1))^1)-(TK_ISNULL&1); + + /* Verify correct alignment of TK_ and OP_ constants + */ + assert( pExpr->op!=TK_ISNULL || op==OP_NotNull ); + assert( pExpr->op!=TK_NOTNULL || op==OP_IsNull ); + assert( pExpr->op!=TK_NE || op==OP_Eq ); + assert( pExpr->op!=TK_EQ || op==OP_Ne ); + assert( pExpr->op!=TK_LT || op==OP_Ge ); + assert( pExpr->op!=TK_LE || op==OP_Gt ); + assert( pExpr->op!=TK_GT || op==OP_Le ); + assert( pExpr->op!=TK_GE || op==OP_Lt ); + + switch( pExpr->op ){ + case TK_AND: { + testcase( jumpIfNull==0 ); + sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); + sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); + break; + } + case TK_OR: { + int d2 = sqlite3VdbeMakeLabel(v); + testcase( jumpIfNull==0 ); + sqlite3ExprCachePush(pParse); + sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, jumpIfNull^SQLITE_JUMPIFNULL); + sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); + sqlite3VdbeResolveLabel(v, d2); + sqlite3ExprCachePop(pParse, 1); + break; + } + case TK_NOT: { + sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); + break; + } + case TK_LT: + case TK_LE: + case TK_GT: + case TK_GE: + case TK_NE: + case TK_EQ: { + testcase( op==TK_LT ); + testcase( op==TK_LE ); + testcase( op==TK_GT ); + testcase( op==TK_GE ); + testcase( op==TK_EQ ); + testcase( op==TK_NE ); + testcase( jumpIfNull==0 ); + codeCompareOperands(pParse, pExpr->pLeft, &r1, ®Free1, + pExpr->pRight, &r2, ®Free2); + codeCompare(pParse, pExpr->pLeft, pExpr->pRight, op, + r1, r2, dest, jumpIfNull); + testcase( regFree1==0 ); + testcase( regFree2==0 ); + break; + } + case TK_ISNULL: + case TK_NOTNULL: { + testcase( op==TK_ISNULL ); + testcase( op==TK_NOTNULL ); + r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); + sqlite3VdbeAddOp2(v, op, r1, dest); + testcase( regFree1==0 ); + break; + } + case TK_BETWEEN: { + /* x BETWEEN y AND z + ** + ** Is equivalent to + ** + ** x>=y AND x<=z + ** + ** Code it as such, taking care to do the common subexpression + ** elementation of x. + */ + Expr exprAnd; + Expr compLeft; + Expr compRight; + Expr exprX; + + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + exprX = *pExpr->pLeft; + exprAnd.op = TK_AND; + exprAnd.pLeft = &compLeft; + exprAnd.pRight = &compRight; + compLeft.op = TK_GE; + compLeft.pLeft = &exprX; + compLeft.pRight = pExpr->x.pList->a[0].pExpr; + compRight.op = TK_LE; + compRight.pLeft = &exprX; + compRight.pRight = pExpr->x.pList->a[1].pExpr; + exprX.iTable = sqlite3ExprCodeTemp(pParse, &exprX, ®Free1); + testcase( regFree1==0 ); + exprX.op = TK_REGISTER; + testcase( jumpIfNull==0 ); + sqlite3ExprIfFalse(pParse, &exprAnd, dest, jumpIfNull); + break; + } + default: { + r1 = sqlite3ExprCodeTemp(pParse, pExpr, ®Free1); + sqlite3VdbeAddOp3(v, OP_IfNot, r1, dest, jumpIfNull!=0); + testcase( regFree1==0 ); + testcase( jumpIfNull==0 ); + break; + } + } + sqlite3ReleaseTempReg(pParse, regFree1); + sqlite3ReleaseTempReg(pParse, regFree2); +} + +/* +** Do a deep comparison of two expression trees. Return TRUE (non-zero) +** if they are identical and return FALSE if they differ in any way. +** +** Sometimes this routine will return FALSE even if the two expressions +** really are equivalent. If we cannot prove that the expressions are +** identical, we return FALSE just to be safe. So if this routine +** returns false, then you do not really know for certain if the two +** expressions are the same. But if you get a TRUE return, then you +** can be sure the expressions are the same. In the places where +** this routine is used, it does not hurt to get an extra FALSE - that +** just might result in some slightly slower code. But returning +** an incorrect TRUE could lead to a malfunction. +*/ +int sqlite3ExprCompare(Expr *pA, Expr *pB){ + int i; + if( pA==0||pB==0 ){ + return pB==pA; + } + if( ExprHasProperty(pA, EP_xIsSelect) || ExprHasProperty(pB, EP_xIsSelect) ){ + return 0; + } + if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 0; + if( pA->op!=pB->op ) return 0; + if( !sqlite3ExprCompare(pA->pLeft, pB->pLeft) ) return 0; + if( !sqlite3ExprCompare(pA->pRight, pB->pRight) ) return 0; + + if( pA->x.pList && pB->x.pList ){ + if( pA->x.pList->nExpr!=pB->x.pList->nExpr ) return 0; + for(i=0; ix.pList->nExpr; i++){ + Expr *pExprA = pA->x.pList->a[i].pExpr; + Expr *pExprB = pB->x.pList->a[i].pExpr; + if( !sqlite3ExprCompare(pExprA, pExprB) ) return 0; + } + }else if( pA->x.pList || pB->x.pList ){ + return 0; + } + + if( pA->iTable!=pB->iTable || pA->iColumn!=pB->iColumn ) return 0; + if( pA->op!=TK_COLUMN && pA->token.z ){ + if( pB->token.z==0 ) return 0; + if( pB->token.n!=pA->token.n ) return 0; + if( sqlite3StrNICmp((char*)pA->token.z,(char*)pB->token.z,pB->token.n)!=0 ){ + return 0; + } + } + return 1; +} + + +/* +** Add a new element to the pAggInfo->aCol[] array. Return the index of +** the new element. Return a negative number if malloc fails. +*/ +static int addAggInfoColumn(sqlite3 *db, AggInfo *pInfo){ + int i; + pInfo->aCol = sqlite3ArrayAllocate( + db, + pInfo->aCol, + sizeof(pInfo->aCol[0]), + 3, + &pInfo->nColumn, + &pInfo->nColumnAlloc, + &i + ); + return i; +} + +/* +** Add a new element to the pAggInfo->aFunc[] array. Return the index of +** the new element. Return a negative number if malloc fails. +*/ +static int addAggInfoFunc(sqlite3 *db, AggInfo *pInfo){ + int i; + pInfo->aFunc = sqlite3ArrayAllocate( + db, + pInfo->aFunc, + sizeof(pInfo->aFunc[0]), + 3, + &pInfo->nFunc, + &pInfo->nFuncAlloc, + &i + ); + return i; +} + +/* +** This is the xExprCallback for a tree walker. It is used to +** implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates +** for additional information. +*/ +static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ + int i; + NameContext *pNC = pWalker->u.pNC; + Parse *pParse = pNC->pParse; + SrcList *pSrcList = pNC->pSrcList; + AggInfo *pAggInfo = pNC->pAggInfo; + + switch( pExpr->op ){ + case TK_AGG_COLUMN: + case TK_COLUMN: { + testcase( pExpr->op==TK_AGG_COLUMN ); + testcase( pExpr->op==TK_COLUMN ); + /* Check to see if the column is in one of the tables in the FROM + ** clause of the aggregate query */ + if( pSrcList ){ + struct SrcList_item *pItem = pSrcList->a; + for(i=0; inSrc; i++, pItem++){ + struct AggInfo_col *pCol; + if( pExpr->iTable==pItem->iCursor ){ + /* If we reach this point, it means that pExpr refers to a table + ** that is in the FROM clause of the aggregate query. + ** + ** Make an entry for the column in pAggInfo->aCol[] if there + ** is not an entry there already. + */ + int k; + pCol = pAggInfo->aCol; + for(k=0; knColumn; k++, pCol++){ + if( pCol->iTable==pExpr->iTable && + pCol->iColumn==pExpr->iColumn ){ + break; + } + } + if( (k>=pAggInfo->nColumn) + && (k = addAggInfoColumn(pParse->db, pAggInfo))>=0 + ){ + pCol = &pAggInfo->aCol[k]; + pCol->pTab = pExpr->pTab; + pCol->iTable = pExpr->iTable; + pCol->iColumn = pExpr->iColumn; + pCol->iMem = ++pParse->nMem; + pCol->iSorterColumn = -1; + pCol->pExpr = pExpr; + if( pAggInfo->pGroupBy ){ + int j, n; + ExprList *pGB = pAggInfo->pGroupBy; + struct ExprList_item *pTerm = pGB->a; + n = pGB->nExpr; + for(j=0; jpExpr; + if( pE->op==TK_COLUMN && pE->iTable==pExpr->iTable && + pE->iColumn==pExpr->iColumn ){ + pCol->iSorterColumn = j; + break; + } + } + } + if( pCol->iSorterColumn<0 ){ + pCol->iSorterColumn = pAggInfo->nSortingColumn++; + } + } + /* There is now an entry for pExpr in pAggInfo->aCol[] (either + ** because it was there before or because we just created it). + ** Convert the pExpr to be a TK_AGG_COLUMN referring to that + ** pAggInfo->aCol[] entry. + */ + pExpr->pAggInfo = pAggInfo; + pExpr->op = TK_AGG_COLUMN; + pExpr->iAgg = k; + break; + } /* endif pExpr->iTable==pItem->iCursor */ + } /* end loop over pSrcList */ + } + return WRC_Prune; + } + case TK_AGG_FUNCTION: { + /* The pNC->nDepth==0 test causes aggregate functions in subqueries + ** to be ignored */ + if( pNC->nDepth==0 ){ + /* Check to see if pExpr is a duplicate of another aggregate + ** function that is already in the pAggInfo structure + */ + struct AggInfo_func *pItem = pAggInfo->aFunc; + for(i=0; inFunc; i++, pItem++){ + if( sqlite3ExprCompare(pItem->pExpr, pExpr) ){ + break; + } + } + if( i>=pAggInfo->nFunc ){ + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + u8 enc = ENC(pParse->db); + i = addAggInfoFunc(pParse->db, pAggInfo); + if( i>=0 ){ + assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); + pItem = &pAggInfo->aFunc[i]; + pItem->pExpr = pExpr; + pItem->iMem = ++pParse->nMem; + pItem->pFunc = sqlite3FindFunction(pParse->db, + (char*)pExpr->token.z, pExpr->token.n, + pExpr->x.pList ? pExpr->x.pList->nExpr : 0, enc, 0); + if( pExpr->flags & EP_Distinct ){ + pItem->iDistinct = pParse->nTab++; + }else{ + pItem->iDistinct = -1; + } + } + } + /* Make pExpr point to the appropriate pAggInfo->aFunc[] entry + */ + pExpr->iAgg = i; + pExpr->pAggInfo = pAggInfo; + return WRC_Prune; + } + } + } + return WRC_Continue; +} +static int analyzeAggregatesInSelect(Walker *pWalker, Select *pSelect){ + NameContext *pNC = pWalker->u.pNC; + if( pNC->nDepth==0 ){ + pNC->nDepth++; + sqlite3WalkSelect(pWalker, pSelect); + pNC->nDepth--; + return WRC_Prune; + }else{ + return WRC_Continue; + } +} + +/* +** Analyze the given expression looking for aggregate functions and +** for variables that need to be added to the pParse->aAgg[] array. +** Make additional entries to the pParse->aAgg[] array as necessary. +** +** This routine should only be called after the expression has been +** analyzed by sqlite3ResolveExprNames(). +*/ +void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){ + Walker w; + w.xExprCallback = analyzeAggregate; + w.xSelectCallback = analyzeAggregatesInSelect; + w.u.pNC = pNC; + sqlite3WalkExpr(&w, pExpr); +} + +/* +** Call sqlite3ExprAnalyzeAggregates() for every expression in an +** expression list. Return the number of errors. +** +** If an error is found, the analysis is cut short. +*/ +void sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList){ + struct ExprList_item *pItem; + int i; + if( pList ){ + for(pItem=pList->a, i=0; inExpr; i++, pItem++){ + sqlite3ExprAnalyzeAggregates(pNC, pItem->pExpr); + } + } +} + +/* +** Allocate a single new register for use to hold some intermediate result. +*/ +int sqlite3GetTempReg(Parse *pParse){ + if( pParse->nTempReg==0 ){ + return ++pParse->nMem; + } + return pParse->aTempReg[--pParse->nTempReg]; +} + +/* +** Deallocate a register, making available for reuse for some other +** purpose. +** +** If a register is currently being used by the column cache, then +** the dallocation is deferred until the column cache line that uses +** the register becomes stale. +*/ +void sqlite3ReleaseTempReg(Parse *pParse, int iReg){ + if( iReg && pParse->nTempRegaTempReg) ){ + int i; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg==iReg ){ + p->tempReg = 1; + return; + } + } + pParse->aTempReg[pParse->nTempReg++] = iReg; + } +} + +/* +** Allocate or deallocate a block of nReg consecutive registers +*/ +int sqlite3GetTempRange(Parse *pParse, int nReg){ + int i, n; + i = pParse->iRangeReg; + n = pParse->nRangeReg; + if( nReg<=n && !usedAsColumnCache(pParse, i, i+n-1) ){ + pParse->iRangeReg += nReg; + pParse->nRangeReg -= nReg; + }else{ + i = pParse->nMem+1; + pParse->nMem += nReg; + } + return i; +} +void sqlite3ReleaseTempRange(Parse *pParse, int iReg, int nReg){ + if( nReg>pParse->nRangeReg ){ + pParse->nRangeReg = nReg; + pParse->iRangeReg = iReg; + } +} diff --git a/src/.#main.c.1.546 b/src/.#main.c.1.546 new file mode 100644 index 0000000..91b93b9 --- /dev/null +++ b/src/.#main.c.1.546 @@ -0,0 +1,2200 @@ +/* +** 2001 September 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. +** +************************************************************************* +** 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: main.c,v 1.546 2009/05/03 20:23:53 drh Exp $ +*/ +#include "sqliteInt.h" + +#ifdef SQLITE_ENABLE_FTS3 +# include "fts3.h" +#endif +#ifdef SQLITE_ENABLE_RTREE +# include "rtree.h" +#endif +#ifdef SQLITE_ENABLE_ICU +# include "sqliteicu.h" +#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) +/* +** If the following function pointer is not NULL and if +** SQLITE_ENABLE_IOTRACE is enabled, then messages describing +** I/O active are written using this function. These messages +** are intended for debugging activity only. +*/ +void (*sqlite3IoTrace)(const char*, ...) = 0; +#endif + +/* +** If the following global variable points to a string which is the +** name of a directory, then that directory will be used to store +** temporary files. +** +** See also the "PRAGMA temp_store_directory" SQL command. +*/ +char *sqlite3_temp_directory = 0; + +/* +** Initialize SQLite. +** +** This routine must be called to initialize the memory allocation, +** VFS, and mutex subsystems prior to doing any serious work with +** SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT +** this routine will be called automatically by key routines such as +** sqlite3_open(). +** +** This routine is a no-op except on its very first call for the process, +** or for the first call after a call to sqlite3_shutdown. +** +** The first thread to call this routine runs the initialization to +** completion. If subsequent threads call this routine before the first +** thread has finished the initialization process, then the subsequent +** threads must block until the first thread finishes with the initialization. +** +** The first thread might call this routine recursively. Recursive +** calls to this routine should not block, of course. Otherwise the +** initialization process would never complete. +** +** Let X be the first thread to enter this routine. Let Y be some other +** thread. Then while the initial invocation of this routine by X is +** incomplete, it is required that: +** +** * Calls to this routine from Y must block until the outer-most +** call by X completes. +** +** * Recursive calls to this routine from thread X return immediately +** without blocking. +*/ +int sqlite3_initialize(void){ + sqlite3_mutex *pMaster; /* The main static mutex */ + int rc; /* Result code */ + +#ifdef SQLITE_OMIT_WSD + rc = sqlite3_wsd_init(4096, 24); + if( rc!=SQLITE_OK ){ + return rc; + } +#endif + + /* If SQLite is already completely initialized, then this call + ** to sqlite3_initialize() should be a no-op. But the initialization + ** must be complete. So isInit must not be set until the very end + ** of this routine. + */ + if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; + + /* Make sure the mutex subsystem is initialized. If unable to + ** initialize the mutex subsystem, return early with the error. + ** If the system is so sick that we are unable to allocate a mutex, + ** there is not much SQLite is going to be able to do. + ** + ** The mutex subsystem must take care of serializing its own + ** initialization. + */ + rc = sqlite3MutexInit(); + if( rc ) return rc; + + /* Initialize the malloc() system and the recursive pInitMutex mutex. + ** This operation is protected by the STATIC_MASTER mutex. Note that + ** MutexAlloc() is called for a static mutex prior to initializing the + ** malloc subsystem - this implies that the allocation of a static + ** mutex must not require support from the malloc subsystem. + */ + pMaster = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER); + sqlite3_mutex_enter(pMaster); + if( !sqlite3GlobalConfig.isMallocInit ){ + rc = sqlite3MallocInit(); + } + if( rc==SQLITE_OK ){ + sqlite3GlobalConfig.isMallocInit = 1; + if( !sqlite3GlobalConfig.pInitMutex ){ + sqlite3GlobalConfig.pInitMutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE); + if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){ + rc = SQLITE_NOMEM; + } + } + } + if( rc==SQLITE_OK ){ + sqlite3GlobalConfig.nRefInitMutex++; + } + sqlite3_mutex_leave(pMaster); + + /* If unable to initialize the malloc subsystem, then return early. + ** There is little hope of getting SQLite to run if the malloc + ** subsystem cannot be initialized. + */ + if( rc!=SQLITE_OK ){ + return rc; + } + + /* Do the rest of the initialization under the recursive mutex so + ** that we will be able to handle recursive calls into + ** sqlite3_initialize(). The recursive calls normally come through + ** sqlite3_os_init() when it invokes sqlite3_vfs_register(), but other + ** recursive calls might also be possible. + */ + sqlite3_mutex_enter(sqlite3GlobalConfig.pInitMutex); + if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){ + FuncDefHash *pHash = &GLOBAL(FuncDefHash, sqlite3GlobalFunctions); + sqlite3GlobalConfig.inProgress = 1; + memset(pHash, 0, sizeof(sqlite3GlobalFunctions)); + sqlite3RegisterGlobalFunctions(); + rc = sqlite3PcacheInitialize(); + if( rc==SQLITE_OK ){ + rc = sqlite3_os_init(); + } + if( rc==SQLITE_OK ){ + sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, + sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage); + sqlite3GlobalConfig.isInit = 1; + } + sqlite3GlobalConfig.inProgress = 0; + } + sqlite3_mutex_leave(sqlite3GlobalConfig.pInitMutex); + + /* Go back under the static mutex and clean up the recursive + ** mutex to prevent a resource leak. + */ + sqlite3_mutex_enter(pMaster); + sqlite3GlobalConfig.nRefInitMutex--; + if( sqlite3GlobalConfig.nRefInitMutex<=0 ){ + assert( sqlite3GlobalConfig.nRefInitMutex==0 ); + sqlite3_mutex_free(sqlite3GlobalConfig.pInitMutex); + sqlite3GlobalConfig.pInitMutex = 0; + } + sqlite3_mutex_leave(pMaster); + + /* The following is just a sanity check to make sure SQLite has + ** 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; +} + +/* +** Undo the effects of sqlite3_initialize(). Must not be called while +** there are outstanding database connections or memory allocations or +** while any part of SQLite is otherwise in use in any thread. This +** routine is not threadsafe. But it is safe to invoke this routine +** on when SQLite is already shut down. If SQLite is already shut down +** when this routine is invoked, then this routine is a harmless no-op. +*/ +int sqlite3_shutdown(void){ + if( sqlite3GlobalConfig.isInit ){ + sqlite3GlobalConfig.isMallocInit = 0; + sqlite3PcacheShutdown(); + sqlite3_os_end(); + sqlite3_reset_auto_extension(); + sqlite3MallocEnd(); + sqlite3MutexEnd(); + sqlite3GlobalConfig.isInit = 0; + } + return SQLITE_OK; +} + +/* +** This API allows applications to modify the global configuration of +** the SQLite library at run-time. +** +** This routine should only be called when there are no outstanding +** database connections or memory allocations. This routine is not +** threadsafe. Failure to heed these warnings can lead to unpredictable +** behavior. +*/ +int sqlite3_config(int op, ...){ + va_list ap; + int rc = SQLITE_OK; + + /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while + ** the SQLite library is in use. */ + if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE; + + va_start(ap, op); + switch( op ){ + + /* Mutex configuration options are only available in a threadsafe + ** compile. + */ +#if SQLITE_THREADSAFE + case SQLITE_CONFIG_SINGLETHREAD: { + /* Disable all mutexing */ + sqlite3GlobalConfig.bCoreMutex = 0; + sqlite3GlobalConfig.bFullMutex = 0; + break; + } + case SQLITE_CONFIG_MULTITHREAD: { + /* Disable mutexing of database connections */ + /* Enable mutexing of core data structures */ + sqlite3GlobalConfig.bCoreMutex = 1; + sqlite3GlobalConfig.bFullMutex = 0; + break; + } + case SQLITE_CONFIG_SERIALIZED: { + /* Enable all mutexing */ + sqlite3GlobalConfig.bCoreMutex = 1; + sqlite3GlobalConfig.bFullMutex = 1; + break; + } + case SQLITE_CONFIG_MUTEX: { + /* Specify an alternative mutex implementation */ + sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*); + break; + } + case SQLITE_CONFIG_GETMUTEX: { + /* Retrieve the current mutex implementation */ + *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex; + break; + } +#endif + + + case SQLITE_CONFIG_MALLOC: { + /* Specify an alternative malloc implementation */ + sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*); + break; + } + case SQLITE_CONFIG_GETMALLOC: { + /* Retrieve the current malloc() implementation */ + if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault(); + *va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m; + break; + } + case SQLITE_CONFIG_MEMSTATUS: { + /* Enable or disable the malloc status collection */ + sqlite3GlobalConfig.bMemstat = va_arg(ap, int); + break; + } + case SQLITE_CONFIG_SCRATCH: { + /* Designate a buffer for scratch memory space */ + sqlite3GlobalConfig.pScratch = va_arg(ap, void*); + sqlite3GlobalConfig.szScratch = va_arg(ap, int); + sqlite3GlobalConfig.nScratch = va_arg(ap, int); + break; + } + case SQLITE_CONFIG_PAGECACHE: { + /* Designate a buffer for scratch memory space */ + sqlite3GlobalConfig.pPage = va_arg(ap, void*); + 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); + sqlite3GlobalConfig.mnReq = va_arg(ap, int); + + if( sqlite3GlobalConfig.pHeap==0 ){ + /* If the heap pointer is NULL, then restore the malloc implementation + ** back to NULL pointers too. This will cause the malloc to go + ** back to its default implementation when sqlite3_initialize() is + ** run. + */ + memset(&sqlite3GlobalConfig.m, 0, sizeof(sqlite3GlobalConfig.m)); + }else{ + /* The heap pointer is not NULL, then install one of the + ** mem5.c/mem3.c methods. If neither ENABLE_MEMSYS3 nor + ** ENABLE_MEMSYS5 is defined, return an error. + ** the default case and return an error. + */ +#ifdef SQLITE_ENABLE_MEMSYS3 + sqlite3GlobalConfig.m = *sqlite3MemGetMemsys3(); +#endif +#ifdef SQLITE_ENABLE_MEMSYS5 + sqlite3GlobalConfig.m = *sqlite3MemGetMemsys5(); +#endif + } + break; + } +#endif + + case SQLITE_CONFIG_LOOKASIDE: { + sqlite3GlobalConfig.szLookaside = va_arg(ap, int); + sqlite3GlobalConfig.nLookaside = va_arg(ap, int); + break; + } + + default: { + rc = SQLITE_ERROR; + break; + } + } + va_end(ap); + return rc; +} + +/* +** Set up the lookaside buffers for a database connection. +** Return SQLITE_OK on success. +** If lookaside is already active, return SQLITE_BUSY. +** +** The sz parameter is the number of bytes in each lookaside slot. +** The cnt parameter is the number of slots. If pStart is NULL the +** space for the lookaside memory is obtained from sqlite3_malloc(). +** If pStart is not NULL then it is sz*cnt bytes of memory to use for +** the lookaside memory. +*/ +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( cnt<0 ) cnt = 0; + if( sz==0 || cnt==0 ){ + sz = 0; + pStart = 0; + }else if( pBuf==0 ){ + sz = ROUND8(sz); + sqlite3BeginBenignMalloc(); + pStart = sqlite3Malloc( sz*cnt ); + sqlite3EndBenignMalloc(); + }else{ + sz = ROUNDDOWN8(sz); + pStart = pBuf; + } + db->lookaside.pStart = pStart; + db->lookaside.pFree = 0; + db->lookaside.sz = (u16)sz; + if( pStart ){ + int i; + LookasideSlot *p; + assert( sz > (int)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; + int rc; + va_start(ap, op); + switch( op ){ + case SQLITE_DBCONFIG_LOOKASIDE: { + void *pBuf = va_arg(ap, void*); + int sz = va_arg(ap, int); + int cnt = va_arg(ap, int); + rc = setupLookaside(db, pBuf, sz, cnt); + break; + } + default: { + rc = SQLITE_ERROR; + break; + } + } + va_end(ap); + return rc; +} + + +/* +** Return true if the buffer z[0..n-1] contains all spaces. +*/ +static int allSpaces(const char *z, int n){ + while( n>0 && z[n-1]==' ' ){ n--; } + return n==0; +} + +/* +** This is the default collating function named "BINARY" which is always +** available. +** +** If the padFlag argument is not NULL then space padding at the end +** of strings is ignored. This implements the RTRIM collation. +*/ +static int binCollFunc( + void *padFlag, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + int rc, n; + n = nKey1lastRowid; +} + +/* +** Return the number of changes in the most recent call to sqlite3_exec(). +*/ +int sqlite3_changes(sqlite3 *db){ + return db->nChange; +} + +/* +** Return the number of changes since the database handle was opened. +*/ +int sqlite3_total_changes(sqlite3 *db){ + return db->nTotalChange; +} + +/* +** 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->nStatement = 0; + db->isTransactionSavepoint = 0; +} + +/* +** Close an existing SQLite database +*/ +int sqlite3_close(sqlite3 *db){ + HashElem *i; + int j; + + if( !db ){ + return SQLITE_OK; + } + if( !sqlite3SafetyCheckSickOrOk(db) ){ + return SQLITE_MISUSE; + } + sqlite3_mutex_enter(db->mutex); + +#ifdef SQLITE_SSE + { + extern void sqlite3SseCleanup(sqlite3*); + sqlite3SseCleanup(db); + } +#endif + + sqlite3ResetInternalSchema(db, 0); + + /* If a transaction is open, the ResetInternalSchema() call above + ** will not have called the xDisconnect() method on any virtual + ** tables in the db->aVTrans[] array. The following sqlite3VtabRollback() + ** call will do so. We need to do this before the check for active + ** SQL statements below, as the v-table implementation may be storing + ** some prepared statements internally. + */ + 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"); + 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; + if( j!=1 ){ + pDb->pSchema = 0; + } + } + } + sqlite3ResetInternalSchema(db, 0); + + /* Tell the code in notify.c that the connection no longer holds any + ** locks and does not require any further unlock-notify callbacks. + */ + sqlite3ConnectionClosed(db); + + assert( db->nDb<=2 ); + assert( db->aDb==db->aDbStatic ); + for(j=0; jaFunc.a); j++){ + FuncDef *pNext, *pHash, *p; + for(p=db->aFunc.a[j]; p; p=pHash){ + pHash = p->pHash; + while( p ){ + pNext = p->pNext; + sqlite3DbFree(db, p); + p = pNext; + } + } + } + for(i=sqliteHashFirst(&db->aCollSeq); i; i=sqliteHashNext(i)){ + CollSeq *pColl = (CollSeq *)sqliteHashData(i); + /* Invoke any destructors registered for collation sequence user data. */ + for(j=0; j<3; j++){ + if( pColl[j].xDel ){ + pColl[j].xDel(pColl[j].pUser); + } + } + sqlite3DbFree(db, pColl); + } + sqlite3HashClear(&db->aCollSeq); +#ifndef SQLITE_OMIT_VIRTUALTABLE + for(i=sqliteHashFirst(&db->aModule); i; i=sqliteHashNext(i)){ + Module *pMod = (Module *)sqliteHashData(i); + if( pMod->xDestroy ){ + pMod->xDestroy(pMod->pAux); + } + sqlite3DbFree(db, pMod); + } + sqlite3HashClear(&db->aModule); +#endif + + sqlite3Error(db, SQLITE_OK, 0); /* Deallocates any cached error strings. */ + if( db->pErr ){ + sqlite3ValueFree(db->pErr); + } + sqlite3CloseExtensions(db); + + db->magic = SQLITE_MAGIC_ERROR; + + /* The temp-database schema is allocated differently from the other schema + ** objects (using sqliteMalloc() directly, instead of sqlite3BtreeSchema()). + ** So it needs to be freed here. Todo: Why not roll the temp schema into + ** the same sqliteMalloc() as the one that allocates the database + ** structure? + */ + sqlite3DbFree(db, db->aDb[1].pSchema); + sqlite3_mutex_leave(db->mutex); + db->magic = SQLITE_MAGIC_CLOSED; + sqlite3_mutex_free(db->mutex); + assert( db->lookaside.nOut==0 ); /* Fails on a lookaside memory leak */ + if( db->lookaside.bMalloced ){ + sqlite3_free(db->lookaside.pStart); + } + sqlite3_free(db); + return SQLITE_OK; +} + +/* +** Rollback all database files. +*/ +void sqlite3RollbackAll(sqlite3 *db){ + int i; + int inTrans = 0; + assert( sqlite3_mutex_held(db->mutex) ); + sqlite3BeginBenignMalloc(); + for(i=0; inDb; i++){ + if( db->aDb[i].pBt ){ + if( sqlite3BtreeIsInTrans(db->aDb[i].pBt) ){ + inTrans = 1; + } + sqlite3BtreeRollback(db->aDb[i].pBt); + db->aDb[i].inTrans = 0; + } + } + sqlite3VtabRollback(db); + sqlite3EndBenignMalloc(); + + if( db->flags&SQLITE_InternChanges ){ + sqlite3ExpirePreparedStatements(db); + sqlite3ResetInternalSchema(db, 0); + } + + /* If one has been configured, invoke the rollback-hook callback */ + if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){ + db->xRollbackCallback(db->pRollbackArg); + } +} + +/* +** Return a static string that describes the kind of error specified in the +** argument. +*/ +const char *sqlite3ErrStr(int rc){ + static const char* const aMsg[] = { + /* SQLITE_OK */ "not an error", + /* SQLITE_ERROR */ "SQL logic error or missing database", + /* SQLITE_INTERNAL */ 0, + /* SQLITE_PERM */ "access permission denied", + /* SQLITE_ABORT */ "callback requested query abort", + /* SQLITE_BUSY */ "database is locked", + /* SQLITE_LOCKED */ "database table is locked", + /* SQLITE_NOMEM */ "out of memory", + /* SQLITE_READONLY */ "attempt to write a readonly database", + /* SQLITE_INTERRUPT */ "interrupted", + /* SQLITE_IOERR */ "disk I/O error", + /* SQLITE_CORRUPT */ "database disk image is malformed", + /* SQLITE_NOTFOUND */ 0, + /* SQLITE_FULL */ "database or disk is full", + /* SQLITE_CANTOPEN */ "unable to open database file", + /* SQLITE_PROTOCOL */ 0, + /* SQLITE_EMPTY */ "table contains no data", + /* SQLITE_SCHEMA */ "database schema has changed", + /* SQLITE_TOOBIG */ "String or BLOB exceeded size limit", + /* SQLITE_CONSTRAINT */ "constraint failed", + /* SQLITE_MISMATCH */ "datatype mismatch", + /* SQLITE_MISUSE */ "library routine called out of sequence", + /* SQLITE_NOLFS */ "large file support is disabled", + /* SQLITE_AUTH */ "authorization denied", + /* SQLITE_FORMAT */ "auxiliary database format error", + /* SQLITE_RANGE */ "bind or column index out of range", + /* SQLITE_NOTADB */ "file is encrypted or is not a database", + }; + rc &= 0xff; + if( ALWAYS(rc>=0) && rc<(int)(sizeof(aMsg)/sizeof(aMsg[0])) && aMsg[rc]!=0 ){ + return aMsg[rc]; + }else{ + return "unknown error"; + } +} + +/* +** This routine implements a busy callback that sleeps and tries +** again until a timeout value is reached. The timeout value is +** an integer number of milliseconds passed in as the first +** argument. +*/ +static int sqliteDefaultBusyCallback( + void *ptr, /* Database connection */ + int count /* Number of times table has been busy */ +){ +#if SQLITE_OS_WIN || (defined(HAVE_USLEEP) && HAVE_USLEEP) + static const u8 delays[] = + { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; + static const u8 totals[] = + { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; +# define NDELAY (sizeof(delays)/sizeof(delays[0])) + sqlite3 *db = (sqlite3 *)ptr; + int timeout = db->busyTimeout; + int delay, prior; + + assert( count>=0 ); + if( count < NDELAY ){ + delay = delays[count]; + prior = totals[count]; + }else{ + delay = delays[NDELAY-1]; + prior = totals[NDELAY-1] + delay*(count-(NDELAY-1)); + } + if( prior + delay > timeout ){ + delay = timeout - prior; + if( delay<=0 ) return 0; + } + sqlite3OsSleep(db->pVfs, delay*1000); + return 1; +#else + sqlite3 *db = (sqlite3 *)ptr; + int timeout = ((sqlite3 *)ptr)->busyTimeout; + if( (count+1)*1000 > timeout ){ + return 0; + } + sqlite3OsSleep(db->pVfs, 1000000); + return 1; +#endif +} + +/* +** Invoke the given busy handler. +** +** This routine is called when an operation failed with a lock. +** If this routine returns non-zero, the lock is retried. If it +** returns 0, the operation aborts with an SQLITE_BUSY error. +*/ +int sqlite3InvokeBusyHandler(BusyHandler *p){ + int rc; + if( NEVER(p==0) || p->xFunc==0 || p->nBusy<0 ) return 0; + rc = p->xFunc(p->pArg, p->nBusy); + if( rc==0 ){ + p->nBusy = -1; + }else{ + p->nBusy++; + } + return rc; +} + +/* +** This routine sets the busy callback for an Sqlite database to the +** given callback function with the given argument. +*/ +int sqlite3_busy_handler( + sqlite3 *db, + int (*xBusy)(void*,int), + void *pArg +){ + sqlite3_mutex_enter(db->mutex); + db->busyHandler.xFunc = xBusy; + db->busyHandler.pArg = pArg; + db->busyHandler.nBusy = 0; + sqlite3_mutex_leave(db->mutex); + return SQLITE_OK; +} + +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK +/* +** This routine sets the progress callback for an Sqlite database to the +** given callback function with the given argument. The progress callback will +** be invoked every nOps opcodes. +*/ +void sqlite3_progress_handler( + sqlite3 *db, + int nOps, + int (*xProgress)(void*), + void *pArg +){ + sqlite3_mutex_enter(db->mutex); + if( nOps>0 ){ + db->xProgress = xProgress; + db->nProgressOps = nOps; + db->pProgressArg = pArg; + }else{ + db->xProgress = 0; + db->nProgressOps = 0; + db->pProgressArg = 0; + } + sqlite3_mutex_leave(db->mutex); +} +#endif + + +/* +** This routine installs a default busy handler that waits for the +** specified number of milliseconds before returning 0. +*/ +int sqlite3_busy_timeout(sqlite3 *db, int ms){ + if( ms>0 ){ + db->busyTimeout = ms; + sqlite3_busy_handler(db, sqliteDefaultBusyCallback, (void*)db); + }else{ + sqlite3_busy_handler(db, 0, 0); + } + return SQLITE_OK; +} + +/* +** Cause any pending operation to stop at its earliest opportunity. +*/ +void sqlite3_interrupt(sqlite3 *db){ + db->u1.isInterrupted = 1; +} + + +/* +** This function is exactly the same as sqlite3_create_function(), except +** that it is designed to be called by internal code. The difference is +** that if a malloc() fails in sqlite3_create_function(), an error code +** is returned and the mallocFailed flag cleared. +*/ +int sqlite3CreateFunc( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int enc, + void *pUserData, + void (*xFunc)(sqlite3_context*,int,sqlite3_value **), + void (*xStep)(sqlite3_context*,int,sqlite3_value **), + void (*xFinal)(sqlite3_context*) +){ + FuncDef *p; + int nName; + + assert( sqlite3_mutex_held(db->mutex) ); + if( zFunctionName==0 || + (xFunc && (xFinal || xStep)) || + (!xFunc && (xFinal && !xStep)) || + (!xFunc && (!xFinal && xStep)) || + (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || + (255<(nName = sqlite3Strlen30( zFunctionName))) ){ + sqlite3Error(db, SQLITE_ERROR, "bad parameters"); + return SQLITE_ERROR; + } + +#ifndef SQLITE_OMIT_UTF16 + /* If SQLITE_UTF16 is specified as the encoding type, transform this + ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the + ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. + ** + ** If SQLITE_ANY is specified, add three versions of the function + ** to the hash table. + */ + if( enc==SQLITE_UTF16 ){ + enc = SQLITE_UTF16NATIVE; + }else if( enc==SQLITE_ANY ){ + int rc; + rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF8, + pUserData, xFunc, xStep, xFinal); + if( rc==SQLITE_OK ){ + rc = sqlite3CreateFunc(db, zFunctionName, nArg, SQLITE_UTF16LE, + pUserData, xFunc, xStep, xFinal); + } + if( rc!=SQLITE_OK ){ + return rc; + } + enc = SQLITE_UTF16BE; + } +#else + enc = SQLITE_UTF8; +#endif + + /* 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); + 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"); + assert( !db->mallocFailed ); + return SQLITE_BUSY; + }else{ + sqlite3ExpirePreparedStatements(db); + } + } + + p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)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; + return SQLITE_OK; +} + +/* +** Create new user functions. +*/ +int sqlite3_create_function( + sqlite3 *db, + const char *zFunctionName, + int nArg, + int enc, + void *p, + void (*xFunc)(sqlite3_context*,int,sqlite3_value **), + void (*xStep)(sqlite3_context*,int,sqlite3_value **), + void (*xFinal)(sqlite3_context*) +){ + int rc; + sqlite3_mutex_enter(db->mutex); + rc = sqlite3CreateFunc(db, zFunctionName, nArg, enc, p, xFunc, xStep, xFinal); + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +} + +#ifndef SQLITE_OMIT_UTF16 +int sqlite3_create_function16( + sqlite3 *db, + const void *zFunctionName, + int nArg, + int eTextRep, + void *p, + void (*xFunc)(sqlite3_context*,int,sqlite3_value**), + void (*xStep)(sqlite3_context*,int,sqlite3_value**), + void (*xFinal)(sqlite3_context*) +){ + int rc; + char *zFunc8; + sqlite3_mutex_enter(db->mutex); + assert( !db->mallocFailed ); + zFunc8 = sqlite3Utf16to8(db, zFunctionName, -1); + rc = sqlite3CreateFunc(db, zFunc8, nArg, eTextRep, p, xFunc, xStep, xFinal); + sqlite3DbFree(db, zFunc8); + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +} +#endif + + +/* +** Declare that a function has been overloaded by a virtual table. +** +** If the function already exists as a regular global function, then +** this routine is a no-op. If the function does not exist, then create +** a new one that always throws a run-time error. +** +** When virtual tables intend to provide an overloaded function, they +** should call this routine to make sure the global function exists. +** A global function must exist in order for name resolution to work +** properly. +*/ +int sqlite3_overload_function( + sqlite3 *db, + const char *zName, + int nArg +){ + int nName = sqlite3Strlen30(zName); + int rc; + sqlite3_mutex_enter(db->mutex); + if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){ + sqlite3CreateFunc(db, zName, nArg, SQLITE_UTF8, + 0, sqlite3InvalidFunction, 0, 0); + } + rc = sqlite3ApiExit(db, SQLITE_OK); + sqlite3_mutex_leave(db->mutex); + return rc; +} + +#ifndef SQLITE_OMIT_TRACE +/* +** Register a trace function. The pArg from the previously registered trace +** is returned. +** +** A NULL trace function means that no tracing is executes. A non-NULL +** trace is a pointer to a function that is invoked at the start of each +** SQL statement. +*/ +void *sqlite3_trace(sqlite3 *db, void (*xTrace)(void*,const char*), void *pArg){ + void *pOld; + sqlite3_mutex_enter(db->mutex); + pOld = db->pTraceArg; + db->xTrace = xTrace; + db->pTraceArg = pArg; + sqlite3_mutex_leave(db->mutex); + return pOld; +} +/* +** Register a profile function. The pArg from the previously registered +** profile function is returned. +** +** A NULL profile function means that no profiling is executes. A non-NULL +** profile is a pointer to a function that is invoked at the conclusion of +** each SQL statement that is run. +*/ +void *sqlite3_profile( + sqlite3 *db, + void (*xProfile)(void*,const char*,sqlite_uint64), + void *pArg +){ + void *pOld; + sqlite3_mutex_enter(db->mutex); + pOld = db->pProfileArg; + db->xProfile = xProfile; + db->pProfileArg = pArg; + sqlite3_mutex_leave(db->mutex); + return pOld; +} +#endif /* SQLITE_OMIT_TRACE */ + +/*** EXPERIMENTAL *** +** +** Register a function to be invoked when a transaction comments. +** If the invoked function returns non-zero, then the commit becomes a +** rollback. +*/ +void *sqlite3_commit_hook( + sqlite3 *db, /* Attach the hook to this database */ + int (*xCallback)(void*), /* Function to invoke on each commit */ + void *pArg /* Argument to the function */ +){ + void *pOld; + sqlite3_mutex_enter(db->mutex); + pOld = db->pCommitArg; + db->xCommitCallback = xCallback; + db->pCommitArg = pArg; + sqlite3_mutex_leave(db->mutex); + return pOld; +} + +/* +** Register a callback to be invoked each time a row is updated, +** inserted or deleted using this database connection. +*/ +void *sqlite3_update_hook( + sqlite3 *db, /* Attach the hook to this database */ + void (*xCallback)(void*,int,char const *,char const *,sqlite_int64), + void *pArg /* Argument to the function */ +){ + void *pRet; + sqlite3_mutex_enter(db->mutex); + pRet = db->pUpdateArg; + db->xUpdateCallback = xCallback; + db->pUpdateArg = pArg; + sqlite3_mutex_leave(db->mutex); + return pRet; +} + +/* +** Register a callback to be invoked each time a transaction is rolled +** back by this database connection. +*/ +void *sqlite3_rollback_hook( + sqlite3 *db, /* Attach the hook to this database */ + void (*xCallback)(void*), /* Callback function */ + void *pArg /* Argument to the function */ +){ + void *pRet; + sqlite3_mutex_enter(db->mutex); + pRet = db->pRollbackArg; + db->xRollbackCallback = xCallback; + db->pRollbackArg = pArg; + sqlite3_mutex_leave(db->mutex); + return pRet; +} + +/* +** This function returns true if main-memory should be used instead of +** a temporary file for transient pager files and statement journals. +** The value returned depends on the value of db->temp_store (runtime +** parameter) and the compile time value of SQLITE_TEMP_STORE. The +** following table describes the relationship between these two values +** and this functions return value. +** +** SQLITE_TEMP_STORE db->temp_store Location of temporary database +** ----------------- -------------- ------------------------------ +** 0 any file (return 0) +** 1 1 file (return 0) +** 1 2 memory (return 1) +** 1 0 file (return 0) +** 2 1 file (return 0) +** 2 2 memory (return 1) +** 2 0 memory (return 1) +** 3 any memory (return 1) +*/ +int sqlite3TempInMemory(const sqlite3 *db){ +#if SQLITE_TEMP_STORE==1 + return ( db->temp_store==2 ); +#endif +#if SQLITE_TEMP_STORE==2 + return ( db->temp_store!=1 ); +#endif +#if SQLITE_TEMP_STORE==3 + return 1; +#endif + return 0; +} + +/* +** This routine is called to create a connection to a database BTree +** driver. If zFilename is the name of a file, then that file is +** opened and used. If zFilename is the magic name ":memory:" then +** the database is stored in memory (and is thus forgotten as soon as +** the connection is closed.) If zFilename is NULL then the database +** is a "virtual" database for transient use only and is deleted as +** soon as the connection is closed. +** +** A virtual database can be either a disk file (that is automatically +** deleted when the file is closed) or it an be held entirely in memory. +** The sqlite3TempInMemory() function is used to determine which. +*/ +int sqlite3BtreeFactory( + const sqlite3 *db, /* Main database when opening aux otherwise 0 */ + const char *zFilename, /* Name of the file containing the BTree database */ + int omitJournal, /* if TRUE then do not journal this file */ + int nCache, /* How many pages in the page cache */ + int vfsFlags, /* Flags passed through to vfsOpen */ + Btree **ppBtree /* Pointer to new Btree object written here */ +){ + int btFlags = 0; + int rc; + + assert( sqlite3_mutex_held(db->mutex) ); + assert( ppBtree != 0); + if( omitJournal ){ + btFlags |= BTREE_OMIT_JOURNAL; + } + if( db->flags & SQLITE_NoReadlock ){ + btFlags |= BTREE_NO_READLOCK; + } +#ifndef SQLITE_OMIT_MEMORYDB + if( zFilename==0 && sqlite3TempInMemory(db) ){ + zFilename = ":memory:"; + } +#endif + + if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (zFilename==0 || *zFilename==0) ){ + vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; + } + rc = sqlite3BtreeOpen(zFilename, (sqlite3 *)db, ppBtree, btFlags, vfsFlags); + + /* If the B-Tree was successfully opened, set the pager-cache size to the + ** default value. Except, if the call to BtreeOpen() returned a handle + ** open on an existing shared pager-cache, do not change the pager-cache + ** size. + */ + if( rc==SQLITE_OK && 0==sqlite3BtreeSchema(*ppBtree, 0, 0) ){ + sqlite3BtreeSetCacheSize(*ppBtree, nCache); + } + return rc; +} + +/* +** Return UTF-8 encoded English language explanation of the most recent +** error. +*/ +const char *sqlite3_errmsg(sqlite3 *db){ + const char *z; + if( !db ){ + return sqlite3ErrStr(SQLITE_NOMEM); + } + if( !sqlite3SafetyCheckSickOrOk(db) ){ + return sqlite3ErrStr(SQLITE_MISUSE); + } + sqlite3_mutex_enter(db->mutex); + if( db->mallocFailed ){ + z = sqlite3ErrStr(SQLITE_NOMEM); + }else{ + z = (char*)sqlite3_value_text(db->pErr); + assert( !db->mallocFailed ); + if( z==0 ){ + z = sqlite3ErrStr(db->errCode); + } + } + sqlite3_mutex_leave(db->mutex); + return z; +} + +#ifndef SQLITE_OMIT_UTF16 +/* +** Return UTF-16 encoded English language explanation of the most recent +** error. +*/ +const void *sqlite3_errmsg16(sqlite3 *db){ + static const u16 outOfMem[] = { + 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0 + }; + static const u16 misuse[] = { + 'l', 'i', 'b', 'r', 'a', 'r', 'y', ' ', + 'r', 'o', 'u', 't', 'i', 'n', 'e', ' ', + 'c', 'a', 'l', 'l', 'e', 'd', ' ', + 'o', 'u', 't', ' ', + 'o', 'f', ' ', + 's', 'e', 'q', 'u', 'e', 'n', 'c', 'e', 0 + }; + + const void *z; + if( !db ){ + return (void *)outOfMem; + } + if( !sqlite3SafetyCheckSickOrOk(db) ){ + return (void *)misuse; + } + sqlite3_mutex_enter(db->mutex); + if( db->mallocFailed ){ + z = (void *)outOfMem; + }else{ + z = sqlite3_value_text16(db->pErr); + if( z==0 ){ + sqlite3ValueSetStr(db->pErr, -1, sqlite3ErrStr(db->errCode), + SQLITE_UTF8, SQLITE_STATIC); + z = sqlite3_value_text16(db->pErr); + } + /* A malloc() may have failed within the call to sqlite3_value_text16() + ** above. If this is the case, then the db->mallocFailed flag needs to + ** be cleared before returning. Do this directly, instead of via + ** sqlite3ApiExit(), to avoid setting the database handle error message. + */ + db->mallocFailed = 0; + } + sqlite3_mutex_leave(db->mutex); + return z; +} +#endif /* SQLITE_OMIT_UTF16 */ + +/* +** Return the most recent error code generated by an SQLite routine. If NULL is +** passed to this function, we assume a malloc() failed during sqlite3_open(). +*/ +int sqlite3_errcode(sqlite3 *db){ + if( db && !sqlite3SafetyCheckSickOrOk(db) ){ + return SQLITE_MISUSE; + } + 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. +*/ +static int createCollation( + sqlite3* db, + const char *zName, + int enc, + void* pCtx, + int(*xCompare)(void*,int,const void*,int,const void*), + void(*xDel)(void*) +){ + CollSeq *pColl; + int enc2; + int nName; + + assert( sqlite3_mutex_held(db->mutex) ); + + /* If SQLITE_UTF16 is specified as the encoding type, transform this + ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the + ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. + */ + enc2 = enc; + testcase( enc2==SQLITE_UTF16 ); + testcase( enc2==SQLITE_UTF16_ALIGNED ); + if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){ + enc2 = SQLITE_UTF16NATIVE; + } + if( enc2SQLITE_UTF16BE ){ + return SQLITE_MISUSE; + } + + /* Check if this call is removing or replacing an existing collation + ** sequence. If so, and there are active VMs, return busy. If there + ** are no active VMs, invalidate any pre-compiled statements. + */ + nName = sqlite3Strlen30(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"); + return SQLITE_BUSY; + } + sqlite3ExpirePreparedStatements(db); + + /* If collation sequence pColl was created directly by a call to + ** sqlite3_create_collation, and not generated by synthCollSeq(), + ** then any copies made by synthCollSeq() need to be invalidated. + ** Also, collation destructor - CollSeq.xDel() - function may need + ** to be called. + */ + if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){ + CollSeq *aColl = sqlite3HashFind(&db->aCollSeq, zName, nName); + int j; + for(j=0; j<3; j++){ + CollSeq *p = &aColl[j]; + if( p->enc==pColl->enc ){ + if( p->xDel ){ + p->xDel(p->pUser); + } + p->xCmp = 0; + } + } + } + } + + 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)); + } + sqlite3Error(db, SQLITE_OK, 0); + return SQLITE_OK; +} + + +/* +** This array defines hard upper bounds on limit values. The +** initializer must be kept in sync with the SQLITE_LIMIT_* +** #defines in sqlite3.h. +*/ +static const int aHardLimit[] = { + SQLITE_MAX_LENGTH, + SQLITE_MAX_SQL_LENGTH, + SQLITE_MAX_COLUMN, + SQLITE_MAX_EXPR_DEPTH, + SQLITE_MAX_COMPOUND_SELECT, + SQLITE_MAX_VDBE_OP, + SQLITE_MAX_FUNCTION_ARG, + SQLITE_MAX_ATTACHED, + SQLITE_MAX_LIKE_PATTERN_LENGTH, + SQLITE_MAX_VARIABLE_NUMBER, +}; + +/* +** Make sure the hard limits are set to reasonable values +*/ +#if SQLITE_MAX_LENGTH<100 +# error SQLITE_MAX_LENGTH must be at least 100 +#endif +#if SQLITE_MAX_SQL_LENGTH<100 +# error SQLITE_MAX_SQL_LENGTH must be at least 100 +#endif +#if SQLITE_MAX_SQL_LENGTH>SQLITE_MAX_LENGTH +# error SQLITE_MAX_SQL_LENGTH must not be greater than SQLITE_MAX_LENGTH +#endif +#if SQLITE_MAX_COMPOUND_SELECT<2 +# error SQLITE_MAX_COMPOUND_SELECT must be at least 2 +#endif +#if SQLITE_MAX_VDBE_OP<40 +# error SQLITE_MAX_VDBE_OP must be at least 40 +#endif +#if SQLITE_MAX_FUNCTION_ARG<0 || SQLITE_MAX_FUNCTION_ARG>1000 +# error SQLITE_MAX_FUNCTION_ARG must be between 0 and 1000 +#endif +#if SQLITE_MAX_ATTACHED<0 || SQLITE_MAX_ATTACHED>30 +# error SQLITE_MAX_ATTACHED must be between 0 and 30 +#endif +#if SQLITE_MAX_LIKE_PATTERN_LENGTH<1 +# error SQLITE_MAX_LIKE_PATTERN_LENGTH must be at least 1 +#endif +#if SQLITE_MAX_VARIABLE_NUMBER<1 +# error SQLITE_MAX_VARIABLE_NUMBER must be at least 1 +#endif +#if SQLITE_MAX_COLUMN>32767 +# error SQLITE_MAX_COLUMN must not exceed 32767 +#endif + + +/* +** Change the value of a limit. Report the old value. +** If an invalid limit index is supplied, report -1. +** Make no changes but still report the old value if the +** new limit is negative. +** +** A new lower limit does not shrink existing constructs. +** It merely prevents new constructs that exceed the limit +** from forming. +*/ +int sqlite3_limit(sqlite3 *db, int limitId, int newLimit){ + int oldLimit; + if( limitId<0 || limitId>=SQLITE_N_LIMIT ){ + return -1; + } + oldLimit = db->aLimit[limitId]; + if( newLimit>=0 ){ + if( newLimit>aHardLimit[limitId] ){ + newLimit = aHardLimit[limitId]; + } + db->aLimit[limitId] = newLimit; + } + return oldLimit; +} + +/* +** This routine does the work of opening a database on behalf of +** sqlite3_open() and sqlite3_open16(). The database filename "zFilename" +** is UTF-8 encoded. +*/ +static int openDatabase( + const char *zFilename, /* Database filename UTF-8 encoded */ + sqlite3 **ppDb, /* OUT: Returned database handle */ + unsigned flags, /* Operational flags */ + const char *zVfs /* Name of the VFS to use */ +){ + sqlite3 *db; + int rc; + CollSeq *pColl; + int isThreadsafe; + + *ppDb = 0; +#ifndef SQLITE_OMIT_AUTOINIT + rc = sqlite3_initialize(); + if( rc ) return rc; +#endif + + if( sqlite3GlobalConfig.bCoreMutex==0 ){ + isThreadsafe = 0; + }else if( flags & SQLITE_OPEN_NOMUTEX ){ + isThreadsafe = 0; + }else if( flags & SQLITE_OPEN_FULLMUTEX ){ + isThreadsafe = 1; + }else{ + isThreadsafe = sqlite3GlobalConfig.bFullMutex; + } + + /* Remove harmful bits from the flags parameter */ + flags &= ~( SQLITE_OPEN_DELETEONCLOSE | + SQLITE_OPEN_MAIN_DB | + SQLITE_OPEN_TEMP_DB | + SQLITE_OPEN_TRANSIENT_DB | + SQLITE_OPEN_MAIN_JOURNAL | + SQLITE_OPEN_TEMP_JOURNAL | + SQLITE_OPEN_SUBJOURNAL | + SQLITE_OPEN_MASTER_JOURNAL | + SQLITE_OPEN_NOMUTEX | + SQLITE_OPEN_FULLMUTEX + ); + + /* Allocate the sqlite data structure */ + db = sqlite3MallocZero( sizeof(sqlite3) ); + if( db==0 ) goto opendb_out; + if( isThreadsafe ){ + db->mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE); + if( db->mutex==0 ){ + sqlite3_free(db); + db = 0; + goto opendb_out; + } + } + sqlite3_mutex_enter(db->mutex); + db->errMask = 0xff; + db->priorNewRowid = 0; + db->nDb = 2; + db->magic = SQLITE_MAGIC_BUSY; + db->aDb = db->aDbStatic; + + assert( sizeof(db->aLimit)==sizeof(aHardLimit) ); + memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit)); + db->autoCommit = 1; + db->nextAutovac = -1; + db->nextPagesize = 0; + db->flags |= SQLITE_ShortColNames +#if SQLITE_DEFAULT_FILE_FORMAT<4 + | SQLITE_LegacyFileFmt +#endif +#ifdef SQLITE_ENABLE_LOAD_EXTENSION + | SQLITE_LoadExtension +#endif + ; + sqlite3HashInit(&db->aCollSeq); +#ifndef SQLITE_OMIT_VIRTUALTABLE + sqlite3HashInit(&db->aModule); +#endif + + db->pVfs = sqlite3_vfs_find(zVfs); + if( !db->pVfs ){ + rc = SQLITE_ERROR; + sqlite3Error(db, rc, "no such vfs: %s", zVfs); + goto opendb_out; + } + + /* Add the default collation sequence BINARY. BINARY works for both UTF-8 + ** and UTF-16, so add a version for each to avoid any unnecessary + ** conversions. The only error that can occur here is a malloc() failure. + */ + createCollation(db, "BINARY", SQLITE_UTF8, 0, binCollFunc, 0); + createCollation(db, "BINARY", SQLITE_UTF16BE, 0, binCollFunc, 0); + createCollation(db, "BINARY", SQLITE_UTF16LE, 0, binCollFunc, 0); + createCollation(db, "RTRIM", SQLITE_UTF8, (void*)1, binCollFunc, 0); + if( db->mallocFailed ){ + goto opendb_out; + } + db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "BINARY", 6, 0); + assert( db->pDfltColl!=0 ); + + /* Also add a UTF-8 case-insensitive collation sequence. */ + createCollation(db, "NOCASE", SQLITE_UTF8, 0, nocaseCollatingFunc, 0); + + /* Set flags on the built-in collating sequences */ + db->pDfltColl->type = SQLITE_COLL_BINARY; + pColl = sqlite3FindCollSeq(db, SQLITE_UTF8, "NOCASE", 6, 0); + if( pColl ){ + pColl->type = SQLITE_COLL_NOCASE; + } + + /* Open the backend database driver */ + db->openFlags = flags; + rc = sqlite3BtreeFactory(db, zFilename, 0, SQLITE_DEFAULT_CACHE_SIZE, + flags | SQLITE_OPEN_MAIN_DB, + &db->aDb[0].pBt); + if( rc!=SQLITE_OK ){ + if( rc==SQLITE_IOERR_NOMEM ){ + rc = SQLITE_NOMEM; + } + sqlite3Error(db, rc, 0); + goto opendb_out; + } + db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt); + db->aDb[1].pSchema = sqlite3SchemaGet(db, 0); + + + /* The default safety_level for the main database is 'full'; for the temp + ** database it is 'NONE'. This matches the pager layer defaults. + */ + db->aDb[0].zName = "main"; + db->aDb[0].safety_level = 3; +#ifndef SQLITE_OMIT_TEMPDB + db->aDb[1].zName = "temp"; + db->aDb[1].safety_level = 1; +#endif + + db->magic = SQLITE_MAGIC_OPEN; + if( db->mallocFailed ){ + goto opendb_out; + } + + /* Register all built-in functions, but do not attempt to read the + ** database schema yet. This is delayed until the first time the database + ** is accessed. + */ + sqlite3Error(db, SQLITE_OK, 0); + sqlite3RegisterBuiltinFunctions(db); + + /* Load automatic extensions - extensions that have been registered + ** using the sqlite3_automatic_extension() API. + */ + (void)sqlite3AutoLoadExtensions(db); + if( sqlite3_errcode(db)!=SQLITE_OK ){ + goto opendb_out; + } + +#ifdef SQLITE_ENABLE_FTS1 + if( !db->mallocFailed ){ + extern int sqlite3Fts1Init(sqlite3*); + rc = sqlite3Fts1Init(db); + } +#endif + +#ifdef SQLITE_ENABLE_FTS2 + if( !db->mallocFailed && rc==SQLITE_OK ){ + extern int sqlite3Fts2Init(sqlite3*); + rc = sqlite3Fts2Init(db); + } +#endif + +#ifdef SQLITE_ENABLE_FTS3 + if( !db->mallocFailed && rc==SQLITE_OK ){ + rc = sqlite3Fts3Init(db); + } +#endif + +#ifdef SQLITE_ENABLE_ICU + if( !db->mallocFailed && rc==SQLITE_OK ){ + rc = sqlite3IcuInit(db); + } +#endif + +#ifdef SQLITE_ENABLE_RTREE + if( !db->mallocFailed && rc==SQLITE_OK){ + rc = sqlite3RtreeInit(db); + } +#endif + + sqlite3Error(db, rc, 0); + + /* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking + ** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking + ** mode. Doing nothing at all also makes NORMAL the default. + */ +#ifdef SQLITE_DEFAULT_LOCKING_MODE + db->dfltLockMode = SQLITE_DEFAULT_LOCKING_MODE; + sqlite3PagerLockingMode(sqlite3BtreePager(db->aDb[0].pBt), + SQLITE_DEFAULT_LOCKING_MODE); +#endif + + /* Enable the lookaside-malloc subsystem */ + setupLookaside(db, 0, sqlite3GlobalConfig.szLookaside, + sqlite3GlobalConfig.nLookaside); + +opendb_out: + if( db ){ + assert( db->mutex!=0 || isThreadsafe==0 || sqlite3GlobalConfig.bFullMutex==0 ); + sqlite3_mutex_leave(db->mutex); + } + rc = sqlite3_errcode(db); + if( rc==SQLITE_NOMEM ){ + sqlite3_close(db); + db = 0; + }else if( rc!=SQLITE_OK ){ + db->magic = SQLITE_MAGIC_SICK; + } + *ppDb = db; + return sqlite3ApiExit(0, rc); +} + +/* +** Open a new database handle. +*/ +int sqlite3_open( + const char *zFilename, + sqlite3 **ppDb +){ + return openDatabase(zFilename, ppDb, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); +} +int sqlite3_open_v2( + const char *filename, /* Database filename (UTF-8) */ + sqlite3 **ppDb, /* OUT: SQLite db handle */ + int flags, /* Flags */ + const char *zVfs /* Name of VFS module to use */ +){ + return openDatabase(filename, ppDb, flags, zVfs); +} + +#ifndef SQLITE_OMIT_UTF16 +/* +** Open a new database handle. +*/ +int sqlite3_open16( + const void *zFilename, + sqlite3 **ppDb +){ + char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ + sqlite3_value *pVal; + int rc; + + assert( zFilename ); + assert( ppDb ); + *ppDb = 0; +#ifndef SQLITE_OMIT_AUTOINIT + rc = sqlite3_initialize(); + if( rc ) return rc; +#endif + pVal = sqlite3ValueNew(0); + sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC); + zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8); + if( zFilename8 ){ + rc = openDatabase(zFilename8, ppDb, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0); + assert( *ppDb || rc==SQLITE_NOMEM ); + if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){ + ENC(*ppDb) = SQLITE_UTF16NATIVE; + } + }else{ + rc = SQLITE_NOMEM; + } + sqlite3ValueFree(pVal); + + return sqlite3ApiExit(0, rc); +} +#endif /* SQLITE_OMIT_UTF16 */ + +/* +** Register a new collation sequence with the database handle db. +*/ +int sqlite3_create_collation( + sqlite3* db, + const char *zName, + int enc, + void* pCtx, + int(*xCompare)(void*,int,const void*,int,const void*) +){ + int rc; + sqlite3_mutex_enter(db->mutex); + assert( !db->mallocFailed ); + rc = createCollation(db, zName, enc, pCtx, xCompare, 0); + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +} + +/* +** Register a new collation sequence with the database handle db. +*/ +int sqlite3_create_collation_v2( + sqlite3* db, + const char *zName, + int enc, + void* pCtx, + int(*xCompare)(void*,int,const void*,int,const void*), + void(*xDel)(void*) +){ + int rc; + sqlite3_mutex_enter(db->mutex); + assert( !db->mallocFailed ); + rc = createCollation(db, zName, enc, pCtx, xCompare, xDel); + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +} + +#ifndef SQLITE_OMIT_UTF16 +/* +** Register a new collation sequence with the database handle db. +*/ +int sqlite3_create_collation16( + sqlite3* db, + const void *zName, + int enc, + void* pCtx, + int(*xCompare)(void*,int,const void*,int,const void*) +){ + int rc = SQLITE_OK; + char *zName8; + sqlite3_mutex_enter(db->mutex); + assert( !db->mallocFailed ); + zName8 = sqlite3Utf16to8(db, zName, -1); + if( zName8 ){ + rc = createCollation(db, zName8, enc, pCtx, xCompare, 0); + sqlite3DbFree(db, zName8); + } + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +} +#endif /* SQLITE_OMIT_UTF16 */ + +/* +** Register a collation sequence factory callback with the database handle +** db. Replace any previously installed collation sequence factory. +*/ +int sqlite3_collation_needed( + sqlite3 *db, + void *pCollNeededArg, + void(*xCollNeeded)(void*,sqlite3*,int eTextRep,const char*) +){ + sqlite3_mutex_enter(db->mutex); + db->xCollNeeded = xCollNeeded; + db->xCollNeeded16 = 0; + db->pCollNeededArg = pCollNeededArg; + sqlite3_mutex_leave(db->mutex); + return SQLITE_OK; +} + +#ifndef SQLITE_OMIT_UTF16 +/* +** Register a collation sequence factory callback with the database handle +** db. Replace any previously installed collation sequence factory. +*/ +int sqlite3_collation_needed16( + sqlite3 *db, + void *pCollNeededArg, + void(*xCollNeeded16)(void*,sqlite3*,int eTextRep,const void*) +){ + sqlite3_mutex_enter(db->mutex); + db->xCollNeeded = 0; + db->xCollNeeded16 = xCollNeeded16; + db->pCollNeededArg = pCollNeededArg; + sqlite3_mutex_leave(db->mutex); + return SQLITE_OK; +} +#endif /* SQLITE_OMIT_UTF16 */ + +#ifndef SQLITE_OMIT_GLOBALRECOVER +#ifndef SQLITE_OMIT_DEPRECATED +/* +** This function is now an anachronism. It used to be used to recover from a +** malloc() failure, but SQLite now does this automatically. +*/ +int sqlite3_global_recover(void){ + return SQLITE_OK; +} +#endif +#endif + +/* +** Test to see whether or not the database connection is in autocommit +** mode. Return TRUE if it is and FALSE if not. Autocommit mode is on +** by default. Autocommit is disabled by a BEGIN statement and reenabled +** by the next COMMIT or ROLLBACK. +** +******* THIS IS AN EXPERIMENTAL API AND IS SUBJECT TO CHANGE ****** +*/ +int sqlite3_get_autocommit(sqlite3 *db){ + return db->autoCommit; +} + +#ifdef SQLITE_DEBUG +/* +** The following routine is subtituted for constant SQLITE_CORRUPT in +** debugging builds. This provides a way to set a breakpoint for when +** corruption is first detected. +*/ +int sqlite3Corrupt(void){ + return SQLITE_CORRUPT; +} +#endif + +#ifndef SQLITE_OMIT_DEPRECATED +/* +** This is a convenience routine that makes sure that all thread-specific +** data for this thread has been deallocated. +** +** SQLite no longer uses thread-specific data so this routine is now a +** no-op. It is retained for historical compatibility. +*/ +void sqlite3_thread_cleanup(void){ +} +#endif + +/* +** Return meta information about a specific column of a database table. +** See comment in sqlite3.h (sqlite.h.in) for details. +*/ +#ifdef SQLITE_ENABLE_COLUMN_METADATA +int sqlite3_table_column_metadata( + sqlite3 *db, /* Connection handle */ + const char *zDbName, /* Database name or NULL */ + const char *zTableName, /* Table name */ + const char *zColumnName, /* Column name */ + char const **pzDataType, /* OUTPUT: Declared data type */ + char const **pzCollSeq, /* OUTPUT: Collation sequence name */ + int *pNotNull, /* OUTPUT: True if NOT NULL constraint exists */ + int *pPrimaryKey, /* OUTPUT: True if column part of PK */ + int *pAutoinc /* OUTPUT: True if column is auto-increment */ +){ + int rc; + char *zErrMsg = 0; + Table *pTab = 0; + Column *pCol = 0; + int iCol; + + char const *zDataType = 0; + char const *zCollSeq = 0; + int notnull = 0; + int primarykey = 0; + int autoinc = 0; + + /* Ensure the database schema has been loaded */ + sqlite3_mutex_enter(db->mutex); + (void)sqlite3SafetyOn(db); + sqlite3BtreeEnterAll(db); + rc = sqlite3Init(db, &zErrMsg); + if( SQLITE_OK!=rc ){ + goto error_out; + } + + /* Locate the table in question */ + pTab = sqlite3FindTable(db, zTableName, zDbName); + if( !pTab || pTab->pSelect ){ + pTab = 0; + goto error_out; + } + + /* Find the column for which info is requested */ + if( sqlite3IsRowid(zColumnName) ){ + iCol = pTab->iPKey; + if( iCol>=0 ){ + pCol = &pTab->aCol[iCol]; + } + }else{ + for(iCol=0; iColnCol; iCol++){ + pCol = &pTab->aCol[iCol]; + if( 0==sqlite3StrICmp(pCol->zName, zColumnName) ){ + break; + } + } + if( iCol==pTab->nCol ){ + pTab = 0; + goto error_out; + } + } + + /* The following block stores the meta information that will be returned + ** to the caller in local variables zDataType, zCollSeq, notnull, primarykey + ** and autoinc. At this point there are two possibilities: + ** + ** 1. The specified column name was rowid", "oid" or "_rowid_" + ** and there is no explicitly declared IPK column. + ** + ** 2. The table is not a view and the column name identified an + ** explicitly declared column. Copy meta information from *pCol. + */ + if( pCol ){ + zDataType = pCol->zType; + zCollSeq = pCol->zColl; + notnull = pCol->notNull!=0; + primarykey = pCol->isPrimKey!=0; + autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0; + }else{ + zDataType = "INTEGER"; + primarykey = 1; + } + if( !zCollSeq ){ + zCollSeq = "BINARY"; + } + +error_out: + sqlite3BtreeLeaveAll(db); + (void)sqlite3SafetyOff(db); + + /* Whether the function call succeeded or failed, set the output parameters + ** to whatever their local counterparts contain. If an error did occur, + ** this has the effect of zeroing all output parameters. + */ + if( pzDataType ) *pzDataType = zDataType; + if( pzCollSeq ) *pzCollSeq = zCollSeq; + if( pNotNull ) *pNotNull = notnull; + if( pPrimaryKey ) *pPrimaryKey = primarykey; + if( pAutoinc ) *pAutoinc = autoinc; + + if( SQLITE_OK==rc && !pTab ){ + sqlite3DbFree(db, zErrMsg); + zErrMsg = sqlite3MPrintf(db, "no such table column: %s.%s", zTableName, + zColumnName); + rc = SQLITE_ERROR; + } + sqlite3Error(db, rc, (zErrMsg?"%s":0), zErrMsg); + sqlite3DbFree(db, zErrMsg); + rc = sqlite3ApiExit(db, rc); + sqlite3_mutex_leave(db->mutex); + return rc; +} +#endif + +/* +** Sleep for a little while. Return the amount of time slept. +*/ +int sqlite3_sleep(int ms){ + sqlite3_vfs *pVfs; + int rc; + pVfs = sqlite3_vfs_find(0); + if( pVfs==0 ) return 0; + + /* This function works in milliseconds, but the underlying OsSleep() + ** API uses microseconds. Hence the 1000's. + */ + rc = (sqlite3OsSleep(pVfs, 1000*ms)/1000); + return rc; +} + +/* +** Enable or disable the extended result codes. +*/ +int sqlite3_extended_result_codes(sqlite3 *db, int onoff){ + sqlite3_mutex_enter(db->mutex); + db->errMask = onoff ? 0xffffffff : 0xff; + sqlite3_mutex_leave(db->mutex); + return SQLITE_OK; +} + +/* +** Invoke the xFileControl method on a particular database. +*/ +int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *pArg){ + int rc = SQLITE_ERROR; + int iDb; + sqlite3_mutex_enter(db->mutex); + if( zDbName==0 ){ + iDb = 0; + }else{ + for(iDb=0; iDbnDb; iDb++){ + if( strcmp(db->aDb[iDb].zName, zDbName)==0 ) break; + } + } + if( iDbnDb ){ + Btree *pBtree = db->aDb[iDb].pBt; + if( pBtree ){ + Pager *pPager; + sqlite3_file *fd; + sqlite3BtreeEnter(pBtree); + pPager = sqlite3BtreePager(pBtree); + assert( pPager!=0 ); + fd = sqlite3PagerFile(pPager); + assert( fd!=0 ); + if( fd->pMethods ){ + rc = sqlite3OsFileControl(fd, op, pArg); + } + sqlite3BtreeLeave(pBtree); + } + } + sqlite3_mutex_leave(db->mutex); + return rc; +} + +/* +** Interface to the testing logic. +*/ +int sqlite3_test_control(int op, ...){ + int rc = 0; +#ifndef SQLITE_OMIT_BUILTIN_TEST + va_list ap; + va_start(ap, op); + switch( op ){ + + /* + ** Save the current state of the PRNG. + */ + case SQLITE_TESTCTRL_PRNG_SAVE: { + sqlite3PrngSaveState(); + break; + } + + /* + ** Restore the state of the PRNG to the last state saved using + ** PRNG_SAVE. If PRNG_SAVE has never before been called, then + ** this verb acts like PRNG_RESET. + */ + case SQLITE_TESTCTRL_PRNG_RESTORE: { + sqlite3PrngRestoreState(); + break; + } + + /* + ** Reset the PRNG back to its uninitialized state. The next call + ** to sqlite3_randomness() will reseed the PRNG using a single call + ** to the xRandomness method of the default VFS. + */ + case SQLITE_TESTCTRL_PRNG_RESET: { + sqlite3PrngResetState(); + break; + } + + /* + ** sqlite3_test_control(BITVEC_TEST, size, program) + ** + ** Run a test against a Bitvec object of size. The program argument + ** is an array of integers that defines the test. Return -1 on a + ** memory allocation error, 0 on success, or non-zero for an error. + ** See the sqlite3BitvecBuiltinTest() for additional information. + */ + case SQLITE_TESTCTRL_BITVEC_TEST: { + int sz = va_arg(ap, int); + int *aProg = va_arg(ap, int*); + rc = sqlite3BitvecBuiltinTest(sz, aProg); + break; + } + + /* + ** sqlite3_test_control(BENIGN_MALLOC_HOOKS, xBegin, xEnd) + ** + ** Register hooks to call to indicate which malloc() failures + ** are benign. + */ + case SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: { + typedef void (*void_function)(void); + void_function xBenignBegin; + void_function xBenignEnd; + 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; +} diff --git a/src/.#rowhash.c.1.3 b/src/.#rowhash.c.1.3 new file mode 100644 index 0000000..fc200ca --- /dev/null +++ b/src/.#rowhash.c.1.3 @@ -0,0 +1,387 @@ +/* +** 2009 April 15 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file contains the implementation of the RowHash data structure. +** A RowHash has the following properties: +** +** * A RowHash stores an unordered "bag" of 64-bit integer rowids. +** There is no other content. +** +** * Primative operations are CREATE, INSERT, TEST, and DESTROY. +** There is no way to remove individual elements from the RowHash +** once they are inserted. +** +** * INSERT operations are batched. TEST operation will ignore +** elements in the current INSERT batch. Only elements inserted +** in prior batches will be seen by a TEST. +** +** The insert batch number is a parameter to the TEST primitive. The +** hash table is rebuilt whenever the batch number increases. TEST +** operations only look for INSERTs that occurred in prior batches. +** +** The caller is responsible for insuring that there are no duplicate +** INSERTs. +** +** $Id: rowhash.c,v 1.1 2009/04/21 09:02:47 danielk1977 Exp $ +*/ +#include "sqliteInt.h" + +/* +** An upper bound on the size of heap allocations made by this module. +** Limiting the size of allocations helps to avoid memory fragmentation. +*/ +#define ROWHASH_ALLOCATION 1024 + +/* +** If there are less than this number of elements in the RowHash, do not +** bother building a hash-table. Just do a linear search. +*/ +#define ROWHASH_LINEAR_SEARCH_LIMIT 10 + +/* +** This value is what we want the average length of the collision hash +** chain to be. +*/ +#define ROWHASH_COLLISION_LENGTH 3 + + +/* Forward references to data structures. */ +typedef struct RowHashElem RowHashElem; +typedef struct RowHashBlock RowHashBlock; +typedef union RowHashPtr RowHashPtr; +typedef struct RowHashPage RowHashPage; + +/* +** Number of elements in the RowHashBlock.aElem[] array. This array is +** sized to make RowHashBlock very close to (without exceeding) +** ROWHASH_ALLOCATION bytes in size. +*/ +#define ROWHASH_ELEM_PER_BLOCK ( \ + (ROWHASH_ALLOCATION - ROUND8(sizeof(struct RowHashBlockData))) / \ + sizeof(RowHashElem) \ +) + +/* +** Number of pointers that fit into a single allocation of +** ROWHASH_ALLOCATION bytes. +*/ +#define ROWHASH_POINTER_PER_PAGE (ROWHASH_ALLOCATION/sizeof(RowHashPtr)) + +/* +** A page of pointers used to construct a hash table. +** +** The hash table is actually a tree composed of instances of this +** object. Leaves of the tree use the a[].pElem pointer to point +** to RowHashElem entries. Interior nodes of the tree use the +** a[].pPage element to point to subpages. +** +** The hash table is split into a tree in order to avoid having +** to make large memory allocations, since large allocations can +** result in unwanted memory fragmentation. +*/ +struct RowHashPage { + union RowHashPtr { + RowHashPage *pPage; /* Used by interior nodes. Pointer to subtree. */ + RowHashElem *pElem; /* Used by leaves. Pointer to hash entry. */ + } a[ROWHASH_POINTER_PER_PAGE]; +}; + +/* +** Each 64-bit integer in a RowHash is stored as an instance of +** this object. +** +** Instances of this object are not allocated separately. They are +** allocated in large blocks using the RowHashBlock object as a container. +*/ +struct RowHashElem { + i64 iVal; /* The value being stored. A rowid. */ + RowHashElem *pNext; /* Next element with the same hash */ +}; + +/* +** In order to avoid many small allocations of RowHashElem objects, +** multiple RowHashElem objects are allocated at once, as an instance +** of this object, and then used as needed. +** +** A single RowHash object will allocate one or more of these RowHashBlock +** objects. As many are allocated as are needed to store all of the +** content. All RowHashBlocks are kept on a linked list formed using +** RowHashBlock.data.pNext so that they can be freed when the RowHash +** is destroyed. +** +** The linked list of RowHashBlock objects also provides a way to sequentially +** scan all elements in the RowHash. This sequential scan is used when +** rebuilding the hash table. The hash table is rebuilt after every +** batch of inserts. +*/ +struct RowHashBlock { + struct RowHashBlockData { + int nUsed; /* Num of aElem[] currently used in this block */ + RowHashBlock *pNext; /* Next RowHashBlock object in list of them all */ + } data; + RowHashElem aElem[ROWHASH_ELEM_PER_BLOCK]; /* Available RowHashElem objects */ +}; + +/* +** RowHash structure. References to a structure of this type are passed +** around and used as opaque handles by code in other modules. +*/ +struct RowHash { + unsigned int nEntry; /* Number of used entries over all RowHashBlocks */ + int iBatch; /* The current insert batch number */ + u8 nHeight; /* Height of tree of hash pages */ + u8 nLinearLimit; /* Linear search limit (used if pHash==0) */ + int nBucket; /* Number of buckets in hash table */ + RowHashPage *pHash; /* Pointer to root of hash table tree */ + RowHashBlock *pBlock; /* Linked list of RowHashBlocks */ + sqlite3 *db; /* Associated database connection */ +}; + + +/* +** Allocate a hash table tree of height nHeight with *pnLeaf leaf pages. +** Set *pp to point to the root of the tree. If the maximum number of leaf +** pages in a tree of height nHeight is less than *pnLeaf, allocate only +** that part of the tree that is necessary to account for all leaves. +** +** Before returning, subtract the number of leaves in the tree allocated +** from *pnLeaf. +** +** This routine returns SQLITE_NOMEM if a malloc() fails, or SQLITE_OK +** otherwise. +*/ +static int allocHashTable(RowHashPage **pp, int nHeight, int *pnLeaf){ + RowHashPage *p = (RowHashPage *)sqlite3MallocZero(sizeof(*p)); + if( !p ){ + return SQLITE_NOMEM; + } + *pp = p; + if( nHeight==0 ){ + (*pnLeaf)--; + }else{ + int ii; + for(ii=0; ii0; ii++){ + if( allocHashTable(&p->a[ii].pPage, nHeight-1, pnLeaf) ){ + return SQLITE_NOMEM; + } + } + } + return SQLITE_OK; +} + +/* +** Delete the hash table tree of height nHeight passed as the first argument. +*/ +static void deleteHashTable(RowHashPage *p, int nHeight){ + if( p ){ + if( nHeight>0 ){ + int ii; + for(ii=0; iia[ii].pPage, nHeight-1); + } + } + sqlite3_free(p); + } +} + +/* +** Find the hash-bucket associated with value iVal. Return a pointer to it. +** +** By "hash-bucket", we mean the RowHashPage.a[].pElem pointer that +** corresponds to a particular hash entry. +*/ +static RowHashElem **findHashBucket(RowHash *pRowHash, i64 iVal){ + int aOffset[16]; + int n; + RowHashPage *pPage = pRowHash->pHash; + int h = (((u64)iVal) % pRowHash->nBucket); + + assert( pRowHash->nHeight < sizeof(aOffset)/sizeof(aOffset[0]) ); + for(n=0; nnHeight; n++){ + int h1 = h / ROWHASH_POINTER_PER_PAGE; + aOffset[n] = h - (h1 * ROWHASH_POINTER_PER_PAGE); + h = h1; + } + aOffset[n] = h; + for(n=pRowHash->nHeight; n>0; n--){ + pPage = pPage->a[aOffset[n]].pPage; + } + return &pPage->a[aOffset[0]].pElem; +} + +/* +** Build a new hash table tree in p->pHash. The new hash table should +** contain all p->nEntry entries in the p->pBlock list. If there +** existed a prior tree, delete the old tree first before constructing +** the new one. +** +** If the number of entries (p->nEntry) is less than +** ROWHASH_LINEAR_SEARCH_LIMIT, then we are guessing that a linear +** search is going to be faster than a lookup, so do not bother +** building the hash table. +*/ +static int makeHashTable(RowHash *p, int iBatch){ + RowHashBlock *pBlock; + int nBucket; + int nLeaf, n; + + /* Delete the old hash table. */ + deleteHashTable(p->pHash, p->nHeight); + assert( p->iBatch!=iBatch ); + p->iBatch = iBatch; + + /* Skip building the hash table if the number of elements is small */ + if( p->nEntrynLinearLimit = p->nEntry; + p->pHash = 0; + return SQLITE_OK; + } + + /* Determine how many leaves the hash-table will comprise. */ + nLeaf = 1 + (p->nEntry / (ROWHASH_POINTER_PER_PAGE*ROWHASH_COLLISION_LENGTH)); + p->nBucket = nBucket = nLeaf*ROWHASH_POINTER_PER_PAGE; + + /* Set nHeight to the height of the tree that contains the leaf pages. If + ** RowHash.nHeight is zero, then the whole hash-table fits on a single + ** leaf. If RowHash.nHeight is 1, then RowHash.pHash points to an array + ** of pointers to leaf pages. If 2, pHash points to an array of pointers + ** to arrays of pointers to leaf pages. And so on. + */ + p->nHeight = 0; + n = nLeaf; + while( n>1 ){ + n = (n+ROWHASH_POINTER_PER_PAGE-1) / ROWHASH_POINTER_PER_PAGE; + p->nHeight++; + } + + /* Allocate the hash-table. */ + if( allocHashTable(&p->pHash, p->nHeight, &nLeaf) ){ + return SQLITE_NOMEM; + } + + /* Insert all values into the hash-table. */ + for(pBlock=p->pBlock; pBlock; pBlock=pBlock->data.pNext){ + RowHashElem * const pEnd = &pBlock->aElem[pBlock->data.nUsed]; + RowHashElem *pIter; + for(pIter=pBlock->aElem; pIteriVal); + pIter->pNext = *ppElem; + *ppElem = pIter; + } + } + + return SQLITE_OK; +} + +/* +** Check to see if iVal has been inserted into the hash table "p" +** in some batch prior to iBatch. If so, set *pExists to 1. +** If not, set *pExists to 0. +** +** The hash table is rebuilt whenever iBatch changes. A hash table +** rebuild might encounter an out-of-memory condition. If that happens, +** return SQLITE_NOMEM. If there are no problems, return SQLITE_OK. +** +** The initial "batch" is 0. So, if there were prior calls to +** sqlite3RowhashInsert() and then this routine is invoked with iBatch==0, +** because all prior inserts where in the same batch, none of the prior +** inserts will be visible and this routine will indicate not found. +** Hence, the first invocation of this routine should probably use +** a batch number of 1. +*/ +int sqlite3RowhashTest( + RowHash *p, /* The RowHash to search in */ + int iBatch, /* Look for values inserted in batches prior to this batch */ + i64 iVal, /* The rowid value we are looking for */ + int *pExists /* Store 0 or 1 hear to indicate not-found or found */ +){ + *pExists = 0; + if( p ){ + assert( p->pBlock ); + if( iBatch!=p->iBatch && makeHashTable(p, iBatch) ){ + return SQLITE_NOMEM; + } + if( p->pHash ){ + RowHashElem *pElem = *findHashBucket(p, iVal); + for(; pElem; pElem=pElem->pNext){ + if( pElem->iVal==iVal ){ + *pExists = 1; + break; + } + } + }else{ + int ii; + RowHashElem *aElem = p->pBlock->aElem; + for(ii=0; iinLinearLimit; ii++){ + if( aElem[ii].iVal==iVal ){ + *pExists = 1; + break; + } + } + } + } + return SQLITE_OK; +} + +/* +** Insert value iVal into the RowHash object. Allocate a new RowHash +** object if necessary. +** +** Return SQLITE_OK if all goes as planned. If a malloc() fails, return +** SQLITE_NOMEM. +*/ +int sqlite3RowhashInsert(sqlite3 *db, RowHash **pp, i64 iVal){ + RowHash *p = *pp; + + /* If the RowHash structure has not been allocated, allocate it now. */ + if( !p ){ + p = (RowHash*)sqlite3DbMallocZero(db, sizeof(RowHash)); + if( !p ){ + return SQLITE_NOMEM; + } + p->db = db; + *pp = p; + } + + /* If the current RowHashBlock is full, or if the first RowHashBlock has + ** not yet been allocated, allocate one now. */ + if( !p->pBlock || p->pBlock->data.nUsed==ROWHASH_ELEM_PER_BLOCK ){ + RowHashBlock *pBlock = (RowHashBlock*)sqlite3Malloc(sizeof(RowHashBlock)); + if( !pBlock ){ + return SQLITE_NOMEM; + } + pBlock->data.nUsed = 0; + pBlock->data.pNext = p->pBlock; + p->pBlock = pBlock; + } + + /* Add iVal to the current RowHashBlock. */ + p->pBlock->aElem[p->pBlock->data.nUsed].iVal = iVal; + p->pBlock->data.nUsed++; + p->nEntry++; + return SQLITE_OK; +} + +/* +** Destroy the RowHash object passed as the first argument. +*/ +void sqlite3RowhashDestroy(RowHash *p){ + if( p ){ + RowHashBlock *pBlock, *pNext; + deleteHashTable(p->pHash, p->nHeight); + for(pBlock=p->pBlock; pBlock; pBlock=pNext){ + pNext = pBlock->data.pNext; + sqlite3_free(pBlock); + } + sqlite3DbFree(p->db, p); + } +} diff --git a/src/.#util.c.1.247 b/src/.#util.c.1.247 new file mode 100644 index 0000000..e0e494c --- /dev/null +++ b/src/.#util.c.1.247 @@ -0,0 +1,1006 @@ +/* +** 2001 September 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. +** +************************************************************************* +** Utility functions used throughout sqlite. +** +** This file contains functions for allocating memory, comparing +** strings, and stuff like that. +** +** $Id: util.c,v 1.247 2009/01/20 16:53:41 danielk1977 Exp $ +*/ +#include "sqliteInt.h" +#include +#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 + +/* +** Return true if the floating point value is Not a Number (NaN). +** +** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN. +** Otherwise, we have our own implementation that works on most systems. +*/ +int sqlite3IsNaN(double x){ +#if defined(SQLITE_HAVE_ISNAN) + /* + ** Systems that support the isnan() library function should probably + ** make use of it by compiling with -DSQLITE_HAVE_ISNAN. But we have + ** found that many systems do not have a working isnan() function so + ** this implementation is provided as an alternative. + ** + ** This NaN test sometimes fails if compiled on GCC with -ffast-math. + ** On the other hand, the use of -ffast-math comes with the following + ** warning: + ** + ** This option [-ffast-math] should never be turned on by any + ** -O option since it can result in incorrect output for programs + ** which depend on an exact implementation of IEEE or ISO + ** rules/specifications for math functions. + ** + ** Under MSVC, this NaN test may fail if compiled with a floating- + ** point precision mode other than /fp:precise. From the MSDN + ** documentation: + ** + ** The compiler [with /fp:precise] will properly handle comparisons + ** involving NaN. For example, x != x evaluates to true if x is NaN + ** ... + */ +#ifdef __FAST_MATH__ +# error SQLite will not work correctly with the -ffast-math option of GCC. +#endif + volatile double y = x; + volatile double z = y; + return y!=z; +#else /* if defined(SQLITE_HAVE_ISNAN) */ + return isnan(x); +#endif /* SQLITE_HAVE_ISNAN */ +} + +/* +** 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; + while( *z2 ){ z2++; } + x = (int)(z2 - z); + len = 0x7fffffff & x; + if( len!=x || len > db->aLimit[SQLITE_LIMIT_LENGTH] ){ + return db->aLimit[SQLITE_LIMIT_LENGTH]; + }else{ + return len; + } +} + +/* +** Set the most recent error code and error string for the sqlite +** handle "db". The error code is set to "err_code". +** +** If it is not NULL, string zFormat specifies the format of the +** error string in the style of the printf functions: The following +** format characters are allowed: +** +** %s Insert a string +** %z A string that should be freed after use +** %d Insert an integer +** %T Insert a token +** %S Insert the first element of a SrcList +** +** zFormat and any string tokens that follow it are assumed to be +** encoded in UTF-8. +** +** To clear the most recent error for sqlite handle "db", sqlite3Error +** should be called with err_code set to SQLITE_OK and zFormat set +** to NULL. +*/ +void sqlite3Error(sqlite3 *db, int err_code, const char *zFormat, ...){ + if( db && (db->pErr || (db->pErr = sqlite3ValueNew(db))!=0) ){ + db->errCode = err_code; + if( zFormat ){ + char *z; + va_list ap; + va_start(ap, zFormat); + z = sqlite3VMPrintf(db, zFormat, ap); + va_end(ap); + sqlite3ValueSetStr(db->pErr, -1, z, SQLITE_UTF8, SQLITE_DYNAMIC); + }else{ + sqlite3ValueSetStr(db->pErr, 0, 0, SQLITE_UTF8, SQLITE_STATIC); + } + } +} + +/* +** Add an error message to pParse->zErrMsg and increment pParse->nErr. +** The following formatting characters are allowed: +** +** %s Insert a string +** %z A string that should be freed after use +** %d Insert an integer +** %T Insert a token +** %S Insert the first element of a SrcList +** +** This function should be used to report any error that occurs whilst +** compiling an SQL statement (i.e. within sqlite3_prepare()). The +** last thing the sqlite3_prepare() function does is copy the error +** stored by this function into the database handle using sqlite3Error(). +** Function sqlite3Error() should be used during statement execution +** (sqlite3_step() etc.). +*/ +void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ + va_list ap; + sqlite3 *db = pParse->db; + pParse->nErr++; + sqlite3DbFree(db, pParse->zErrMsg); + va_start(ap, zFormat); + pParse->zErrMsg = sqlite3VMPrintf(db, zFormat, ap); + va_end(ap); + if( pParse->rc==SQLITE_OK ){ + pParse->rc = SQLITE_ERROR; + } +} + +/* +** Clear the error message in pParse, if any +*/ +void sqlite3ErrorClear(Parse *pParse){ + sqlite3DbFree(pParse->db, pParse->zErrMsg); + pParse->zErrMsg = 0; + pParse->nErr = 0; +} + +/* +** Convert an SQL-style quoted string into a normal string by removing +** the quote characters. The conversion is done in-place. If the +** input does not begin with a quote character, then this routine +** is a no-op. +** +** 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 i, j; + if( z==0 ) return; + quote = z[0]; + switch( quote ){ + case '\'': break; + case '"': break; + case '`': break; /* For MySQL compatibility */ + case '[': quote = ']'; break; /* For MS SqlServer compatibility */ + default: return; + } + for(i=1, j=0; z[i]; i++){ + if( z[i]==quote ){ + if( z[i+1]==quote ){ + z[j++] = quote; + i++; + }else{ + z[j++] = 0; + break; + } + }else{ + z[j++] = z[i]; + } + } +} + +/* Convenient short-hand */ +#define UpperToLower sqlite3UpperToLower + +/* +** Some systems have stricmp(). Others have strcasecmp(). Because +** there is no consistency, we will define our own. +*/ +int sqlite3StrICmp(const char *zLeft, const char *zRight){ + register unsigned char *a, *b; + a = (unsigned char *)zLeft; + b = (unsigned char *)zRight; + while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } + return UpperToLower[*a] - UpperToLower[*b]; +} +int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N){ + register unsigned char *a, *b; + a = (unsigned char *)zLeft; + b = (unsigned char *)zRight; + while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; } + return N<0 ? 0 : UpperToLower[*a] - UpperToLower[*b]; +} + +/* +** Return TRUE if z is a pure numeric string. Return FALSE if the +** string contains any character which is not part of a number. If +** the string is numeric and contains the '.' character, set *realnum +** to TRUE (otherwise FALSE). +** +** An empty string is considered non-numeric. +*/ +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) ){ + return 0; + } + z += incr; + if( realnum ) *realnum = 0; + while( sqlite3Isdigit(*z) ){ z += incr; } + if( *z=='.' ){ + z += incr; + if( !sqlite3Isdigit(*z) ) return 0; + while( sqlite3Isdigit(*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( realnum ) *realnum = 1; + } + return *z==0; +} + +/* +** The string z[] is an ascii representation of a real number. +** Convert this string to a double. +** +** This routine assumes that z[] really is a valid number. If it +** is not, the result is undefined. +** +** This routine is used instead of the library atof() function because +** the library atof() might want to use "," as the decimal point instead +** of "." depending on how locale is set. But that would cause problems +** for SQL. So this routine always uses "." regardless of locale. +*/ +int sqlite3AtoF(const char *z, double *pResult){ +#ifndef SQLITE_OMIT_FLOATING_POINT + int sign = 1; + const char *zBegin = z; + LONGDOUBLE_TYPE v1 = 0.0; + int nSignificant = 0; + while( sqlite3Isspace(*z) ) z++; + if( *z=='-' ){ + sign = -1; + z++; + }else if( *z=='+' ){ + z++; + } + while( z[0]=='0' ){ + z++; + } + while( sqlite3Isdigit(*z) ){ + v1 = v1*10.0 + (*z - '0'); + z++; + nSignificant++; + } + if( *z=='.' ){ + LONGDOUBLE_TYPE divisor = 1.0; + z++; + if( nSignificant==0 ){ + while( z[0]=='0' ){ + divisor *= 10.0; + z++; + } + } + while( sqlite3Isdigit(*z) ){ + if( nSignificant<18 ){ + v1 = v1*10.0 + (*z - '0'); + divisor *= 10.0; + nSignificant++; + } + z++; + } + v1 /= divisor; + } + if( *z=='e' || *z=='E' ){ + int esign = 1; + int eval = 0; + LONGDOUBLE_TYPE scale = 1.0; + z++; + if( *z=='-' ){ + esign = -1; + z++; + }else if( *z=='+' ){ + z++; + } + while( sqlite3Isdigit(*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; } + while( eval>=4 ){ scale *= 1.0e+4; eval -= 4; } + while( eval>=1 ){ scale *= 1.0e+1; eval -= 1; } + if( esign<0 ){ + v1 /= scale; + }else{ + v1 *= scale; + } + } + *pResult = (double)(sign<0 ? -v1 : v1); + return (int)(z - zBegin); +#else + return sqlite3Atoi64(z, pResult); +#endif /* SQLITE_OMIT_FLOATING_POINT */ +} + +/* +** Compare the 19-character string zNum against the text representation +** value 2^63: 9223372036854775808. Return negative, zero, or positive +** if zNum is less than, equal to, or greater than the string. +** +** Unlike memcmp() this routine is guaranteed to return the difference +** in the values of the last digit if the only difference is in the +** last digit. So, for example, +** +** compare2pow63("9223372036854775800") +** +** will return -8. +*/ +static int compare2pow63(const char *zNum){ + int c; + c = memcmp(zNum,"922337203685477580",18); + if( c==0 ){ + c = zNum[18] - '8'; + } + return c; +} + + +/* +** Return TRUE if zNum is a 64-bit signed integer and write +** the value of the integer into *pNum. If zNum is not an integer +** or is an integer that is too large to be expressed with 64 bits, +** then return false. +** +** When this routine was originally written it dealt with only +** 32-bit numbers. At that time, it was much faster than the +** atoi() library routine in RedHat 7.2. +*/ +int sqlite3Atoi64(const char *zNum, i64 *pNum){ + i64 v = 0; + int neg; + int i, c; + const char *zStart; + while( sqlite3Isspace(*zNum) ) zNum++; + if( *zNum=='-' ){ + neg = 1; + zNum++; + }else if( *zNum=='+' ){ + neg = 0; + zNum++; + }else{ + neg = 0; + } + zStart = zNum; + while( zNum[0]=='0' ){ zNum++; } /* Skip over leading zeros. Ticket #2454 */ + for(i=0; (c=zNum[i])>='0' && c<='9'; i++){ + v = v*10 + c - '0'; + } + *pNum = neg ? -v : v; + if( c!=0 || (i==0 && zStart==zNum) || i>19 ){ + /* zNum is empty or contains non-numeric text or is longer + ** than 19 digits (thus guaranting that it is too large) */ + return 0; + }else if( i<19 ){ + /* Less than 19 digits, so we know that it fits in 64 bits */ + return 1; + }else{ + /* 19-digit numbers must be no larger than 9223372036854775807 if positive + ** or 9223372036854775808 if negative. Note that 9223372036854665808 + ** is 2^63. */ + return compare2pow63(zNum)='0' && c<='9'; i++){} + if( i<19 ){ + /* Guaranteed to fit if less than 19 digits */ + return 1; + }else if( i>19 ){ + /* Guaranteed to be too big if greater than 19 digits */ + return 0; + }else{ + /* Compare against 2^63. */ + return compare2pow63(zNum)=0 && c<=9; i++){ + v = v*10 + c; + } + + /* The longest decimal representation of a 32 bit integer is 10 digits: + ** + ** 1234567890 + ** 2^31 -> 2147483648 + */ + if( i>10 ){ + return 0; + } + if( v-neg>2147483647 ){ + return 0; + } + if( neg ){ + v = -v; + } + *pValue = (int)v; + return 1; +} + +/* +** The variable-length integer encoding is as follows: +** +** KEY: +** A = 0xxxxxxx 7 bits of data and one flag bit +** B = 1xxxxxxx 7 bits of data and one flag bit +** C = xxxxxxxx 8 bits of data +** +** 7 bits - A +** 14 bits - BA +** 21 bits - BBA +** 28 bits - BBBA +** 35 bits - BBBBA +** 42 bits - BBBBBA +** 49 bits - BBBBBBA +** 56 bits - BBBBBBBA +** 64 bits - BBBBBBBBC +*/ + +/* +** Write a 64-bit variable-length integer to memory starting at p[0]. +** The length of data write will be between 1 and 9 bytes. The number +** of bytes written is returned. +** +** A variable-length integer consists of the lower 7 bits of each byte +** for all bytes that have the 8th bit set and one byte with the 8th +** bit clear. Except, if we get to the 9th byte, it stores the full +** 8 bits and is the last byte. +*/ +int sqlite3PutVarint(unsigned char *p, u64 v){ + int i, j, n; + u8 buf[10]; + if( v & (((u64)0xff000000)<<32) ){ + p[8] = (u8)v; + v >>= 8; + for(i=7; i>=0; i--){ + p[i] = (u8)((v & 0x7f) | 0x80); + v >>= 7; + } + return 9; + } + n = 0; + do{ + buf[n++] = (u8)((v & 0x7f) | 0x80); + v >>= 7; + }while( v!=0 ); + buf[0] &= 0x7f; + assert( n<=9 ); + for(i=0, j=n-1; j>=0; j--, i++){ + p[i] = buf[j]; + } + return n; +} + +/* +** This routine is a faster version of sqlite3PutVarint() that only +** works for 32-bit positive integers and which is optimized for +** the common case of small integers. A MACRO version, putVarint32, +** 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. +*/ +int sqlite3PutVarint32(unsigned char *p, u32 v){ +#ifndef putVarint32 + if( (v & ~0x7f)==0 ){ + p[0] = v; + return 1; + } +#endif + if( (v & ~0x3fff)==0 ){ + p[0] = (u8)((v>>7) | 0x80); + p[1] = (u8)(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){ + u32 a,b,s; + + a = *p; + /* a: p0 (unmasked) */ + if (!(a&0x80)) + { + *v = a; + return 1; + } + + p++; + b = *p; + /* b: p1 (unmasked) */ + if (!(b&0x80)) + { + a &= 0x7f; + a = a<<7; + a |= b; + *v = a; + return 2; + } + + p++; + a = a<<14; + a |= *p; + /* a: p0<<14 | p2 (unmasked) */ + if (!(a&0x80)) + { + a &= (0x7f<<14)|(0x7f); + b &= 0x7f; + b = b<<7; + a |= b; + *v = a; + return 3; + } + + /* CSE1 from below */ + a &= (0x7f<<14)|(0x7f); + p++; + b = b<<14; + b |= *p; + /* b: p1<<14 | p3 (unmasked) */ + if (!(b&0x80)) + { + b &= (0x7f<<14)|(0x7f); + /* moved CSE1 up */ + /* a &= (0x7f<<14)|(0x7f); */ + a = a<<7; + a |= b; + *v = a; + return 4; + } + + /* a: p0<<14 | p2 (masked) */ + /* b: p1<<14 | p3 (unmasked) */ + /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ + /* moved CSE1 up */ + /* a &= (0x7f<<14)|(0x7f); */ + b &= (0x7f<<14)|(0x7f); + s = a; + /* s: p0<<14 | p2 (masked) */ + + p++; + a = a<<14; + a |= *p; + /* a: p0<<28 | p2<<14 | p4 (unmasked) */ + if (!(a&0x80)) + { + /* we can skip these cause they were (effectively) done above in calc'ing s */ + /* a &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ + /* b &= (0x7f<<14)|(0x7f); */ + b = b<<7; + a |= b; + s = s>>18; + *v = ((u64)s)<<32 | a; + return 5; + } + + /* 2:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ + s = s<<7; + s |= b; + /* s: p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ + + p++; + b = b<<14; + b |= *p; + /* b: p1<<28 | p3<<14 | p5 (unmasked) */ + if (!(b&0x80)) + { + /* we can skip this cause it was (effectively) done above in calc'ing s */ + /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ + a &= (0x7f<<14)|(0x7f); + a = a<<7; + a |= b; + s = s>>18; + *v = ((u64)s)<<32 | a; + return 6; + } + + p++; + a = a<<14; + a |= *p; + /* a: p2<<28 | p4<<14 | p6 (unmasked) */ + if (!(a&0x80)) + { + a &= (0x7f<<28)|(0x7f<<14)|(0x7f); + b &= (0x7f<<14)|(0x7f); + b = b<<7; + a |= b; + s = s>>11; + *v = ((u64)s)<<32 | a; + return 7; + } + + /* CSE2 from below */ + a &= (0x7f<<14)|(0x7f); + p++; + b = b<<14; + b |= *p; + /* b: p3<<28 | p5<<14 | p7 (unmasked) */ + if (!(b&0x80)) + { + b &= (0x7f<<28)|(0x7f<<14)|(0x7f); + /* moved CSE2 up */ + /* a &= (0x7f<<14)|(0x7f); */ + a = a<<7; + a |= b; + s = s>>4; + *v = ((u64)s)<<32 | a; + return 8; + } + + p++; + a = a<<15; + a |= *p; + /* a: p4<<29 | p6<<15 | p8 (unmasked) */ + + /* moved CSE2 up */ + /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ + b &= (0x7f<<14)|(0x7f); + b = b<<8; + a |= b; + + s = s<<4; + b = p[-4]; + b &= 0x7f; + b = b>>3; + s |= b; + + *v = ((u64)s)<<32 | a; + + return 9; +} + +/* +** Read a 32-bit variable-length integer from memory starting at p[0]. +** 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){ + u32 a,b; + + a = *p; + /* a: p0 (unmasked) */ +#ifndef getVarint32 + if (!(a&0x80)) + { + *v = a; + return 1; + } +#endif + + p++; + b = *p; + /* b: p1 (unmasked) */ + if (!(b&0x80)) + { + a &= 0x7f; + a = a<<7; + *v = a | b; + return 2; + } + + p++; + a = a<<14; + a |= *p; + /* a: p0<<14 | p2 (unmasked) */ + if (!(a&0x80)) + { + a &= (0x7f<<14)|(0x7f); + b &= 0x7f; + b = b<<7; + *v = a | b; + return 3; + } + + p++; + b = b<<14; + b |= *p; + /* b: p1<<14 | p3 (unmasked) */ + if (!(b&0x80)) + { + b &= (0x7f<<14)|(0x7f); + a &= (0x7f<<14)|(0x7f); + a = a<<7; + *v = a | b; + return 4; + } + + p++; + a = a<<14; + a |= *p; + /* a: p0<<28 | p2<<14 | p4 (unmasked) */ + if (!(a&0x80)) + { + a &= (0x7f<<28)|(0x7f<<14)|(0x7f); + b &= (0x7f<<28)|(0x7f<<14)|(0x7f); + b = b<<7; + *v = a | b; + return 5; + } + + /* We can only reach this point when reading a corrupt database + ** 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; + + p -= 4; + n = sqlite3GetVarint(p, &v64); + assert( n>5 && n<=9 ); + *v = (u32)v64; + return n; + } +} + +/* +** Return the number of bytes that will be needed to store the given +** 64-bit integer. +*/ +int sqlite3VarintLen(u64 v){ + int i = 0; + do{ + i++; + v >>= 7; + }while( v!=0 && i<9 ); + return i; +} + + +/* +** Read or write a four-byte big-endian integer value. +*/ +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; +} + + + +#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) +/* +** 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){ + 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); +} +#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */ + +#if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) +/* +** Convert a BLOB literal of the form "x'hhhhhh'" into its binary +** value. Return a pointer to its binary value. Space to hold the +** binary value has been obtained from malloc and must be freed by +** the calling routine. +*/ +void *sqlite3HexToBlob(sqlite3 *db, const char *z, int n){ + char *zBlob; + int i; + + zBlob = (char *)sqlite3DbMallocRaw(db, n/2 + 1); + n--; + if( zBlob ){ + for(i=0; imagic is not a valid open value, take care not +** to modify the db structure at all. It could be that db is a stale +** pointer. In other words, it could be that there has been a prior +** call to sqlite3_close(db) and db has been deallocated. And we do +** not want to write into deallocated memory. +*/ +#ifdef SQLITE_DEBUG +int sqlite3SafetyOn(sqlite3 *db){ + if( db->magic==SQLITE_MAGIC_OPEN ){ + db->magic = SQLITE_MAGIC_BUSY; + assert( sqlite3_mutex_held(db->mutex) ); + return 0; + }else if( db->magic==SQLITE_MAGIC_BUSY ){ + db->magic = SQLITE_MAGIC_ERROR; + db->u1.isInterrupted = 1; + } + return 1; +} +#endif + +/* +** Change the magic from SQLITE_MAGIC_BUSY to SQLITE_MAGIC_OPEN. +** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY +** when this routine is called. +*/ +#ifdef SQLITE_DEBUG +int sqlite3SafetyOff(sqlite3 *db){ + if( db->magic==SQLITE_MAGIC_BUSY ){ + db->magic = SQLITE_MAGIC_OPEN; + assert( sqlite3_mutex_held(db->mutex) ); + return 0; + }else{ + db->magic = SQLITE_MAGIC_ERROR; + db->u1.isInterrupted = 1; + return 1; + } +} +#endif + +/* +** Check to make sure we have a valid db pointer. This test is not +** foolproof but it does provide some measure of protection against +** misuse of the interface such as passing in db pointers that are +** NULL or which have been previously closed. If this routine returns +** 1 it means that the db pointer is valid and 0 if it should not be +** dereferenced for any reason. The calling function should invoke +** SQLITE_MISUSE immediately. +** +** sqlite3SafetyCheckOk() requires that the db pointer be valid for +** 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; + 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; + 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; +} diff --git a/src/.#where.c.1.394 b/src/.#where.c.1.394 new file mode 100644 index 0000000..9a788c2 --- /dev/null +++ b/src/.#where.c.1.394 @@ -0,0 +1,3578 @@ +/* +** 2001 September 15 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** This module contains C code that generates VDBE code used to process +** the WHERE clause of SQL statements. This module is responsible for +** 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.393 2009/05/05 15:46:43 drh Exp $ +*/ +#include "sqliteInt.h" + +/* +** Trace output macros +*/ +#if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) +int sqlite3WhereTrace = 0; +#endif +#if defined(SQLITE_TEST) && defined(SQLITE_DEBUG) +# define WHERETRACE(X) if(sqlite3WhereTrace) sqlite3DebugPrintf X +#else +# define WHERETRACE(X) +#endif + +/* Forward reference +*/ +typedef struct WhereClause WhereClause; +typedef struct WhereMaskSet WhereMaskSet; +typedef struct WhereOrInfo WhereOrInfo; +typedef struct WhereAndInfo WhereAndInfo; +typedef struct WhereCost WhereCost; + +/* +** 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, +** usually, or sometimes subexpressions separated by OR. +** +** All WhereTerms are collected into a single WhereClause structure. +** The following identity holds: +** +** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm +** +** 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 +** 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 +** 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 +** 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; + u16 eOperator; /* A WO_xx value describing */ + u8 wtFlags; /* TERM_xxx 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 */ +}; + +/* +** Allowed values of WhereTerm.wtFlags +*/ +#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 */ + +/* +** 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 */ + 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 */ +}; + +/* +** An instance of the following structure keeps track of a mapping +** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. +** +** The VDBE cursor numbers are small integers contained in +** SrcList_item.iCursor and Expr.iTable fields. For any given WHERE +** clause, the cursor numbers might not begin with 0 and they might +** 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 +** 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 { + int n; /* Number of assigned cursor values */ + int ix[BMS]; /* 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_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 */ + +/* +** Value for wsFlags returned by bestIndex() and stored in +** WhereLevel.wsFlags. These flags determine which search +** strategies are appropriate. +** +** 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 "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 (...) or x IS NULL */ +#define WHERE_COLUMN_RANGE 0x00020000 /* xEXPR */ +#define WHERE_COLUMN_IN 0x00040000 /* x IN (...) */ +#define WHERE_COLUMN_NULL 0x00080000 /* x IS NULL */ +#define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */ +#define WHERE_IN_ABLE 0x000f1000 /* 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 */ + +/* +** 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 */ +){ + 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 ){ + 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. +** +** 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){ + 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 ){ + 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]); + } + pTerm = &pWC->a[idx = pWC->nTerm++]; + pTerm->pExpr = p; + pTerm->wtFlags = wtFlags; + pTerm->pWC = pWC; + pTerm->iParent = -1; + return idx; +} + +/* +** This routine identifies subexpressions in the WHERE clause where +** each subexpression is separated by the AND operator or some other +** operator specified in the op parameter. The WhereClause structure +** is filled with pointers to subexpressions. For example: +** +** WHERE a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22) +** \________/ \_______________/ \________________/ +** slot[0] slot[1] slot[2] +** +** 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 +** 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); + whereSplit(pWC, pExpr->pRight, op); + } +} + +/* +** Initialize an expression mask set (a WhereMaskSet object) +*/ +#define initMaskSet(P) memset(P, 0, sizeof(*P)) + +/* +** Return the bitmask for the given cursor number. Return 0 if +** iCursor is not in the set. +*/ +static Bitmask getMask(WhereMaskSet *pMaskSet, int iCursor){ + int i; + assert( pMaskSet->n<=sizeof(Bitmask)*8 ); + 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){ + assert( pMaskSet->n < ArraySize(pMaskSet->ix) ); + pMaskSet->ix[pMaskSet->n++] = iCursor; +} + +/* +** This routine walks (recursively) an expression tree and generates +** a bitmask indicating which tables are used in that expression +** tree. +** +** In order for this routine to work, the calling function must have +** previously invoked sqlite3ResolveExprNames() on the expression. See +** the header comment on that routine for additional information. +** The sqlite3ResolveExprNames() routines looks for column names and +** 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){ + Bitmask mask = 0; + if( p==0 ) return 0; + if( p->op==TK_COLUMN ){ + mask = getMask(pMaskSet, p->iTable); + return mask; + } + mask = exprTableUsage(pMaskSet, p->pRight); + mask |= exprTableUsage(pMaskSet, p->pLeft); + if( ExprHasProperty(p, EP_xIsSelect) ){ + mask |= exprSelectTableUsage(pMaskSet, p->x.pSelect); + }else{ + mask |= exprListTableUsage(pMaskSet, p->x.pList); + } + return mask; +} +static Bitmask exprListTableUsage(WhereMaskSet *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){ + Bitmask mask = 0; + while( pS ){ + mask |= exprListTableUsage(pMaskSet, pS->pEList); + mask |= exprListTableUsage(pMaskSet, pS->pGroupBy); + mask |= exprListTableUsage(pMaskSet, pS->pOrderBy); + mask |= exprTableUsage(pMaskSet, pS->pWhere); + mask |= exprTableUsage(pMaskSet, pS->pHaving); + pS = pS->pPrior; + } + return mask; +} + +/* +** Return TRUE if the given operator is one of the operators that is +** allowed for an indexable WHERE clause term. The allowed operators are +** "=", "<", ">", "<=", ">=", and "IN". +*/ +static int allowedOp(int op){ + assert( TK_GT>TK_EQ && TK_GTTK_EQ && TK_LTTK_EQ && TK_LE=TK_EQ && op<=TK_GE) || op==TK_ISNULL; +} + +/* +** Swap two objects of type TYPE. +*/ +#define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} + +/* +** Commute a comparison operator. Expressions of the form "X op Y" +** are converted into "Y op X". +** +** If a collation sequence is associated with either the left or right +** side of the comparison, it remains associated with the same side after +** the commutation. So "Y collate NOCASE op X" becomes +** "X collate NOCASE op Y". This is because any collation sequence on +** the left hand side of a comparison overrides any collation sequence +** attached to the right. For the same reason the EP_ExpCollate flag +** is not commuted. +*/ +static void exprCommute(Parse *pParse, Expr *pExpr){ + u16 expRight = (pExpr->pRight->flags & EP_ExpCollate); + u16 expLeft = (pExpr->pLeft->flags & EP_ExpCollate); + assert( allowedOp(pExpr->op) && pExpr->op!=TK_IN ); + pExpr->pRight->pColl = sqlite3ExprCollSeq(pParse, pExpr->pRight); + pExpr->pLeft->pColl = sqlite3ExprCollSeq(pParse, pExpr->pLeft); + SWAP(CollSeq*,pExpr->pRight->pColl,pExpr->pLeft->pColl); + pExpr->pRight->flags = (pExpr->pRight->flags & ~EP_ExpCollate) | expLeft; + pExpr->pLeft->flags = (pExpr->pLeft->flags & ~EP_ExpCollate) | expRight; + SWAP(Expr*,pExpr->pRight,pExpr->pLeft); + if( pExpr->op>=TK_GT ){ + assert( TK_LT==TK_GT+2 ); + assert( TK_GE==TK_LE+2 ); + assert( TK_GT>TK_EQ ); + assert( TK_GTop>=TK_GT && pExpr->op<=TK_GE ); + pExpr->op = ((pExpr->op-TK_GT)^2)+TK_GT; + } +} + +/* +** Translate from TK_xx operator to WO_xx bitmask. +*/ +static u16 operatorMask(int op){ + u16 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)); + } + 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 ); + assert( op!=TK_LE || c==WO_LE ); + assert( op!=TK_GT || c==WO_GT ); + assert( op!=TK_GE || c==WO_GE ); + return c; +} + +/* +** Search for a term in the WHERE clause that is of the form "X " +** where X is a reference to the iColumn of table iCur and is one of +** the WO_xx operator codes specified by the op parameter. +** Return a pointer to the term. Return 0 if not found. +*/ +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 */ + 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->eOperator & op)!=0 + ){ + if( pIdx && pTerm->eOperator!=WO_ISNULL ){ + Expr *pX = pTerm->pExpr; + CollSeq *pColl; + char idxaff; + int j; + Parse *pParse = pWC->pParse; + + idxaff = pIdx->pTable->aCol[iColumn].affinity; + if( !sqlite3IndexAffinityOk(pX, idxaff) ) continue; + + /* Figure out the collation sequence required from an index for + ** 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); + + for(j=0; pIdx->aiColumn[j]!=iColumn; j++){ + if( NEVER(j>=pIdx->nColumn) ) return 0; + } + if( pColl && sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue; + } + return pTerm; + } + } + return 0; +} + +/* Forward reference */ +static void exprAnalyze(SrcList*, WhereClause*, int); + +/* +** Call exprAnalyze on all terms in a WHERE clause. +** +** +*/ +static void exprAnalyzeAll( + SrcList *pTabList, /* the FROM clause */ + WhereClause *pWC /* the WHERE clause to be analyzed */ +){ + int i; + for(i=pWC->nTerm-1; i>=0; i--){ + exprAnalyze(pTabList, pWC, i); + } +} + +#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION +/* +** Check to see if the given expression is a LIKE or GLOB operator that +** can be optimized using inequality constraints. Return TRUE if it is +** so and false if not. +** +** In order for the operator to be optimizible, the RHS must be a string +** literal that does not begin with a wildcard. +*/ +static int isLikeOrGlob( + Parse *pParse, /* Parsing and code generating context */ + 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 n; /* Length of string 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 */ + + if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){ + return 0; + } +#ifdef SQLITE_EBCDIC + if( *pnoCase ) return 0; +#endif + pList = pExpr->x.pList; + pRight = pList->a[0].pExpr; + if( pRight->op!=TK_STRING ){ + return 0; + } + pLeft = pList->a[1].pExpr; + if( pLeft->op!=TK_COLUMN ){ + return 0; + } + pColl = sqlite3ExprCollSeq(pParse, pLeft); + assert( pColl!=0 || pLeft->iColumn==-1 ); + if( pColl==0 ){ + /* No collation is defined for the ROWID. Use the default. */ + pColl = db->pDfltColl; + } + if( (pColl->type!=SQLITE_COLL_BINARY || *pnoCase) && + (pColl->type!=SQLITE_COLL_NOCASE || !*pnoCase) ){ + return 0; + } + z = (const char*)pRight->token.z; + cnt = 0; + if( z ){ + n = pRight->token.n; + while( cntop!=TK_FUNCTION ){ + return 0; + } + if( pExpr->token.n!=5 || + sqlite3StrNICmp((const char*)pExpr->token.z,"match",5)!=0 ){ + return 0; + } + pList = pExpr->x.pList; + if( pList->nExpr!=2 ){ + return 0; + } + if( pList->a[1].pExpr->op != TK_COLUMN ){ + return 0; + } + return 1; +} +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + +/* +** If the pBase expression originated in the ON or USING clause of +** a join, then transfer the appropriate markings over to derived. +*/ +static void transferJoinMarkings(Expr *pDerived, Expr *pBase){ + pDerived->flags |= pBase->flags & EP_FromJoin; + 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, 0); + pList = sqlite3ExprListAppend(pWC->pParse, pList, pDup, 0); + pLeft = pOrTerm->pExpr->pLeft; + } + assert( pLeft!=0 ); + pDup = sqlite3ExprDup(db, pLeft, 0); + pNew = sqlite3Expr(db, TK_IN, pDup, 0, 0); + if( pNew ){ + int idxNew; + transferJoinMarkings(pNew, pExpr); + assert( !ExprHasProperty(pNew, EP_xIsSelect) ); + pNew->x.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 */ + } + } +} +#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. +*/ +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 */ + 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 */ + + if( db->mallocFailed ){ + return; + } + pTerm = &pWC->a[idxTerm]; + pMaskSet = pWC->pMaskSet; + pExpr = pTerm->pExpr; + prereqLeft = exprTableUsage(pMaskSet, pExpr->pLeft); + op = pExpr->op; + if( op==TK_IN ){ + assert( pExpr->pRight==0 ); + if( ExprHasProperty(pExpr, EP_xIsSelect) ){ + pTerm->prereqRight = exprSelectTableUsage(pMaskSet, pExpr->x.pSelect); + }else{ + pTerm->prereqRight = exprListTableUsage(pMaskSet, pExpr->x.pList); + } + }else if( op==TK_ISNULL ){ + pTerm->prereqRight = 0; + }else{ + pTerm->prereqRight = exprTableUsage(pMaskSet, pExpr->pRight); + } + prereqAll = exprTableUsage(pMaskSet, pExpr); + if( ExprHasProperty(pExpr, EP_FromJoin) ){ + Bitmask x = getMask(pMaskSet, pExpr->iRightJoinTable); + prereqAll |= x; + extraRight = x-1; /* ON clause terms may not be used with an index + ** on left table of a LEFT JOIN. Ticket #3015 */ + } + pTerm->prereqAll = prereqAll; + pTerm->leftCursor = -1; + pTerm->iParent = -1; + pTerm->eOperator = 0; + 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->eOperator = operatorMask(op); + } + if( pRight && pRight->op==TK_COLUMN ){ + WhereTerm *pNew; + Expr *pDup; + if( pTerm->leftCursor>=0 ){ + int idxNew; + pDup = sqlite3ExprDup(db, pExpr, 0); + if( db->mallocFailed ){ + sqlite3ExprDelete(db, pDup); + return; + } + idxNew = whereClauseInsert(pWC, pDup, TERM_VIRTUAL|TERM_DYNAMIC); + if( idxNew==0 ) return; + pNew = &pWC->a[idxNew]; + pNew->iParent = idxTerm; + pTerm = &pWC->a[idxTerm]; + pTerm->nChild = 1; + pTerm->wtFlags |= TERM_COPIED; + }else{ + pDup = pExpr; + pNew = pTerm; + } + exprCommute(pParse, pDup); + pLeft = pDup->pLeft; + pNew->leftCursor = pLeft->iTable; + pNew->u.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. + */ + else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){ + ExprList *pList = pExpr->x.pList; + int i; + static const u8 ops[] = {TK_GE, TK_LE}; + assert( pList!=0 ); + assert( pList->nExpr==2 ); + for(i=0; i<2; i++){ + Expr *pNewExpr; + int idxNew; + pNewExpr = sqlite3Expr(db, ops[i], sqlite3ExprDup(db, pExpr->pLeft, 0), + sqlite3ExprDup(db, pList->a[i].pExpr, 0), 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. + */ + else if( pExpr->op==TK_OR ){ + assert( pWC->op==TK_AND ); + exprAnalyzeOrTerm(pSrc, pWC, idxTerm); + } +#endif /* SQLITE_OMIT_OR_OPTIMIZATION */ + +#ifndef SQLITE_OMIT_LIKE_OPTIMIZATION + /* Add constraints to reduce the search space on a LIKE or GLOB + ** operator. + ** + ** A like pattern of the form "x LIKE 'abc%'" is changed into constraints + ** + ** 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 ){ + Expr *pLeft, *pRight; + Expr *pStr1, *pStr2; + Expr *pNewExpr1, *pNewExpr2; + int idxNew1, idxNew2; + + pLeft = pExpr->x.pList->a[1].pExpr; + pRight = pExpr->x.pList->a[0].pExpr; + pStr1 = sqlite3PExpr(pParse, TK_STRING, 0, 0, 0); + if( pStr1 ){ + sqlite3TokenCopy(db, &pStr1->token, &pRight->token); + pStr1->token.n = nPattern; + } + pStr2 = sqlite3ExprDup(db, pStr1, 0); + if( !db->mallocFailed ){ + u8 c, *pC; + /* assert( pStr2->token.dyn ); */ + pC = (u8*)&pStr2->token.z[nPattern-1]; + c = *pC; + if( noCase ){ + if( c=='@' ) isComplete = 0; + c = sqlite3UpperToLower[c]; + } + *pC = c + 1; + } + pNewExpr1 = sqlite3PExpr(pParse, TK_GE, sqlite3ExprDup(db,pLeft,0),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,0),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; + pTerm->nChild = 2; + } + } +#endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */ + +#ifndef SQLITE_OMIT_VIRTUALTABLE + /* Add a WO_MATCH auxiliary term to the constraint set if the + ** current expression is of the form: column MATCH expr. + ** This information is used by the xBestIndex methods of + ** virtual tables. The native query optimizer does not attempt + ** to do anything with MATCH functions. + */ + if( isMatchOfColumn(pExpr) ){ + int idxNew; + Expr *pRight, *pLeft; + WhereTerm *pNewTerm; + Bitmask prereqColumn, prereqExpr; + + pRight = pExpr->x.pList->a[0].pExpr; + pLeft = pExpr->x.pList->a[1].pExpr; + prereqExpr = exprTableUsage(pMaskSet, pRight); + prereqColumn = exprTableUsage(pMaskSet, pLeft); + if( (prereqExpr & prereqColumn)==0 ){ + Expr *pNewExpr; + pNewExpr = sqlite3Expr(db, TK_MATCH, 0, sqlite3ExprDup(db, pRight, 0), 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->eOperator = WO_MATCH; + pNewTerm->iParent = idxTerm; + pTerm = &pWC->a[idxTerm]; + pTerm->nChild = 1; + pTerm->wtFlags |= TERM_COPIED; + pNewTerm->prereqAll = pTerm->prereqAll; + } + } +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + + /* Prevent ON clause terms of a LEFT JOIN from being used to drive + ** an index for tables to the left of the join. + */ + pTerm->prereqRight |= extraRight; +} + +/* +** 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 */ + int iFirst, /* Be searching with the iFirst-th expression */ + int iBase /* Ignore references to this table */ +){ + Bitmask allowed = ~getMask(pMaskSet, iBase); + while( iFirstnExpr ){ + if( (exprTableUsage(pMaskSet, pList->a[iFirst++].pExpr)&allowed)!=0 ){ + return 1; + } + } + return 0; +} + + +/* +** This routine decides if pIdx can be used to satisfy the ORDER BY +** clause. If it can, it returns 1. If pIdx cannot satisfy the +** ORDER BY clause, this routine returns 0. +** +** pOrderBy is an ORDER BY clause from a SELECT statement. pTab is the +** left-most table in the FROM clause of that same SELECT statement and +** the table has a cursor number of "base". pIdx is an index on pTab. +** +** nEqCol is the number of columns of pIdx that are used as equality +** constraints. Any of these columns may be missing from the ORDER BY +** clause and the match can still be a success. +** +** All terms of the ORDER BY that match against the index must be either +** ASC or DESC. (Terms of the ORDER BY clause past the end of a UNIQUE +** index do not need to satisfy this constraint.) The *pbRev value is +** 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 */ + 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 */ +){ + int i, j; /* Loop counters */ + int sortOrder = 0; /* XOR of index and ORDER BY sort direction */ + int nTerm; /* Number of ORDER BY terms */ + struct ExprList_item *pTerm; /* A term of the ORDER BY clause */ + sqlite3 *db = pParse->db; + + assert( pOrderBy!=0 ); + nTerm = pOrderBy->nExpr; + assert( nTerm>0 ); + + /* Match terms of the ORDER BY clause against columns of + ** the index. + ** + ** Note that indices have pIdx->nColumn regular columns plus + ** one additional column containing the rowid. The rowid column + ** of the index is also allowed to match against the ORDER BY + ** clause. + */ + for(i=j=0, pTerm=pOrderBy->a; jnColumn; i++){ + Expr *pExpr; /* The expression of the ORDER BY pTerm */ + CollSeq *pColl; /* The collating sequence of pExpr */ + int termSortOrder; /* Sort order for this term */ + int iColumn; /* The i-th column of the index. -1 for rowid */ + int iSortOrder; /* 1 for DESC, 0 for ASC on the i-th index term */ + const char *zColl; /* Name of the collating sequence for i-th index term */ + + pExpr = pTerm->pExpr; + if( pExpr->op!=TK_COLUMN || pExpr->iTable!=base ){ + /* Can not use an index sort on anything that is not a column in the + ** left-most table of the FROM clause */ + break; + } + pColl = sqlite3ExprCollSeq(pParse, pExpr); + if( !pColl ){ + pColl = db->pDfltColl; + } + if( inColumn ){ + iColumn = pIdx->aiColumn[i]; + if( iColumn==pIdx->pTable->iPKey ){ + iColumn = -1; + } + iSortOrder = pIdx->aSortOrder[i]; + zColl = pIdx->azColl[i]; + }else{ + iColumn = -1; + iSortOrder = 0; + zColl = pColl->zName; + } + if( pExpr->iColumn!=iColumn || sqlite3StrICmp(pColl->zName, zColl) ){ + /* Term j of the ORDER BY clause does not match column i of the index */ + if( inColumn ){ + /* Index column i is the rowid. All other terms match. */ + break; + }else{ + /* If an index column fails to match and is not constrained by == + ** then the index cannot satisfy the ORDER BY constraint. + */ + return 0; + } + } + assert( pIdx->aSortOrder!=0 ); + assert( pTerm->sortOrder==0 || pTerm->sortOrder==1 ); + assert( iSortOrder==0 || iSortOrder==1 ); + termSortOrder = iSortOrder ^ pTerm->sortOrder; + if( i>nEqCol ){ + if( termSortOrder!=sortOrder ){ + /* Indices can only be used if all ORDER BY terms past the + ** equality constraints are all either DESC or ASC. */ + return 0; + } + }else{ + sortOrder = termSortOrder; + } + j++; + pTerm++; + if( iColumn<0 && !referencesOtherTables(pOrderBy, pMaskSet, j, base) ){ + /* If the indexed column is the primary key and everything matches + ** so far and none of the ORDER BY terms to the right reference other + ** tables in the join, then we are assured that the index can be used + ** to sort because the primary key is unique and so none of the other + ** columns will make any difference + */ + j = nTerm; + } + } + + *pbRev = sortOrder!=0; + if( j>=nTerm ){ + /* All terms of the ORDER BY clause are covered by this index so + ** this index can be used for sorting. */ + return 1; + } + if( pIdx->onError!=OE_None && i==pIdx->nColumn + && !referencesOtherTables(pOrderBy, pMaskSet, j, base) ){ + /* All terms of this index match some prefix of the ORDER BY clause + ** and the index is UNIQUE and no terms on the tail of the ORDER BY + ** clause reference other tables in a join. If this is all true then + ** the order by clause is superfluous. */ + return 1; + } + return 0; +} + +/* +** Check table to see if the ORDER BY clause in pOrderBy can be satisfied +** by sorting in order of ROWID. Return true if so and set *pbRev to be +** 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 */ + int *pbRev /* Set to 1 if ORDER BY is DESC */ +){ + Expr *p; + + assert( pOrderBy!=0 ); + assert( pOrderBy->nExpr>0 ); + p = pOrderBy->a[0].pExpr; + if( p->op==TK_COLUMN && p->iTable==base && p->iColumn==-1 + && !referencesOtherTables(pOrderBy, pMaskSet, 1, base) ){ + *pbRev = pOrderBy->a[0].sortOrder; + return 1; + } + return 0; +} + +/* +** Prepare a crude estimate of the logarithm of the input value. +** The results need not be exact. This is only used for estimating +** the total cost of performing operations with O(logN) or O(NlogN) +** complexity. Because N is just a guess, it is no great tragedy if +** logN is a little off. +*/ +static double estLog(double N){ + double logN = 1; + double x = 10; + while( N>x ){ + logN += 1; + x *= 10; + } + return logN; +} + +/* +** Two routines for printing the content of an sqlite3_index_info +** structure. Used for testing and debugging only. If neither +** SQLITE_TEST or SQLITE_DEBUG are defined, then these routines +** are no-ops. +*/ +#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_DEBUG) +static void TRACE_IDX_INPUTS(sqlite3_index_info *p){ + int i; + if( !sqlite3WhereTrace ) return; + for(i=0; inConstraint; i++){ + sqlite3DebugPrintf(" constraint[%d]: col=%d termid=%d op=%d usabled=%d\n", + i, + p->aConstraint[i].iColumn, + p->aConstraint[i].iTermOffset, + p->aConstraint[i].op, + p->aConstraint[i].usable); + } + for(i=0; inOrderBy; i++){ + sqlite3DebugPrintf(" orderby[%d]: col=%d desc=%d\n", + i, + p->aOrderBy[i].iColumn, + p->aOrderBy[i].desc); + } +} +static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){ + int i; + if( !sqlite3WhereTrace ) return; + for(i=0; inConstraint; i++){ + sqlite3DebugPrintf(" usage[%d]: argvIdx=%d omit=%d\n", + i, + p->aConstraintUsage[i].argvIndex, + p->aConstraintUsage[i].omit); + } + sqlite3DebugPrintf(" idxNum=%d\n", p->idxNum); + sqlite3DebugPrintf(" idxStr=%s\n", p->idxStr); + sqlite3DebugPrintf(" orderByConsumed=%d\n", p->orderByConsumed); + sqlite3DebugPrintf(" estimatedCost=%g\n", p->estimatedCost); +} +#else +#define TRACE_IDX_INPUTS(A) +#define TRACE_IDX_OUTPUTS(A) +#endif + +/* +** Required because bestIndex() is called by bestOrClauseIndex() +*/ +static void bestIndex( + Parse*, WhereClause*, struct SrcList_item*, Bitmask, ExprList*, WhereCost*); + +/* +** This routine attempts to find an scanning strategy that can be used +** to optimize an 'OR' expression that is part of a WHERE clause. +** +** The table associated with FROM clause term pSrc may be either a +** regular B-Tree table or a virtual table. +*/ +static void bestOrClauseIndex( + 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 */ +){ +#ifndef SQLITE_OMIT_OR_OPTIMIZATION + const int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */ + const Bitmask maskSrc = getMask(pWC->pMaskSet, iCur); /* Bitmask for pSrc */ + WhereTerm * const pWCEnd = &pWC->a[pWC->nTerm]; /* End of pWC->a[] */ + WhereTerm *pTerm; /* A single term of the WHERE clause */ + + /* Search the WHERE clause terms for a usable WO_OR term. */ + for(pTerm=pWC->a; pTermeOperator==WO_OR + && ((pTerm->prereqAll & ~maskSrc) & notReady)==0 + && (pTerm->u.pOrInfo->indexable & maskSrc)!=0 + ){ + WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc; + WhereTerm * const pOrWCEnd = &pOrWC->a[pOrWC->nTerm]; + WhereTerm *pOrTerm; + int flags = WHERE_MULTI_OR; + double rTotal = 0; + double nRow = 0; + + for(pOrTerm=pOrWC->a; pOrTerma), (pTerm - pWC->a) + )); + if( pOrTerm->eOperator==WO_AND ){ + WhereClause *pAndWC = &pOrTerm->u.pAndInfo->wc; + bestIndex(pParse, pAndWC, pSrc, notReady, 0, &sTermCost); + }else if( pOrTerm->leftCursor==iCur ){ + WhereClause tempWC; + tempWC.pParse = pWC->pParse; + tempWC.pMaskSet = pWC->pMaskSet; + tempWC.op = TK_AND; + 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 there is an ORDER BY clause, increase the scan cost to account + ** for the cost of the sort. */ + if( pOrderBy!=0 ){ + rTotal += nRow*estLog(nRow); + WHERETRACE(("... sorting increases OR cost to %.9g\n", rTotal)); + } + + /* If the cost of scanning using this OR term for optimization is + ** less than the current cost stored in pCost, replace the contents + ** of pCost. */ + WHERETRACE(("... multi-index OR cost=%.9g nrow=%.9g\n", rTotal, nRow)); + if( rTotalrCost ){ + pCost->rCost = rTotal; + pCost->nRow = nRow; + pCost->plan.wsFlags = flags; + pCost->plan.u.pTerm = pTerm; + } + } + } +#endif /* SQLITE_OMIT_OR_OPTIMIZATION */ +} + +#ifndef SQLITE_OMIT_VIRTUALTABLE +/* +** Allocate and populate an sqlite3_index_info structure. It is the +** responsibility of the caller to eventually release the structure +** by passing the pointer returned by this function to sqlite3_free(). +*/ +static sqlite3_index_info *allocateIndexInfo( + Parse *pParse, + WhereClause *pWC, + struct SrcList_item *pSrc, + ExprList *pOrderBy +){ + int i, j; + int nTerm; + struct sqlite3_index_constraint *pIdxCons; + struct sqlite3_index_orderby *pIdxOrderBy; + struct sqlite3_index_constraint_usage *pUsage; + WhereTerm *pTerm; + int nOrderBy; + sqlite3_index_info *pIdxInfo; + + WHERETRACE(("Recomputing index info for %s...\n", pSrc->pTab->zName)); + + /* Count the number of possible WHERE clause constraints referring + ** to this virtual table */ + for(i=nTerm=0, pTerm=pWC->a; inTerm; i++, pTerm++){ + 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; + nTerm++; + } + + /* If the ORDER BY clause contains only columns in the current + ** virtual table then allocate space for the aOrderBy part of + ** the sqlite3_index_info structure. + */ + nOrderBy = 0; + if( pOrderBy ){ + for(i=0; inExpr; i++){ + Expr *pExpr = pOrderBy->a[i].pExpr; + if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break; + } + if( i==pOrderBy->nExpr ){ + nOrderBy = pOrderBy->nExpr; + } + } + + /* Allocate the sqlite3_index_info structure + */ + 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 0; + } + + /* Initialize the structure. The sqlite3_index_info structure contains + ** many fields that are declared "const" to prevent xBestIndex from + ** changing them. We have to do some funky casting in order to + ** initialize those fields. + */ + pIdxCons = (struct sqlite3_index_constraint*)&pIdxInfo[1]; + pIdxOrderBy = (struct sqlite3_index_orderby*)&pIdxCons[nTerm]; + pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy]; + *(int*)&pIdxInfo->nConstraint = nTerm; + *(int*)&pIdxInfo->nOrderBy = nOrderBy; + *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint = pIdxCons; + *(struct sqlite3_index_orderby**)&pIdxInfo->aOrderBy = pIdxOrderBy; + *(struct sqlite3_index_constraint_usage**)&pIdxInfo->aConstraintUsage = + pUsage; + + for(i=j=0, pTerm=pWC->a; inTerm; i++, pTerm++){ + 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].iTermOffset = i; + pIdxCons[j].op = (u8)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 ); + assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE ); + assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT ); + assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE ); + assert( WO_MATCH==SQLITE_INDEX_CONSTRAINT_MATCH ); + assert( pTerm->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) ); + j++; + } + for(i=0; ia[i].pExpr; + pIdxOrderBy[i].iColumn = pExpr->iColumn; + pIdxOrderBy[i].desc = pOrderBy->a[i].sortOrder; + } + + return pIdxInfo; +} + +/* +** The table object reference passed as the second argument to this function +** must represent a virtual table. This function invokes the xBestIndex() +** method of the virtual table with the sqlite3_index_info pointer passed +** as the argument. +** +** If an error occurs, pParse is populated with an error message and a +** non-zero value is returned. Otherwise, 0 is returned and the output +** part of the sqlite3_index_info structure is left populated. +** +** Whether or not an error is returned, it is the responsibility of the +** caller to eventually free p->idxStr if p->needToFreeIdxStr indicates +** that this is required. +*/ +static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ + sqlite3_vtab *pVtab = pTab->pVtab; + int i; + int rc; + + (void)sqlite3SafetyOff(pParse->db); + WHERETRACE(("xBestIndex for %s\n", pTab->zName)); + TRACE_IDX_INPUTS(p); + rc = pVtab->pModule->xBestIndex(pVtab, p); + TRACE_IDX_OUTPUTS(p); + (void)sqlite3SafetyOn(pParse->db); + + if( rc!=SQLITE_OK ){ + if( rc==SQLITE_NOMEM ){ + pParse->db->mallocFailed = 1; + }else if( !pVtab->zErrMsg ){ + sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc)); + }else{ + sqlite3ErrorMsg(pParse, "%s", pVtab->zErrMsg); + } + } + sqlite3DbFree(pParse->db, pVtab->zErrMsg); + pVtab->zErrMsg = 0; + + for(i=0; inConstraint; i++){ + if( !p->aConstraint[i].usable && p->aConstraintUsage[i].argvIndex>0 ){ + sqlite3ErrorMsg(pParse, + "table %s: xBestIndex returned an invalid plan", pTab->zName); + } + } + + return pParse->nErr; +} + + +/* +** Compute the best index for a virtual table. +** +** The best index is computed by the xBestIndex method of the virtual +** table module. This routine is really just a wrapper that sets up +** the sqlite3_index_info structure that is used to communicate with +** xBestIndex. +** +** In a join, this routine might be called multiple times for the +** same virtual table. The sqlite3_index_info structure is created +** and initialized on the first invocation and reused on all subsequent +** invocations. The sqlite3_index_info structure is also used when +** code is generated to access the virtual table. The whereInfoDelete() +** routine takes care of freeing the sqlite3_index_info structure after +** everybody has finished with it. +*/ +static void bestVirtualIndex( + 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 */ + sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */ +){ + Table *pTab = pSrc->pTab; + sqlite3_index_info *pIdxInfo; + struct sqlite3_index_constraint *pIdxCons; + struct sqlite3_index_constraint_usage *pUsage; + WhereTerm *pTerm; + int i, j; + int nOrderBy; + + /* Make sure wsFlags is initialized to some sane value. Otherwise, if the + ** malloc in allocateIndexInfo() fails and this function returns leaving + ** wsFlags in an uninitialized state, the caller may behave unpredictably. + */ + memset(pCost, 0, sizeof(*pCost)); + pCost->plan.wsFlags = WHERE_VIRTUALTABLE; + + /* If the sqlite3_index_info structure has not been previously + ** allocated and initialized, then allocate and initialize it now. + */ + pIdxInfo = *ppIdxInfo; + if( pIdxInfo==0 ){ + *ppIdxInfo = pIdxInfo = allocateIndexInfo(pParse, pWC, pSrc, pOrderBy); + } + if( pIdxInfo==0 ){ + return; + } + + /* At this point, the sqlite3_index_info structure that pIdxInfo points + ** to will have been initialized, either during the current invocation or + ** during some prior invocation. Now we just have to customize the + ** details of pIdxInfo for the current invocation and pass it to + ** xBestIndex. + */ + + /* The module name must be defined. Also, by this point there must + ** be a pointer to an sqlite3_vtab structure. Otherwise + ** sqlite3ViewGetColumnNames() would have picked up the error. + */ + assert( pTab->azModuleArg && pTab->azModuleArg[0] ); + assert( pTab->pVtab ); + + /* Set the aConstraint[].usable fields and initialize all + ** output variables to zero. + ** + ** aConstraint[].usable is true for constraints where the right-hand + ** side contains only references to tables to the left of the current + ** table. In other words, if the constraint is of the form: + ** + ** column = expr + ** + ** and we are evaluating a join, then the constraint on column is + ** only valid if all tables referenced in expr occur to the left + ** of the table containing column. + ** + ** The aConstraints[] array contains entries for all constraints + ** on the current table. That way we only have to compute it once + ** even though we might try to pick the best index multiple times. + ** For each attempt at picking an index, the order of tables in the + ** join might be different so we have to recompute the usable flag + ** each time. + */ + 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; + } + 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); + nOrderBy = pIdxInfo->nOrderBy; + if( !pOrderBy ){ + pIdxInfo->nOrderBy = 0; + } + + if( vtabBestIndex(pParse, pTab, pIdxInfo) ){ + return; + } + + /* The cost is not allowed to be larger than SQLITE_BIG_DBL (the + ** inital value of lowestCost in this loop. If it is, then the + ** (costestimatedCost ){ + pCost->rCost = (SQLITE_BIG_DBL/((double)2)); + }else{ + pCost->rCost = pIdxInfo->estimatedCost; + } + pCost->plan.u.pVtabIdx = pIdxInfo; + if( pIdxInfo && pIdxInfo->orderByConsumed ){ + pCost->plan.wsFlags |= WHERE_ORDERBY; + } + pCost->plan.nEq = 0; + pIdxInfo->nOrderBy = nOrderBy; + + /* Try to find a more efficient access pattern by using multiple indexes + ** to optimize an OR expression within the WHERE clause. + */ + bestOrClauseIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); +} +#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. +** +** 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. +** Factors that influence cost include: +** +** * The estimated number of rows that will be retrieved. (The +** fewer the better.) +** +** * Whether or not sorting must occur. +** +** * Whether or not there must be separate lookups in the +** index and in the main table. +** +** If there was an INDEXED BY clause (pSrc->pIndex) attached to the table in +** the SQL statement, then this function only considers plans using the +** named index. If no such plan is found, then the returned cost is +** SQLITE_BIG_DBL. If a plan is found that uses the named index, +** then the cost is calculated in the usual way. +** +** If a NOT INDEXED clause (pSrc->notIndexed!=0) 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 +** index. +*/ +static void bestBtreeIndex( + 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 */ +){ + WhereTerm *pTerm; /* A single term of the WHERE clause */ + 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 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 */ + + WHERETRACE(("bestIndex: tbl=%s notReady=%llx\n", pSrc->pTab->zName,notReady)); + pProbe = pSrc->pTab->pIndex; + if( pSrc->notIndexed ){ + pProbe = 0; + } + + /* If the table has no indices and there are no terms in the where + ** 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)) ){ + if( pParse->db->flags & SQLITE_ReverseOrder ){ + /* For application testing, randomly reverse the output order for + ** SELECT statements that omit the ORDER BY clause. This will help + ** to find cases where + */ + pCost->plan.wsFlags |= WHERE_REVERSE; + } + return; + } + 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; + 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; + WHERETRACE(("... best is rowid\n")); + pCost->rCost = 0; + pCost->nRow = 1; + return; + }else if( !ExprHasProperty((pExpr = pTerm->pExpr), EP_xIsSelect) + && pExpr->x.pList + ){ + /* Rowid IN (LIST): cost is NlogN where N is the number of list + ** elements. */ + pCost->rCost = pCost->nRow = pExpr->x.pList->nExpr; + pCost->rCost *= estLog(pCost->rCost); + }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; + } + WHERETRACE(("... rowid IN cost: %.9g\n", pCost->rCost)); + } + + /* 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; + + /* 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; + } + 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; + if( rev ){ + wsFlags |= WHERE_REVERSE; + } + }else{ + cost += cost*estLog(cost); + WHERETRACE(("... sorting increases cost to %.9g\n", cost)); + } + }else if( pParse->db->flags & SQLITE_ReverseOrder ){ + /* For application testing, randomly reverse the output order for + ** SELECT statements that omit the ORDER BY clause. This will help + ** to find cases where + */ + wsFlags |= WHERE_REVERSE; + } + + /* Remember this case if it is the best so far */ + if( costrCost ){ + pCost->rCost = cost; + pCost->nRow = nRow; + pCost->plan.wsFlags = wsFlags; + } + } + + bestOrClauseIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); + + /* If the pSrc table is the right table of a LEFT JOIN then we may not + ** use an index to satisfy IS NULL constraints on that table. This is + ** because columns might end up being NULL if the table does not match - + ** a circumstance which the index cannot help us discover. Ticket #2177. + */ + if( (pSrc->jointype & JT_LEFT)!=0 ){ + eqTermMask = WO_EQ|WO_IN; + }else{ + eqTermMask = WO_EQ|WO_IN|WO_ISNULL; + } + + /* Look at each index. + */ + if( pSrc->pIndex ){ + pProbe = pSrc->pIndex; + } + for(; pProbe; pProbe=(pSrc->pIndex ? 0 : pProbe->pNext)){ + double inMultiplier = 1; /* Number of equality look-ups needed */ + int inMultIsEst = 0; /* True if inMultiplier is an estimate */ + + WHERETRACE(("... index %s:\n", pProbe->zName)); + + /* Count the number of columns in the index that are satisfied + ** by x=EXPR or x IS NULL constraints or x IN (...) constraints. + ** For a term of the form x=EXPR or x IS NULL we only have to do + ** a single binary search. But for x IN (...) we have to do a + ** number of binary searched + ** equal to the number of entries on the RHS of the IN operator. + ** The inMultipler variable with try to estimate the number of + ** binary searches needed. + */ + wsFlags = 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; + if( pTerm->eOperator & WO_IN ){ + Expr *pExpr = pTerm->pExpr; + wsFlags |= WHERE_COLUMN_IN; + if( ExprHasProperty(pExpr, EP_xIsSelect) ){ + inMultiplier *= 25; + inMultIsEst = 1; + }else if( pExpr->x.pList ){ + inMultiplier *= pExpr->x.pList->nExpr + 1; + } + }else if( pTerm->eOperator & WO_ISNULL ){ + wsFlags |= WHERE_COLUMN_NULL; + } + } + nRow = pProbe->aiRowEst[i] * inMultiplier; + /* If inMultiplier is an estimate and that estimate results in an + ** nRow it that is more than half number of rows in the table, + ** then reduce inMultipler */ + if( inMultIsEst && nRow*2 > pProbe->aiRowEst[0] ){ + nRow = pProbe->aiRowEst[0]/2; + inMultiplier = nRow/pProbe->aiRowEst[i]; + } + cost = nRow + inMultiplier*estLog(pProbe->aiRowEst[0]); + nEq = i; + if( pProbe->onError!=OE_None && nEq==pProbe->nColumn ){ + testcase( wsFlags & WHERE_COLUMN_IN ); + testcase( wsFlags & WHERE_COLUMN_NULL ); + if( (wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_NULL))==0 ){ + wsFlags |= WHERE_UNIQUE; + } + } + WHERETRACE(("...... nEq=%d inMult=%.9g nRow=%.9g cost=%.9g\n", + nEq, inMultiplier, nRow, cost)); + + /* Look for range constraints. Assume that each range constraint + ** makes the search space 1/3rd smaller. + */ + 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; + if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pProbe) ){ + wsFlags |= WHERE_TOP_LIMIT; + cost /= 3; + nRow /= 3; + } + if( findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pProbe) ){ + wsFlags |= WHERE_BTM_LIMIT; + cost /= 3; + nRow /= 3; + } + WHERETRACE(("...... range reduces nRow to %.9g and cost to %.9g\n", + nRow, cost)); + } + } + + /* Add the additional cost of sorting if that is a factor. + */ + if( pOrderBy ){ + if( (wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_NULL))==0 + && isSortingIndex(pParse,pWC->pMaskSet,pProbe,iCur,pOrderBy,nEq,&rev) + ){ + if( wsFlags==0 ){ + wsFlags = WHERE_COLUMN_RANGE; + } + wsFlags |= WHERE_ORDERBY; + if( rev ){ + wsFlags |= WHERE_REVERSE; + } + }else{ + cost += cost*estLog(cost); + WHERETRACE(("...... orderby increases cost to %.9g\n", cost)); + } + }else if( pParse->db->flags & SQLITE_ReverseOrder ){ + /* For application testing, randomly reverse the output order for + ** SELECT statements that omit the ORDER BY clause. This will help + ** to find cases where + */ + wsFlags |= WHERE_REVERSE; + } + + /* 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)) ){ + 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; + } + } + + /* 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)); +} + +/* +** Find the query plan for accessing table pSrc->pTab. Write the +** best query plan and its cost into the WhereCost object supplied +** as the last parameter. This function may calculate the cost of +** both real and virtual table scans. +*/ +static void 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 */ +){ + if( IsVirtual(pSrc->pTab) ){ + sqlite3_index_info *p = 0; + bestVirtualIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost, &p); + if( p->needToFreeIdxStr ){ + sqlite3_free(p->idxStr); + } + sqlite3DbFree(pParse->db, p); + }else{ + bestBtreeIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); + } +} + +/* +** Disable a term in the WHERE clause. Except, do not disable the term +** if it controls a LEFT OUTER JOIN and it did not originate in the ON +** or USING clause of that join. +** +** Consider the term t2.z='ok' in the following queries: +** +** (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok' +** (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok' +** (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok' +** +** The t2.z='ok' is disabled in the in (2) because it originates +** in the ON clause. The term is disabled in (3) because it is not part +** of a LEFT OUTER JOIN. In (1), the term is not disabled. +** +** Disabling a term causes that term to not be tested in the inner loop +** of the join. Disabling is an optimization. When terms are satisfied +** by indices, we disable them to prevent redundant tests in the inner +** loop. We would get the correct results if nothing were ever disabled, +** but joins might run a little slower. The trick is to disable as much +** 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) + && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) + ){ + pTerm->wtFlags |= TERM_CODED; + if( pTerm->iParent>=0 ){ + WhereTerm *pOther = &pTerm->pWC->a[pTerm->iParent]; + if( (--pOther->nChild)==0 ){ + disableTerm(pLevel, pOther); + } + } + } +} + +/* +** Apply the affinities associated with the first n columns of index +** pIdx to the values in the n registers starting at base. +*/ +static void codeApplyAffinity(Parse *pParse, int base, int n, Index *pIdx){ + if( n>0 ){ + Vdbe *v = pParse->pVdbe; + assert( v!=0 ); + sqlite3VdbeAddOp2(v, OP_Affinity, base, n); + sqlite3IndexAffinityStr(v, pIdx); + sqlite3ExprCacheAffinityChange(pParse, base, n); + } +} + + +/* +** Generate code for a single equality term of the WHERE clause. An equality +** term can be either X=expr or X IN (...). pTerm is the term to be +** coded. +** +** The current value for the constraint is left in register iReg. +** +** For a constraint of the form X=expr, the expression is evaluated and its +** result is left on the stack. For constraints of the form X IN (...) +** this routine sets up a loop that will iterate over all values of X. +*/ +static int codeEqualityTerm( + Parse *pParse, /* The parsing context */ + WhereTerm *pTerm, /* The term of the WHERE clause to be coded */ + WhereLevel *pLevel, /* When level of the FROM clause we are working on */ + int iTarget /* Attempt to leave results in this register */ +){ + Expr *pX = pTerm->pExpr; + Vdbe *v = pParse->pVdbe; + int iReg; /* Register holding results */ + + assert( iTarget>0 ); + if( pX->op==TK_EQ ){ + iReg = sqlite3ExprCodeTarget(pParse, pX->pRight, iTarget); + }else if( pX->op==TK_ISNULL ){ + iReg = iTarget; + sqlite3VdbeAddOp2(v, OP_Null, 0, iReg); +#ifndef SQLITE_OMIT_SUBQUERY + }else{ + int eType; + int iTab; + struct InLoop *pIn; + + assert( pX->op==TK_IN ); + 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( pIn ){ + pIn += pLevel->u.in.nIn - 1; + pIn->iCur = iTab; + if( eType==IN_INDEX_ROWID ){ + pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg); + }else{ + pIn->addrInTop = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg); + } + sqlite3VdbeAddOp1(v, OP_IsNull, iReg); + }else{ + pLevel->u.in.nIn = 0; + } +#endif + } + disableTerm(pLevel, pTerm); + return iReg; +} + +/* +** Generate code that will evaluate all == and IN constraints for an +** index. The values for all constraints are left on the stack. +** +** 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. +** +** 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 +** 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( + Parse *pParse, /* Parsing context */ + 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 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. + */ + regBase = pParse->nMem + 1; + nReg = pLevel->plan.nEq + nExtraReg; + pParse->nMem += nReg; + + /* Evaluate the equality constraints + */ + assert( pIdx->nColumn>=nEq ); + for(j=0; jaiColumn[j]; + pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx); + if( NEVER(pTerm==0) ) break; + assert( (pTerm->wtFlags & 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); + } + } + 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); + } + } + return regBase; +} + +/* +** 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 */ + u16 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 iRowidReg = 0; /* Rowid is stored in this register, if not zero */ + int iReleaseReg = 0; /* Temp register to free before returning */ + + 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 + && (wctrlFlags & WHERE_FORCE_TABLE)==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); + for(j=1; j<=nConstraint; j++){ + for(k=0; ka[iTerm].pExpr->pRight, iReg+j+1); + break; + } + } + if( k==nConstraint ) break; + } + 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); + 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. + */ + iReleaseReg = 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 ); + iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, iReleaseReg); + addrNxt = pLevel->addrNxt; + sqlite3VdbeAddOp2(v, OP_MustBeInt, iRowidReg, addrNxt); + sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addrNxt, iRowidReg); + sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); + 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; + if( testOp!=OP_Noop ){ + iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Rowid, iCur, iRowidReg); + sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); + sqlite3VdbeAddOp3(v, testOp, memEndValue, addrBrk, iRowidReg); + sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL); + } + }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 ){ + sqlite3ExprCode(pParse, pRangeStart->pExpr->pRight, regBase+nEq); + 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 ){ + sqlite3ExprCacheRemove(pParse, regBase+nEq); + 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); + } + sqlite3ReleaseTempReg(pParse, r1); + + /* Seek the table cursor, if required */ + disableTerm(pLevel, pRangeStart); + disableTerm(pLevel, pRangeEnd); + if( !omitTable ){ + iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, iRowidReg); + sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); + sqlite3VdbeAddOp2(v, OP_Seek, iCur, iRowidReg); /* Deferred seek */ + } + + /* 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 looks like this: + ** + ** Null 1 # Zero the rowset in reg 1 + ** + ** Then, for each indexed term, the following. The arguments to + ** RowSetTest are such that the rowid of the current row is inserted + ** into the RowSet. If it is already present, control skips the + ** Gosub opcode and jumps straight to the code generated by WhereEnd(). + ** + ** sqlite3WhereBegin() + ** RowSetTest # Insert rowid into rowset + ** Gosub 2 A + ** sqlite3WhereEnd() + ** + ** Following the above, code to terminate the loop. Label A, the target + ** of the Gosub above, jumps to the instruction right after the Goto. + ** + ** Null 1 # Zero the rowset in reg 1 + ** Goto B # The loop is finished. + ** + ** A: # Return data, whatever. + ** + ** Return 2 # Jump back to the Gosub + ** + ** B: + ** + */ + WhereClause *pOrWc; /* The OR-clause broken out into subterms */ + WhereTerm *pFinal; /* Final subterm within the OR-clause. */ + SrcList oneTab; /* Shortened table list */ + + int regReturn = ++pParse->nMem; /* Register used with OP_Gosub */ + int regRowset; /* Register for RowSet object */ + int regRowid; /* Register holding rowid */ + int iLoopBody = sqlite3VdbeMakeLabel(v); /* Start of loop body */ + int iRetInit; /* Address of regReturn init */ + int ii; + + pTerm = pLevel->plan.u.pTerm; + assert( pTerm!=0 ); + assert( pTerm->eOperator==WO_OR ); + assert( (pTerm->wtFlags & TERM_ORINFO)!=0 ); + pOrWc = &pTerm->u.pOrInfo->wc; + pFinal = &pOrWc->a[pOrWc->nTerm-1]; + + /* Set up a SrcList containing just the table being scanned by this loop. */ + oneTab.nSrc = 1; + oneTab.nAlloc = 1; + oneTab.a[0] = *pTabItem; + + /* Initialize the rowset register to contain NULL. An SQL NULL is + ** equivalent to an empty rowset. + ** + ** Also initialize regReturn to contain the address of the instruction + ** immediately following the OP_Return at the bottom of the loop. This + ** is required in a few obscure LEFT JOIN cases where control jumps + ** over the top of the loop into the body of it. In this case the + ** correct response for the end-of-loop code (the OP_Return) is to + ** fall through to the next instruction, just as an OP_Next does if + ** called on an uninitialized cursor. + */ + if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ + regRowset = ++pParse->nMem; + regRowid = ++pParse->nMem; + sqlite3VdbeAddOp2(v, OP_Null, 0, regRowset); + } + iRetInit = sqlite3VdbeAddOp2(v, OP_Integer, 0, regReturn); + + for(ii=0; iinTerm; ii++){ + WhereTerm *pOrTerm = &pOrWc->a[ii]; + if( pOrTerm->leftCursor==iCur || pOrTerm->eOperator==WO_AND ){ + WhereInfo *pSubWInfo; /* Info for single OR-term scan */ + + /* Loop through table entries that match term pOrTerm. */ + pSubWInfo = sqlite3WhereBegin(pParse, &oneTab, pOrTerm->pExpr, 0, + WHERE_OMIT_OPEN | WHERE_OMIT_CLOSE | WHERE_FORCE_TABLE); + if( pSubWInfo ){ + if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ + int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); + int r; + r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, + regRowid, 0); + sqlite3VdbeAddOp4(v, OP_RowSetTest, regRowset, + sqlite3VdbeCurrentAddr(v)+2, + r, (char*)iSet, P4_INT32); + } + sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); + + /* Finish the loop through table entries that match term pOrTerm. */ + sqlite3WhereEnd(pSubWInfo); + } + } + } + sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v)); + /* sqlite3VdbeAddOp2(v, OP_Null, 0, regRowset); */ + sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk); + sqlite3VdbeResolveLabel(v, iLoopBody); + + pLevel->op = OP_Return; + pLevel->p1 = regReturn; + 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. + */ + static const u8 aStep[] = { OP_Next, OP_Prev }; + static const u8 aStart[] = { OP_Rewind, OP_Last }; + assert( bRev==0 || bRev==1 ); + assert( omitTable==0 ); + pLevel->op = aStep[bRev]; + pLevel->p1 = iCur; + pLevel->p2 = 1 + sqlite3VdbeAddOp2(v, aStart[bRev], iCur, addrBrk); + pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP; + } + 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; + } + sqlite3ExprIfFalse(pParse, pE, addrCont, SQLITE_JUMPIFNULL); + 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")); + sqlite3ExprCacheClear(pParse); + 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; + } + } + sqlite3ReleaseTempReg(pParse, iReleaseReg); + + 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 +** analysis only. +*/ +char sqlite3_query_plan[BMS*2*40]; /* Text of the join */ +static int nQPlan = 0; /* Next free slow in _query_plan[] */ + +#endif /* SQLITE_TEST */ + + +/* +** Free a WhereInfo structure +*/ +static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){ + 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); + } + sqlite3DbFree(db, pInfo); + } + } + whereClauseClear(pWInfo->pWC); + sqlite3DbFree(db, pWInfo); + } +} + + +/* +** Generate the beginning of the loop used for WHERE clause processing. +** The return value is a pointer to an opaque structure that contains +** information needed to terminate the loop. Later, the calling routine +** should invoke sqlite3WhereEnd() with the return value of this function +** in order to complete the WHERE clause processing. +** +** If an error occurs, this routine returns NULL. +** +** The basic idea is to do a nested loop, one loop for each table in +** the FROM clause of a select. (INSERT and UPDATE statements are the +** same as a SELECT with only a single table in the FROM clause.) For +** example, if the SQL is this: +** +** SELECT * FROM t1, t2, t3 WHERE ...; +** +** Then the code generated is conceptually like the following: +** +** foreach row1 in t1 do \ Code generated +** foreach row2 in t2 do |-- by sqlite3WhereBegin() +** foreach row3 in t3 do / +** ... +** end \ Code generated +** end |-- by sqlite3WhereEnd() +** end / +** +** Note that the loops might not be nested in the order in which they +** appear in the FROM clause if a different order is better able to make +** use of indices. Note also that when the IN operator appears in +** the WHERE clause, it might result in additional nested loops for +** scanning through all values on the right-hand side of the IN. +** +** There are Btree cursors associated with each table. t1 uses cursor +** number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor. +** And so forth. This routine generates code to open those VDBE cursors +** and sqlite3WhereEnd() generates the code to close them. +** +** The code that sqlite3WhereBegin() generates leaves the cursors named +** in pTabList pointing at their appropriate entries. The [...] code +** can use OP_Column and OP_Rowid opcodes on these cursors to extract +** data from the various tables of the loop. +** +** If the WHERE clause is empty, the foreach loops must each scan their +** entire tables. Thus a three-way join is an O(N^3) operation. But if +** the tables have indices and there are terms in the WHERE clause that +** refer to those indices, a complete table scan can be avoided and the +** code will run much faster. Most of the work of this routine is checking +** to see if there are indices that can be used to speed up the loop. +** +** Terms of the WHERE clause are also used to limit which rows actually +** make it to the "..." in the middle of the loop. After each "foreach", +** terms of the WHERE clause that use only terms in that loop and outer +** loops are evaluated and if false a jump is made around all subsequent +** inner loops (or around the "..." if the test occurs within the inner- +** most loop) +** +** OUTER JOINS +** +** An outer join of tables t1 and t2 is conceptally coded as follows: +** +** foreach row1 in t1 do +** flag = 0 +** foreach row2 in t2 do +** start: +** ... +** flag = 1 +** end +** if flag==0 then +** move the row2 cursor to a null row +** goto start +** fi +** end +** +** ORDER BY CLAUSE PROCESSING +** +** *ppOrderBy is a pointer to the ORDER BY clause of a SELECT statement, +** if there is one. If there is no ORDER BY clause or if this routine +** is called from an UPDATE or DELETE statement, then ppOrderBy is NULL. +** +** If an index can be used so that the natural output order of the table +** scan is correct for the ORDER BY clause, then that index is used and +** *ppOrderBy is set to NULL. This is an optimization that prevents an +** unnecessary sort of the result set if an index appropriate for the +** ORDER BY clause already exists. +** +** If the where clause loops cannot be arranged to provide the correct +** output order, then the *ppOrderBy is unchanged. +*/ +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 */ + u16 wctrlFlags /* One of the WHERE_* flags defined in sqliteInt.h */ +){ + int i; /* Loop counter */ + int nByteWInfo; /* Num. bytes allocated for WhereInfo struct */ + WhereInfo *pWInfo; /* Will become the return value of this function */ + Vdbe *v = pParse->pVdbe; /* The virtual database engine */ + Bitmask notReady; /* Cursors that are not yet positioned */ + WhereMaskSet *pMaskSet; /* The expression mask set */ + WhereClause *pWC; /* Decomposition of the WHERE clause */ + 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 */ + sqlite3 *db; /* Database connection */ + + /* The number of tables in the FROM clause is limited by the number of + ** bits in a Bitmask + */ + if( pTabList->nSrc>BMS ){ + sqlite3ErrorMsg(pParse, "at most %d tables in a join", BMS); + return 0; + } + + /* Allocate and initialize the WhereInfo structure that will become the + ** return value. A single allocation is used to store the WhereInfo + ** struct, the contents of WhereInfo.a[], the WhereClause structure + ** and the WhereMaskSet structure. Since WhereClause contains an 8-byte + ** field (type Bitmask) it must be aligned on an 8-byte boundary on + ** some architectures. Hence the ROUND8() below. + */ + db = pParse->db; + nByteWInfo = ROUND8(sizeof(WhereInfo)+(pTabList->nSrc-1)*sizeof(WhereLevel)); + pWInfo = sqlite3DbMallocZero(db, + nByteWInfo + + sizeof(WhereClause) + + sizeof(WhereMaskSet) + ); + if( db->mallocFailed ){ + goto whereBeginError; + } + pWInfo->nLevel = pTabList->nSrc; + pWInfo->pParse = pParse; + pWInfo->pTabList = pTabList; + pWInfo->iBreak = sqlite3VdbeMakeLabel(v); + pWInfo->pWC = pWC = (WhereClause *)&((u8 *)pWInfo)[nByteWInfo]; + 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); + pWhere = 0; + } + + /* Assign a bit from the bitmask to every term in the FROM clause. + ** + ** When assigning bitmask values to FROM clause cursors, it must be + ** the case that if X is the bitmask for the N-th FROM clause term then + ** the bitmask for all FROM clause terms to the left of the N-th term + ** is (X-1). An expression from the ON clause of a LEFT JOIN can use + ** its Expr.iRightJoinTable value to find the bitmask of the right table + ** 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); + } +#ifndef NDEBUG + { + Bitmask toTheLeft = 0; + for(i=0; inSrc; i++){ + Bitmask m = getMask(pMaskSet, pTabList->a[i].iCursor); + assert( (m-1)==toTheLeft ); + toTheLeft |= m; + } + } +#endif + + /* 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); + 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[].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; + 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 j; /* For looping over FROM tables */ + int bestJ = 0; /* The value of j */ + Bitmask m; /* Bitmask value for j or bestJ */ + int once = 0; /* True when first table is seen */ + + memset(&bestPlan, 0, sizeof(bestPlan)); + bestPlan.rCost = 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 best[Virtual]Index() */ + ExprList *pOrderBy; /* ORDER BY clause for index to optimize */ + + doNotReorder = (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0; + if( once && doNotReorder ) break; + m = getMask(pMaskSet, pTabItem->iCursor); + if( (m & notReady)==0 ){ + if( j==iFrom ) iFrom++; + continue; + } + pOrderBy = ((i==0 && ppOrderBy )?*ppOrderBy:0); + + assert( pTabItem->pTab ); +#ifndef SQLITE_OMIT_VIRTUALTABLE + if( IsVirtual(pTabItem->pTab) ){ + sqlite3_index_info **pp = &pWInfo->a[j].pIdxInfo; + bestVirtualIndex(pParse, pWC, pTabItem, notReady, pOrderBy, &sCost, pp); + }else +#endif + { + bestBtreeIndex(pParse, pWC, pTabItem, notReady, pOrderBy, &sCost); + } + if( once==0 || sCost.rCosta[bestJ].iCursor) ); + WHERETRACE(("*** Optimizer selects table %d for loop %d\n", bestJ, + pLevel-pWInfo->a)); + if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){ + *ppOrderBy = 0; + } + andFlags &= bestPlan.plan.wsFlags; + pLevel->plan = bestPlan.plan; + if( bestPlan.plan.wsFlags & WHERE_INDEXED ){ + pLevel->iIdxCur = pParse->nTab++; + }else{ + pLevel->iIdxCur = -1; + } + notReady &= ~getMask(pMaskSet, pTabList->a[bestJ].iCursor); + pLevel->iFrom = (u8)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 ); + } + } + } + WHERETRACE(("*** Optimizer Finished ***\n")); + if( pParse->nErr || 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 ){ + *ppOrderBy = 0; + } + + /* 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 ){ + pWInfo->okOnePass = 1; + pWInfo->a[0].plan.wsFlags &= ~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 */ + int iDb; /* Index of database containing table/index */ + +#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) ){ + 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; + zMsg = sqlite3MAppendf(db, zMsg, "%s VIRTUAL TABLE INDEX %d:%s", zMsg, + pVtabIdx->idxNum, pVtabIdx->idxStr); + } +#endif + if( pLevel->plan.wsFlags & 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 */ + 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 ){ + 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 ){ + int op = pWInfo->okOnePass ? OP_OpenWrite : OP_OpenRead; + sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, op); + if( !pWInfo->okOnePass && pTab->nColcolUsed; + int n = 0; + for(; b; b=b>>1, n++){} + sqlite3VdbeChangeP4(v, sqlite3VdbeCurrentAddr(v)-1, SQLITE_INT_TO_PTR(n), P4_INT32); + assert( n<=pTab->nCol ); + } + }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; + KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); + int iIdxCur = pLevel->iIdxCur; + assert( pIx->pSchema==pTab->pSchema ); + assert( iIdxCur>=0 ); + sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, iDb, + (char*)pKey, P4_KEYINFO_HANDOFF); + VdbeComment((v, "%s", pIx->zName)); + } + sqlite3CodeVerifySchema(pParse, iDb); + } + pWInfo->iTop = sqlite3VdbeCurrentAddr(v); + + /* 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; + } + +#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 + ** is not used, its name is just '{}'. If no index is used + ** the index is listed as "{}". If the primary key is used the + ** index name is '*'. + */ + for(i=0; inSrc; i++){ + char *z; + int n; + pLevel = &pWInfo->a[i]; + pTabItem = &pTabList->a[pLevel->iFrom]; + z = pTabItem->zAlias; + if( z==0 ) z = pTabItem->pTab->zName; + n = sqlite3Strlen30(z); + if( n+nQPlan < sizeof(sqlite3_query_plan)-10 ){ + if( pLevel->plan.wsFlags & 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) ){ + memcpy(&sqlite3_query_plan[nQPlan], "* ", 2); + nQPlan += 2; + }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ + n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName); + if( n+nQPlan < sizeof(sqlite3_query_plan)-2 ){ + memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.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; + } + sqlite3_query_plan[nQPlan] = 0; + nQPlan = 0; +#endif /* SQLITE_TEST // Testing and debugging use only */ + + /* Record the continuation address in the WhereInfo structure. Then + ** clean up and return. + */ + return pWInfo; + + /* Jump here if malloc fails */ +whereBeginError: + whereInfoFree(db, pWInfo); + return 0; +} + +/* +** Generate the end of the WHERE loop. See comments on +** sqlite3WhereBegin() for additional information. +*/ +void sqlite3WhereEnd(WhereInfo *pWInfo){ + Parse *pParse = pWInfo->pParse; + Vdbe *v = pParse->pVdbe; + int i; + WhereLevel *pLevel; + SrcList *pTabList = pWInfo->pTabList; + sqlite3 *db = pParse->db; + + /* Generate loop termination code. + */ + sqlite3ExprCacheClear(pParse); + for(i=pTabList->nSrc-1; i>=0; i--){ + pLevel = &pWInfo->a[i]; + sqlite3VdbeResolveLabel(v, pLevel->addrCont); + 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 ){ + 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); + 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); + } + if( pLevel->op==OP_Return ){ + sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst); + }else{ + sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrFirst); + } + sqlite3VdbeJumpHere(v, addr); + } + } + + /* The "break" point is here, just past the end of the outer loop. + ** Set it. + */ + sqlite3VdbeResolveLabel(v, pWInfo->iBreak); + + /* Close all of the cursors that were opened by sqlite3WhereBegin. + */ + 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 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, + ** as the vdbe level waits until the table is read before actually + ** seeking the table cursor to the record corresponding to the current + ** position in the index. + ** + ** Calls to the code generator in between sqlite3WhereBegin and + ** 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 ){ + int k, j, last; + VdbeOp *pOp; + Index *pIdx = pLevel->plan.u.pIdx; + int useIndexOnly = pLevel->plan.wsFlags & WHERE_IDX_ONLY; + + assert( pIdx!=0 ); + pOp = sqlite3VdbeGetOp(v, pWInfo->iTop); + last = sqlite3VdbeCurrentAddr(v); + for(k=pWInfo->iTop; kp1!=pLevel->iTabCur ) continue; + if( pOp->opcode==OP_Column ){ + for(j=0; jnColumn; j++){ + if( pOp->p2==pIdx->aiColumn[j] ){ + pOp->p2 = j; + pOp->p1 = pLevel->iIdxCur; + break; + } + } + assert(!useIndexOnly || jnColumn); + }else if( pOp->opcode==OP_Rowid ){ + pOp->p1 = pLevel->iIdxCur; + pOp->opcode = OP_IdxRowid; + }else if( pOp->opcode==OP_NullRow && useIndexOnly ){ + pOp->opcode = OP_Noop; + } + } + } + } + + /* Final cleanup + */ + whereInfoFree(db, pWInfo); + return; +} diff --git a/src/alter.c b/src/alter.c index d89b433..11f8452 100644 --- a/src/alter.c +++ b/src/alter.c @@ -12,7 +12,7 @@ ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** -** $Id: alter.c,v 1.55 2009/03/24 15:08:10 drh Exp $ +** $Id: alter.c,v 1.57 2009/04/16 16:30:18 drh Exp $ */ #include "sqliteInt.h" @@ -225,7 +225,7 @@ static void reloadTableSchema(Parse *pParse, Table *pTab, const char *zName){ #endif v = sqlite3GetVdbe(pParse); - if( !v ) return; + if( NEVER(v==0) ) return; assert( sqlite3BtreeHoldsAllMutexes(pParse->db) ); iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); assert( iDb>=0 ); @@ -279,7 +279,7 @@ void sqlite3AlterRenameTable( #endif int isVirtualRename = 0; /* True if this is a v-table with an xRename() */ - if( db->mallocFailed ) goto exit_rename_table; + if( NEVER(db->mallocFailed) ) goto exit_rename_table; assert( pSrc->nSrc==1 ); assert( sqlite3BtreeHoldsAllMutexes(pParse->db) ); @@ -512,7 +512,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ 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==';' || sqlite3Isspace(*zEnd)) ){ *zEnd-- = '\0'; } sqlite3NestedParse(pParse, diff --git a/src/analyze.c b/src/analyze.c index d002805..fd7803b 100644 --- a/src/analyze.c +++ b/src/analyze.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code associated with the ANALYZE command. ** -** @(#) $Id: analyze.c,v 1.51 2009/02/28 10:47:42 danielk1977 Exp $ +** @(#) $Id: analyze.c,v 1.52 2009/04/16 17:45:48 drh Exp $ */ #ifndef SQLITE_OMIT_ANALYZE #include "sqliteInt.h" @@ -100,7 +100,7 @@ static void analyzeOneTable( int iDb; /* Index of database containing pTab */ v = sqlite3GetVdbe(pParse); - if( v==0 || pTab==0 || pTab->pIndex==0 ){ + if( v==0 || NEVER(pTab==0) || pTab->pIndex==0 ){ /* Do no analysis for tables that have no indices */ return; } @@ -300,13 +300,14 @@ void sqlite3Analyze(Parse *pParse, Token *pName1, Token *pName2){ return; } + assert( pName2!=0 || pName1==0 ); if( pName1==0 ){ /* Form 1: Analyze everything */ for(i=0; inDb; i++){ if( i==1 ) continue; /* Do not analyze the TEMP database */ analyzeDatabase(pParse, i); } - }else if( pName2==0 || pName2->n==0 ){ + }else if( pName2->n==0 ){ /* Form 2: Analyze the database or table named */ iDb = sqlite3FindDb(db, pName1); if( iDb>=0 ){ diff --git a/src/attach.c b/src/attach.c index 0f54bcc..c635645 100644 --- a/src/attach.c +++ b/src/attach.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to implement the ATTACH and DETACH commands. ** -** $Id: attach.c,v 1.84 2009/04/08 13:51:51 drh Exp $ +** $Id: attach.c,v 1.90 2009/05/01 06:19:21 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -74,7 +74,6 @@ static void attachFunc( const char *zFile; Db *aNew; char *zErrDyn = 0; - char zErr[128]; UNUSED_PARAMETER(NotUsed); @@ -90,22 +89,20 @@ static void attachFunc( ** * Specified database name already being used. */ if( db->nDb>=db->aLimit[SQLITE_LIMIT_ATTACHED]+2 ){ - sqlite3_snprintf( - sizeof(zErr), zErr, "too many attached databases - max %d", + zErrDyn = sqlite3MPrintf(db, "too many attached databases - max %d", db->aLimit[SQLITE_LIMIT_ATTACHED] ); goto attach_error; } if( !db->autoCommit ){ - sqlite3_snprintf(sizeof(zErr), zErr, - "cannot ATTACH database within transaction"); + zErrDyn = sqlite3MPrintf(db, "cannot ATTACH database within transaction"); goto attach_error; } for(i=0; inDb; i++){ char *z = db->aDb[i].zName; - if( z && zName && sqlite3StrICmp(z, zName)==0 ){ - sqlite3_snprintf(sizeof(zErr), zErr, - "database %s is already in use", zName); + assert( z && zName ); + if( sqlite3StrICmp(z, zName)==0 ){ + zErrDyn = sqlite3MPrintf(db, "database %s is already in use", zName); goto attach_error; } } @@ -122,7 +119,7 @@ static void attachFunc( if( aNew==0 ) return; } db->aDb = aNew; - aNew = &db->aDb[db->nDb++]; + aNew = &db->aDb[db->nDb]; memset(aNew, 0, sizeof(*aNew)); /* Open the database file. If the btree is successfully opened, use @@ -132,15 +129,19 @@ static void attachFunc( rc = sqlite3BtreeFactory(db, zFile, 0, SQLITE_DEFAULT_CACHE_SIZE, db->openFlags | SQLITE_OPEN_MAIN_DB, &aNew->pBt); - if( rc==SQLITE_OK ){ + db->nDb++; + if( rc==SQLITE_CONSTRAINT ){ + rc = SQLITE_ERROR; + zErrDyn = sqlite3MPrintf(db, "database is already attached"); + }else if( rc==SQLITE_OK ){ Pager *pPager; aNew->pSchema = sqlite3SchemaGet(db, aNew->pBt); if( !aNew->pSchema ){ rc = SQLITE_NOMEM; }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){ - sqlite3_snprintf(sizeof(zErr), zErr, + zErrDyn = sqlite3MPrintf(db, "attached databases must use the same text encoding as main database"); - goto attach_error; + rc = SQLITE_ERROR; } pPager = sqlite3BtreePager(aNew->pBt); sqlite3PagerLockingMode(pPager, db->dfltLockMode); @@ -203,9 +204,10 @@ static void attachFunc( db->nDb = iDb; if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){ db->mallocFailed = 1; - sqlite3_snprintf(sizeof(zErr),zErr, "out of memory"); - }else{ - sqlite3_snprintf(sizeof(zErr),zErr, "unable to open database: %s", zFile); + sqlite3DbFree(db, zErrDyn); + zErrDyn = sqlite3MPrintf(db, "out of memory"); + }else if( zErrDyn==0 ){ + zErrDyn = sqlite3MPrintf(db, "unable to open database: %s", zFile); } goto attach_error; } @@ -217,9 +219,6 @@ attach_error: if( zErrDyn ){ sqlite3_result_error(context, zErrDyn, -1); sqlite3DbFree(db, zErrDyn); - }else{ - zErr[sizeof(zErr)-1] = 0; - sqlite3_result_error(context, zErr, -1); } if( rc ) sqlite3_result_error_code(context, rc); } @@ -411,7 +410,7 @@ int sqlite3FixInit( ){ sqlite3 *db; - if( iDb<0 || iDb==1 ) return 0; + if( NEVER(iDb<0) || iDb==1 ) return 0; db = pParse->db; assert( db->nDb>iDb ); pFix->pParse = pParse; @@ -443,7 +442,7 @@ int sqlite3FixSrcList( const char *zDb; struct SrcList_item *pItem; - if( pList==0 ) return 0; + if( NEVER(pList==0) ) return 0; zDb = pFix->zDb; for(i=0, pItem=pList->a; inSrc; i++, pItem++){ if( pItem->zDatabase==0 ){ diff --git a/src/auth.c b/src/auth.c index 5630c23..787acfe 100644 --- a/src/auth.c +++ b/src/auth.c @@ -14,7 +14,7 @@ ** systems that do not need this facility may omit it by recompiling ** the library with -DSQLITE_OMIT_AUTHORIZATION=1 ** -** $Id: auth.c,v 1.29 2007/09/18 15:55:07 drh Exp $ +** $Id: auth.c,v 1.31 2009/05/04 18:01:40 drh Exp $ */ #include "sqliteInt.h" @@ -86,10 +86,8 @@ int sqlite3_set_authorizer( ** Write an error message into pParse->zErrMsg that explains that the ** user-supplied authorization function returned an illegal value. */ -static void sqliteAuthBadReturnCode(Parse *pParse, int rc){ - sqlite3ErrorMsg(pParse, "illegal return value (%d) from the " - "authorization function - should be SQLITE_OK, SQLITE_IGNORE, " - "or SQLITE_DENY", rc); +static void sqliteAuthBadReturnCode(Parse *pParse){ + sqlite3ErrorMsg(pParse, "authorizer malfunction"); pParse->rc = SQLITE_ERROR; } @@ -118,26 +116,30 @@ void sqlite3AuthRead( int iDb; /* The index of the database the expression refers to */ if( db->xAuth==0 ) return; - if( pExpr->op!=TK_COLUMN ) return; + assert( pExpr->op==TK_COLUMN ); iDb = sqlite3SchemaToIndex(pParse->db, pSchema); if( iDb<0 ){ /* An attempt to read a column out of a subquery or other ** temporary table. */ return; } - for(iSrc=0; pTabList && iSrcnSrc; iSrc++){ - if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break; - } - if( iSrc>=0 && pTabList && iSrcnSrc ){ + if( pTabList ){ + for(iSrc=0; ALWAYS(iSrcnSrc); iSrc++){ + if( pExpr->iTable==pTabList->a[iSrc].iCursor ) break; + } + assert( iSrcnSrc ); pTab = pTabList->a[iSrc].pTab; - }else if( (pStack = pParse->trigStack)!=0 ){ - /* This must be an attempt to read the NEW or OLD pseudo-tables - ** of a trigger. - */ - assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx ); - pTab = pStack->pTab; + }else{ + pStack = pParse->trigStack; + if( ALWAYS(pStack) ){ + /* This must be an attempt to read the NEW or OLD pseudo-tables + ** of a trigger. + */ + assert( pExpr->iTable==pStack->newIdx || pExpr->iTable==pStack->oldIdx ); + pTab = pStack->pTab; + } } - if( pTab==0 ) return; + if( NEVER(pTab==0) ) return; if( pExpr->iColumn>=0 ){ assert( pExpr->iColumnnCol ); zCol = pTab->aCol[pExpr->iColumn].zName; @@ -162,7 +164,7 @@ void sqlite3AuthRead( } pParse->rc = SQLITE_AUTH; }else if( rc!=SQLITE_OK ){ - sqliteAuthBadReturnCode(pParse, rc); + sqliteAuthBadReturnCode(pParse); } } @@ -198,7 +200,7 @@ int sqlite3AuthCheck( pParse->rc = SQLITE_AUTH; }else if( rc!=SQLITE_OK && rc!=SQLITE_IGNORE ){ rc = SQLITE_DENY; - sqliteAuthBadReturnCode(pParse, rc); + sqliteAuthBadReturnCode(pParse); } return rc; } @@ -213,11 +215,10 @@ void sqlite3AuthContextPush( AuthContext *pContext, const char *zContext ){ + assert( pParse ); pContext->pParse = pParse; - if( pParse ){ - pContext->zAuthContext = pParse->zAuthContext; - pParse->zAuthContext = zContext; - } + pContext->zAuthContext = pParse->zAuthContext; + pParse->zAuthContext = zContext; } /* diff --git a/src/btree.c b/src/btree.c index d928559..338d99e 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.595 2009/04/11 16:06:15 danielk1977 Exp $ +** $Id: btree.c,v 1.608 2009/05/06 18:57:10 shane Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** See the header comment on "btreeInt.h" for additional information. @@ -762,18 +762,59 @@ void sqlite3BtreeParseCell( ** data header and the local payload, but not any overflow page or ** the space used by the cell pointer. */ +static u16 cellSizePtr(MemPage *pPage, u8 *pCell){ + u8 *pIter = &pCell[pPage->childPtrSize]; + u32 nSize; + +#ifdef SQLITE_DEBUG + /* The value returned by this function should always be the same as + ** the (CellInfo.nSize) value found by doing a full parse of the + ** cell. If SQLITE_DEBUG is defined, an assert() at the bottom of + ** this function verifies that this invariant is not violated. */ + CellInfo debuginfo; + sqlite3BtreeParseCellPtr(pPage, pCell, &debuginfo); +#endif + + if( pPage->intKey ){ + u8 *pEnd; + if( pPage->hasData ){ + pIter += getVarint32(pIter, nSize); + }else{ + nSize = 0; + } + + /* pIter now points at the 64-bit integer key value, a variable length + ** integer. The following block moves pIter to point at the first byte + ** past the end of the key value. */ + pEnd = &pIter[9]; + while( (*pIter++)&0x80 && pIterpPage->maxLocal ){ + int minLocal = pPage->minLocal; + nSize = minLocal + (nSize - minLocal) % (pPage->pBt->usableSize - 4); + if( nSize>pPage->maxLocal ){ + nSize = minLocal; + } + nSize += 4; + } + nSize += (pIter - pCell); + + /* The minimum size of any cell is 4 bytes. */ + if( nSize<4 ){ + nSize = 4; + } + + assert( nSize==debuginfo.nSize ); + return (u16)nSize; +} #ifndef NDEBUG static u16 cellSize(MemPage *pPage, int iCell){ - CellInfo info; - sqlite3BtreeParseCell(pPage, iCell, &info); - return info.nSize; + return cellSizePtr(pPage, findCell(pPage, iCell)); } #endif -static u16 cellSizePtr(MemPage *pPage, u8 *pCell){ - CellInfo info; - sqlite3BtreeParseCellPtr(pPage, pCell, &info); - return info.nSize; -} #ifndef SQLITE_OMIT_AUTOVACUUM /* @@ -920,13 +961,13 @@ static int allocateSpace(MemPage *pPage, int nByte){ if( size>=nByte ){ int x = size - nByte; if( x<4 ){ - /* Remove the slot from the free-list. Update the number of - ** fragmented bytes within the page. */ + /* Remove the slot from the free-list. Update the number of + ** fragmented bytes within the page. */ memcpy(&data[addr], &data[pc], 2); data[hdr+7] = (u8)(nFrag + x); }else{ - /* The slot remains on the free-list. Reduce its size to account - ** for the portion used by the new allocation. */ + /* The slot remains on the free-list. Reduce its size to account + ** for the portion used by the new allocation. */ put2byte(&data[pc+2], x); } return pc + x; @@ -1360,6 +1401,12 @@ static int btreeInvokeBusyHandler(void *pArg){ ** database file will be deleted when sqlite3BtreeClose() is called. ** If zFilename is ":memory:" then an in-memory database is created ** that is automatically destroyed when it is closed. +** +** If the database is already opened in the same database connection +** and we are in shared cache mode, then the open will fail with an +** SQLITE_CONSTRAINT error. We cannot allow two or more BtShared +** objects in the same database connection since doing so will lead +** to problems with locking. */ int sqlite3BtreeOpen( const char *zFilename, /* Name of the file containing the BTree database */ @@ -1425,6 +1472,17 @@ int sqlite3BtreeOpen( assert( pBt->nRef>0 ); if( 0==strcmp(zFullPathname, sqlite3PagerFilename(pBt->pPager)) && sqlite3PagerVfs(pBt->pPager)==pVfs ){ + int iDb; + for(iDb=db->nDb-1; iDb>=0; iDb--){ + Btree *pExisting = db->aDb[iDb].pBt; + if( pExisting && pExisting->pBt==pBt ){ + sqlite3_mutex_leave(mutexShared); + sqlite3_mutex_leave(mutexOpen); + sqlite3_free(zFullPathname); + sqlite3_free(p); + return SQLITE_CONSTRAINT; + } + } p->pBt = pBt; pBt->nRef++; break; @@ -1482,7 +1540,6 @@ int sqlite3BtreeOpen( if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE || ((pBt->pageSize-1)&pBt->pageSize)!=0 ){ pBt->pageSize = 0; - sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); #ifndef SQLITE_OMIT_AUTOVACUUM /* If the magic name ":memory:" will create an in-memory database, then ** leave the autoVacuum mode at 0 (do not auto-vacuum), even if @@ -1504,9 +1561,10 @@ int sqlite3BtreeOpen( pBt->incrVacuum = (get4byte(&zDbHeader[36 + 7*4])?1:0); #endif } + rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); + if( rc ) goto btree_open_out; pBt->usableSize = pBt->pageSize - nReserve; assert( (pBt->pageSize & 7)==0 ); /* 8-byte alignment of pageSize */ - sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); #if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO) /* Add the new BtShared object to the linked list sharable BtShareds. @@ -1950,7 +2008,8 @@ static int lockBtree(BtShared *pBt){ pBt->usableSize = (u16)usableSize; pBt->pageSize = (u16)pageSize; freeTempSpace(pBt); - sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); + rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); + if( rc ) goto page1_init_failed; return SQLITE_OK; } if( usableSize<500 ){ @@ -2029,14 +2088,6 @@ static void unlockBtreeIfUnused(BtShared *pBt){ if( pBt->inTransaction==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){ if( sqlite3PagerRefcount(pBt->pPager)>=1 ){ assert( pBt->pPage1->aData ); -#if 0 - if( pBt->pPage1->aData==0 ){ - MemPage *pPage = pBt->pPage1; - pPage->aData = sqlite3PagerGetData(pPage->pDbPage); - pPage->pBt = pBt; - pPage->pgno = 1; - } -#endif releasePage(pBt->pPage1); } pBt->pPage1 = 0; @@ -2179,7 +2230,7 @@ int sqlite3BtreeBeginTrans(Btree *p, int wrflag){ if( pBt->readOnly ){ rc = SQLITE_READONLY; }else{ - rc = sqlite3PagerBegin(pBt->pPager, wrflag>1); + rc = sqlite3PagerBegin(pBt->pPager,wrflag>1,sqlite3TempInMemory(p->db)); if( rc==SQLITE_OK ){ rc = newDatabase(pBt); } @@ -2629,7 +2680,7 @@ static int autoVacuumCommit(BtShared *pBt){ ** database are written into the database file and flushed to oxide. ** At the end of this call, the rollback journal still exists on the ** disk and we are still holding all locks, so the transaction has not -** committed. See sqlite3BtreeCommit() for the second phase of the +** committed. See sqlite3BtreeCommitPhaseTwo() for the second phase of the ** commit process. ** ** This call is a no-op if no write-transaction is currently active on pBt. @@ -2669,12 +2720,13 @@ int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){ ** Commit the transaction currently in progress. ** ** This routine implements the second phase of a 2-phase commit. The -** sqlite3BtreeSync() routine does the first phase and should be invoked -** prior to calling this routine. The sqlite3BtreeSync() routine did -** all the work of writing information out to disk and flushing the +** sqlite3BtreeCommitPhaseOne() routine does the first phase and should +** be invoked prior to calling this routine. The sqlite3BtreeCommitPhaseOne() +** routine did all the work of writing information out to disk and flushing the ** contents so that they are written onto the disk platter. All this -** routine has to do is delete or truncate the rollback journal -** (which causes the transaction to commit) and drop locks. +** routine has to do is delete or truncate or zero the header in the +** the rollback journal (which causes the transaction to commit) and +** drop locks. ** ** This will release the write lock on the database file. If there ** are no active cursors, it also releases the read lock. @@ -2713,7 +2765,7 @@ int sqlite3BtreeCommitPhaseTwo(Btree *p){ } } - /* Set the handles current transaction state to TRANS_NONE and unlock + /* Set the current transaction state to TRANS_NONE and unlock ** the pager if this call closed the only read or write transaction. */ btreeClearHasContent(pBt); @@ -3869,6 +3921,22 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ assert( cursorHoldsMutex(pCur) ); assert( sqlite3_mutex_held(pCur->pBtree->db->mutex) ); + + /* If the cursor already points to the last entry, this is a no-op. */ + if( CURSOR_VALID==pCur->eState && pCur->atLast ){ +#ifdef SQLITE_DEBUG + /* This block serves to assert() that the cursor really does point + ** to the last entry in the b-tree. */ + int ii; + for(ii=0; iiiPage; ii++){ + assert( pCur->aiIdx[ii]==pCur->apPage[ii]->nCell ); + } + assert( pCur->aiIdx[pCur->iPage]==pCur->apPage[pCur->iPage]->nCell-1 ); + assert( pCur->apPage[pCur->iPage]->leaf ); +#endif + return SQLITE_OK; + } + rc = moveToRoot(pCur); if( rc==SQLITE_OK ){ if( CURSOR_INVALID==pCur->eState ){ @@ -3878,7 +3946,6 @@ int sqlite3BtreeLast(BtCursor *pCur, int *pRes){ assert( pCur->eState==CURSOR_VALID ); *pRes = 0; rc = moveToRightmost(pCur); - getCellInfo(pCur); pCur->atLast = rc==SQLITE_OK ?1:0; } } @@ -3969,14 +4036,13 @@ int sqlite3BtreeMovetoUnpacked( pCur->aiIdx[pCur->iPage] = (u16)((upr+lwr)/2); } for(;;){ - void *pCellKey; - i64 nCellKey; - int idx = pCur->aiIdx[pCur->iPage]; + int idx = pCur->aiIdx[pCur->iPage]; /* Index of current cell in pPage */ + u8 *pCell; /* Pointer to current cell in pPage */ + pCur->info.nSize = 0; - pCur->validNKey = 1; + pCell = findCell(pPage, idx) + pPage->childPtrSize; if( pPage->intKey ){ - u8 *pCell; - pCell = findCell(pPage, idx) + pPage->childPtrSize; + i64 nCellKey; if( pPage->hasData ){ u32 dummy; pCell += getVarint32(pCell, dummy); @@ -3990,26 +4056,50 @@ int sqlite3BtreeMovetoUnpacked( assert( nCellKey>intKey ); c = +1; } + pCur->validNKey = 1; + pCur->info.nKey = nCellKey; }else{ - int available; - pCellKey = (void *)fetchPayload(pCur, &available, 0); - nCellKey = pCur->info.nKey; - if( available>=nCellKey ){ - c = sqlite3VdbeRecordCompare((int)nCellKey, pCellKey, pIdxKey); + /* The maximum supported page-size is 32768 bytes. This means that + ** the maximum number of record bytes stored on an index B-Tree + ** page is at most 8198 bytes, which may be stored as a 2-byte + ** varint. This information is used to attempt to avoid parsing + ** the entire cell by checking for the cases where the record is + ** stored entirely within the b-tree page by inspecting the first + ** 2 bytes of the cell. + */ + int nCell = pCell[0]; + if( !(nCell & 0x80) && nCell<=pPage->maxLocal ){ + /* This branch runs if the record-size field of the cell is a + ** single byte varint and the record fits entirely on the main + ** b-tree page. */ + c = sqlite3VdbeRecordCompare(nCell, (void*)&pCell[1], pIdxKey); + }else if( !(pCell[1] & 0x80) + && (nCell = ((nCell&0x7f)<<7) + pCell[1])<=pPage->maxLocal + ){ + /* The record-size field is a 2 byte varint and the record + ** fits entirely on the main b-tree page. */ + c = sqlite3VdbeRecordCompare(nCell, (void*)&pCell[2], pIdxKey); }else{ - pCellKey = sqlite3Malloc( (int)nCellKey ); + /* The record flows over onto one or more overflow pages. In + ** this case the whole cell needs to be parsed, a buffer allocated + ** and accessPayload() used to retrieve the record into the + ** buffer before VdbeRecordCompare() can be called. */ + void *pCellKey; + u8 * const pCellBody = pCell - pPage->childPtrSize; + sqlite3BtreeParseCellPtr(pPage, pCellBody, &pCur->info); + nCell = (int)pCur->info.nKey; + pCellKey = sqlite3Malloc( nCell ); if( pCellKey==0 ){ rc = SQLITE_NOMEM; goto moveto_finish; } - rc = sqlite3BtreeKey(pCur, 0, (int)nCellKey, (void*)pCellKey); - c = sqlite3VdbeRecordCompare((int)nCellKey, pCellKey, pIdxKey); + rc = accessPayload(pCur, 0, nCell, (unsigned char*)pCellKey, 0, 0); + c = sqlite3VdbeRecordCompare(nCell, pCellKey, pIdxKey); sqlite3_free(pCellKey); if( rc ) goto moveto_finish; } } if( c==0 ){ - pCur->info.nKey = nCellKey; if( pPage->intKey && !pPage->leaf ){ lwr = idx; upr = lwr - 1; @@ -4026,7 +4116,6 @@ int sqlite3BtreeMovetoUnpacked( upr = idx-1; } if( lwr>upr ){ - pCur->info.nKey = nCellKey; break; } pCur->aiIdx[pCur->iPage] = (u16)((lwr+upr)/2); @@ -4987,7 +5076,7 @@ static int insertCell( CellInfo info; sqlite3BtreeParseCellPtr(pPage, pCell, &info); assert( (info.nData+(pPage->intKey?0:info.nKey))==info.nPayload ); - if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){ + if( info.iOverflow ){ Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]); rc = ptrmapPut(pPage->pBt, pgnoOvfl, PTRMAP_OVERFLOW1, pPage->pgno); if( rc!=SQLITE_OK ) return rc; @@ -5010,39 +5099,32 @@ static void assemblePage( u16 *aSize /* Sizes of the cells */ ){ int i; /* Loop counter */ - int totalSize; /* Total size of all cells */ - int hdr; /* Index of page header */ - int cellptr; /* Address of next cell pointer */ + u8 *pCellptr; /* Address of next cell pointer */ int cellbody; /* Address of next cell body */ - u8 *data; /* Data for the page */ + u8 * const data = pPage->aData; /* Pointer to data for pPage */ + const int hdr = pPage->hdrOffset; /* Offset of header on pPage */ + const int nUsable = pPage->pBt->usableSize; /* Usable size of 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 ){ - cellbody = allocateSpace(pPage, totalSize); - assert( cellbody>0 ); - assert( pPage->nFree >= 2*nCell ); - pPage->nFree -= 2*nCell; - for(i=0; ipBt->usableSize ); + + /* Check that the page has just been zeroed by zeroPage() */ + assert( pPage->nCell==0 ); + assert( get2byte(&data[hdr+5])==nUsable ); + + pCellptr = &data[pPage->cellOffset + nCell*2]; + cellbody = nUsable; + for(i=nCell-1; i>=0; i--){ + pCellptr -= 2; + cellbody -= aSize[i]; + put2byte(pCellptr, cellbody); + memcpy(&data[cellbody], apCell[i], aSize[i]); } + put2byte(&data[hdr+3], nCell); + put2byte(&data[hdr+5], cellbody); + pPage->nFree -= (nCell*2 + nUsable - cellbody); pPage->nCell = (u16)nCell; } @@ -6074,16 +6156,28 @@ static int checkForReadConflicts( ** ** For an INTKEY table, only the nKey value of the key is used. pKey is ** ignored. For a ZERODATA table, the pData and nData are both ignored. +** +** If the seekResult parameter is non-zero, then a successful call to +** sqlite3BtreeMoveto() to seek cursor pCur to (pKey, nKey) has already +** been performed. seekResult is the search result returned (a negative +** number if pCur points at an entry that is smaller than (pKey, nKey), or +** a positive value if pCur points at an etry that is larger than +** (pKey, nKey)). +** +** If the seekResult parameter is 0, then cursor pCur may point to any +** entry or to no entry at all. In this case this function has to seek +** the cursor before the new key can be inserted. */ int sqlite3BtreeInsert( BtCursor *pCur, /* Insert data into the table of this cursor */ const void *pKey, i64 nKey, /* The key of the new record */ const void *pData, int nData, /* The data of the new record */ int nZero, /* Number of extra 0 bytes to append to data */ - int appendBias /* True if this is likely an append */ + int appendBias, /* True if this is likely an append */ + int seekResult /* Result of prior sqlite3BtreeMoveto() call */ ){ int rc; - int loc; + int loc = seekResult; int szNew; int idx; MemPage *pPage; @@ -6106,12 +6200,21 @@ int sqlite3BtreeInsert( return pCur->skip; } - /* Save the positions of any other cursors open on this table */ - sqlite3BtreeClearCursor(pCur); - if( - SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) || + /* Save the positions of any other cursors open on this table. + ** + ** In some cases, the call to sqlite3BtreeMoveto() below is a no-op. For + ** example, when inserting data into a table with auto-generated integer + ** keys, the VDBE layer invokes sqlite3BtreeLast() to figure out the + ** integer key to use. It then calls this function to actually insert the + ** data into the intkey B-Tree. In this case sqlite3BtreeMoveto() recognizes + ** that the cursor is already where it needs to be and returns without + ** doing any work. To avoid thwarting these optimizations, it is important + ** not to clear the cursor here. + */ + if( + SQLITE_OK!=(rc = saveAllCursors(pBt, pCur->pgnoRoot, pCur)) || (!loc && SQLITE_OK!=(rc = sqlite3BtreeMoveto(pCur, pKey, nKey, appendBias, &loc)) - ){ + )){ return rc; } @@ -6157,17 +6260,42 @@ int sqlite3BtreeInsert( assert( pPage->leaf ); } rc = insertCell(pPage, idx, newCell, szNew, 0, 0); - if( rc==SQLITE_OK ){ - rc = balance(pCur, 1); - } + assert( rc!=SQLITE_OK || pPage->nCell>0 || pPage->nOverflow>0 ); + /* If no error has occured, call balance() to deal with any overflow and + ** move the cursor to point at the root of the table (since balance may + ** have rearranged the table in such a way as to invalidate BtCursor.apPage[] + ** or BtCursor.aiIdx[]). + ** + ** Except, if all of the following are true, do nothing: + ** + ** * Inserting the new cell did not cause overflow, + ** + ** * Before inserting the new cell the cursor was pointing at the + ** largest key in an intkey B-Tree, and + ** + ** * The key value associated with the new cell is now the largest + ** in the B-Tree. + ** + ** In this case the cursor can be safely left pointing at the (new) + ** largest key value in the B-Tree. Doing so speeds up inserting a set + ** of entries with increasing integer key values via a single cursor + ** (comes up with "INSERT INTO ... SELECT ..." statements), as + ** the next insert operation is not required to seek the cursor. + */ + if( rc==SQLITE_OK + && (pPage->nOverflow || !pCur->atLast || loc>=0 || !pCur->apPage[0]->intKey) + ){ + rc = balance(pCur, 1); + if( rc==SQLITE_OK ){ + moveToRoot(pCur); + } + } + /* 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 ){ - moveToRoot(pCur); - } end_insert: return rc; } @@ -6999,7 +7127,7 @@ static void checkPtrmap( rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent); if( rc!=SQLITE_OK ){ - if( rc==SQLITE_NOMEM ) pCheck->mallocFailed = 1; + if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->mallocFailed = 1; checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild); return; } @@ -7126,7 +7254,7 @@ static int checkTreePage( 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; + if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ) pCheck->mallocFailed = 1; checkAppendMsg(pCheck, zContext, "unable to get the page. error code=%d", rc); return 0; diff --git a/src/btree.h b/src/btree.h index 378c989..b4b7e0d 100644 --- a/src/btree.h +++ b/src/btree.h @@ -13,7 +13,7 @@ ** subsystem. See comments in the source code for a detailed description ** of what each interface routine does. ** -** @(#) $Id: btree.h,v 1.113 2009/04/10 12:55:17 danielk1977 Exp $ +** @(#) $Id: btree.h,v 1.114 2009/05/04 11:42:30 danielk1977 Exp $ */ #ifndef _BTREE_H_ #define _BTREE_H_ @@ -148,7 +148,7 @@ int sqlite3BtreeCursorHasMoved(BtCursor*, int*); int sqlite3BtreeDelete(BtCursor*); int sqlite3BtreeInsert(BtCursor*, const void *pKey, i64 nKey, const void *pData, int nData, - int nZero, int bias); + int nZero, int bias, int seekResult); int sqlite3BtreeFirst(BtCursor*, int *pRes); int sqlite3BtreeLast(BtCursor*, int *pRes); int sqlite3BtreeNext(BtCursor*, int *pRes); diff --git a/src/build.c b/src/build.c index a54efcf..e7f8e62 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.528 2009/04/08 13:51:51 drh Exp $ +** $Id: build.c,v 1.537 2009/05/06 18:42:21 drh Exp $ */ #include "sqliteInt.h" @@ -158,7 +158,9 @@ void sqlite3FinishCoding(Parse *pParse){ if( (mask & pParse->cookieMask)==0 ) continue; sqlite3VdbeUsesBtree(v, iDb); sqlite3VdbeAddOp2(v,OP_Transaction, iDb, (mask & pParse->writeMask)!=0); - sqlite3VdbeAddOp2(v,OP_VerifyCookie, iDb, pParse->cookieValue[iDb]); + if( db->init.busy==0 ){ + sqlite3VdbeAddOp2(v,OP_VerifyCookie, iDb, pParse->cookieValue[iDb]); + } } #ifndef SQLITE_OMIT_VIRTUALTABLE { @@ -188,7 +190,7 @@ void sqlite3FinishCoding(Parse *pParse){ FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0; sqlite3VdbeTrace(v, trace); #endif - assert( pParse->disableColCache==0 ); /* Disables and re-enables match */ + assert( pParse->iCacheLevel==0 ); /* Disables and re-enables match */ sqlite3VdbeMakeReady(v, pParse->nVar, pParse->nMem, pParse->nTab, pParse->explain); pParse->rc = SQLITE_DONE; @@ -259,7 +261,7 @@ Table *sqlite3FindTable(sqlite3 *db, const char *zName, const char *zDatabase){ int i; int nName; assert( zName!=0 ); - nName = sqlite3Strlen(db, zName) + 1; + nName = sqlite3Strlen30(zName); for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ if( zDatabase!=0 && sqlite3StrICmp(zDatabase, db->aDb[j].zName) ) continue; @@ -321,7 +323,7 @@ Table *sqlite3LocateTable( Index *sqlite3FindIndex(sqlite3 *db, const char *zName, const char *zDb){ Index *p = 0; int i; - int nName = sqlite3Strlen(db, zName)+1; + int nName = sqlite3Strlen30(zName); for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ Schema *pSchema = db->aDb[j].pSchema; @@ -357,7 +359,7 @@ static void sqlite3DeleteIndex(Index *p){ const char *zName = p->zName; pOld = sqlite3HashInsert(&p->pSchema->idxHash, zName, - sqlite3Strlen30(zName)+1, 0); + sqlite3Strlen30(zName), 0); assert( pOld==0 || pOld==p ); freeIndex(p); } @@ -373,8 +375,8 @@ void sqlite3UnlinkAndDeleteIndex(sqlite3 *db, int iDb, const char *zIdxName){ int len; Hash *pHash = &db->aDb[iDb].pSchema->idxHash; - len = sqlite3Strlen(db, zIdxName); - pIndex = sqlite3HashInsert(pHash, zIdxName, len+1, 0); + len = sqlite3Strlen30(zIdxName); + pIndex = sqlite3HashInsert(pHash, zIdxName, len, 0); if( pIndex ){ if( pIndex->pTable->pIndex==pIndex ){ pIndex->pTable->pIndex = pIndex->pNext; @@ -487,8 +489,7 @@ static void sqliteResetColumnNames(Table *pTable){ ** Table. No changes are made to disk by this routine. ** ** This routine just deletes the data structure. It does not unlink -** the table data structure from the hash table. Nor does it remove -** foreign keys from the sqlite.aFKey hash table. But it does destroy +** the table data structure from the hash table. But it does destroy ** memory structures of the indices and foreign keys associated with ** the table. */ @@ -516,13 +517,9 @@ void sqlite3DeleteTable(Table *pTable){ } #ifndef SQLITE_OMIT_FOREIGN_KEY - /* Delete all foreign keys associated with this table. The keys - ** should have already been unlinked from the pSchema->aFKey hash table - */ + /* Delete all foreign keys associated with this table. */ for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ pNextFKey = pFKey->pNextFrom; - assert( sqlite3HashFind(&pTable->pSchema->aFKey, - pFKey->zTo, sqlite3Strlen30(pFKey->zTo)+1)!=pFKey ); sqlite3DbFree(db, pFKey); } #endif @@ -546,7 +543,6 @@ void sqlite3DeleteTable(Table *pTable){ */ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){ Table *p; - FKey *pF1, *pF2; Db *pDb; assert( db!=0 ); @@ -554,33 +550,20 @@ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){ assert( zTabName && zTabName[0] ); pDb = &db->aDb[iDb]; p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, - sqlite3Strlen30(zTabName)+1,0); - if( p ){ -#ifndef SQLITE_OMIT_FOREIGN_KEY - for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ - int nTo = sqlite3Strlen30(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; } - if( pF2 ){ - pF2->pNextTo = pF1->pNextTo; - } - } - } -#endif - sqlite3DeleteTable(p); - } + sqlite3Strlen30(zTabName),0); + sqlite3DeleteTable(p); db->flags |= SQLITE_InternChanges; } /* ** Given a token, return a string that consists of the text of that -** token with any quotations removed. Space to hold the returned string +** token. Space to hold the returned string ** is obtained from sqliteMalloc() and must be freed by the calling ** function. ** +** Any quotation marks (ex: "name", 'name', [name], or `name`) that +** surround the body of the token are removed. +** ** Tokens are often just pointers into the original SQL text and so ** are not \000 terminated and are not persistent. The returned string ** is \000 terminated and is persistent. @@ -589,7 +572,7 @@ char *sqlite3NameFromToken(sqlite3 *db, Token *pName){ char *zName; if( pName ){ zName = sqlite3DbStrNDup(db, (char*)pName->z, pName->n); - sqlite3Dequote(zName); + if( pName->quoted ) sqlite3Dequote(zName); }else{ zName = 0; } @@ -1278,7 +1261,7 @@ CollSeq *sqlite3LocateCollSeq(Parse *pParse, const char *zName, int nName){ pColl = sqlite3GetCollSeq(db, pColl, zName, nName); if( !pColl ){ if( nName<0 ){ - nName = sqlite3Strlen(db, zName); + nName = sqlite3Strlen30(zName); } sqlite3ErrorMsg(pParse, "no such collation sequence: %.*s", nName, zName); pColl = 0; @@ -1683,26 +1666,14 @@ void sqlite3EndTable( */ 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); + sqlite3Strlen30(p->zName),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; - pFKey->pNextTo = sqlite3HashFind(&pSchema->aFKey, pFKey->zTo, nTo); - data = sqlite3HashInsert(&pSchema->aFKey, pFKey->zTo, nTo, pFKey); - if( data==(void *)pFKey ){ - db->mallocFailed = 1; - } - } -#endif pParse->pNewTable = 0; db->nTable++; db->flags |= SQLITE_InternChanges; @@ -2209,9 +2180,7 @@ exit_drop_table: ** in the ON DELETE, ON UPDATE and ON INSERT clauses. ** ** An FKey structure is created and added to the table currently -** under construction in the pParse->pNewTable field. The new FKey -** is not linked into db->aFKey at this point - that does not happen -** until sqlite3EndTable(). +** under construction in the pParse->pNewTable field. ** ** The foreign key is set for IMMEDIATE processing. A subsequent call ** to sqlite3DeferForeignKey() might change this to DEFERRED. @@ -2252,7 +2221,7 @@ void sqlite3CreateForeignKey( }else{ nCol = pFromCol->nExpr; } - nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1; + nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1; if( pToCol ){ for(i=0; inExpr; i++){ nByte += sqlite3Strlen30(pToCol->a[i].zName) + 1; @@ -2264,14 +2233,12 @@ void sqlite3CreateForeignKey( } pFKey->pFrom = p; pFKey->pNextFrom = p->pFKey; - z = (char*)&pFKey[1]; - pFKey->aCol = (struct sColMap*)z; - z += sizeof(struct sColMap)*nCol; + z = (char*)&pFKey->aCol[nCol]; pFKey->zTo = z; memcpy(z, pTo->z, pTo->n); z[pTo->n] = 0; + sqlite3Dequote(z); z += pTo->n+1; - pFKey->pNextTo = 0; pFKey->nCol = nCol; if( pFromCol==0 ){ pFKey->aCol[0].iFrom = p->nCol-1; @@ -2388,19 +2355,25 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ regRecord = sqlite3GetTempReg(pParse); regIdxKey = sqlite3GenerateIndexKey(pParse, pIndex, iTab, regRecord, 1); if( pIndex->onError!=OE_None ){ - int j1, j2; - int regRowid; + const int regRowid = regIdxKey + pIndex->nColumn; + const int j2 = sqlite3VdbeCurrentAddr(v) + 2; + void * const pRegKey = SQLITE_INT_TO_PTR(regIdxKey); - regRowid = regIdxKey + pIndex->nColumn; - j1 = sqlite3VdbeAddOp3(v, OP_IsNull, regIdxKey, 0, pIndex->nColumn); - j2 = sqlite3VdbeAddOp4(v, OP_IsUnique, iIdx, - 0, regRowid, SQLITE_INT_TO_PTR(regRecord), P4_INT32); + /* The registers accessed by the OP_IsUnique opcode were allocated + ** using sqlite3GetTempRange() inside of the sqlite3GenerateIndexKey() + ** call above. Just before that function was freed they were released + ** (made available to the compiler for reuse) using + ** sqlite3ReleaseTempRange(). So in some ways having the OP_IsUnique + ** opcode use the values stored within seems dangerous. However, since + ** we can be sure that no other temp registers have been allocated + ** since sqlite3ReleaseTempRange() was called, it is safe to do so. + */ + sqlite3VdbeAddOp4(v, OP_IsUnique, iIdx, j2, regRowid, pRegKey, P4_INT32); sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort, 0, "indexed columns are not unique", P4_STATIC); - sqlite3VdbeJumpHere(v, j1); - sqlite3VdbeJumpHere(v, j2); } sqlite3VdbeAddOp2(v, OP_IdxInsert, iIdx, regRecord); + sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); sqlite3ReleaseTempReg(pParse, regRecord); sqlite3VdbeAddOp2(v, OP_Next, iTab, addr1+1); sqlite3VdbeJumpHere(v, addr1); @@ -2583,6 +2556,7 @@ void sqlite3CreateIndex( if( pList==0 ){ nullId.z = (u8*)pTab->aCol[pTab->nCol-1].zName; nullId.n = sqlite3Strlen30((char*)nullId.z); + nullId.quoted = 0; pList = sqlite3ExprListAppend(pParse, 0, 0, &nullId); if( pList==0 ) goto exit_create_index; pList->a[0].sortOrder = (u8)sortOrder; @@ -2739,7 +2713,7 @@ void sqlite3CreateIndex( if( db->init.busy ){ Index *p; p = sqlite3HashInsert(&pIndex->pSchema->idxHash, - pIndex->zName, sqlite3Strlen30(pIndex->zName)+1, + pIndex->zName, sqlite3Strlen30(pIndex->zName), pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ diff --git a/src/callback.c b/src/callback.c index c4a5280..2c81c95 100644 --- a/src/callback.c +++ b/src/callback.c @@ -13,7 +13,7 @@ ** This file contains functions used to access the internal hash tables ** of user defined functions and collation sequences. ** -** $Id: callback.c,v 1.37 2009/03/24 15:08:10 drh Exp $ +** $Id: callback.c,v 1.39 2009/05/03 20:23:53 drh Exp $ */ #include "sqliteInt.h" @@ -25,7 +25,7 @@ */ static void callCollNeeded(sqlite3 *db, const char *zName, int nName){ assert( !db->xCollNeeded || !db->xCollNeeded16 ); - if( nName<0 ) nName = sqlite3Strlen(db, zName); + if( nName<0 ) nName = sqlite3Strlen30(zName); if( db->xCollNeeded ){ char *zExternal = sqlite3DbStrNDup(db, zName, nName); if( !zExternal ) return; @@ -158,7 +158,7 @@ static CollSeq *findCollSeqEntry( int create ){ CollSeq *pColl; - if( nName<0 ) nName = sqlite3Strlen(db, zName); + if( nName<0 ) nName = sqlite3Strlen30(zName); pColl = sqlite3HashFind(&db->aCollSeq, zName, nName); if( 0==pColl && create ){ @@ -413,14 +413,13 @@ void sqlite3SchemaFree(void *p){ temp1 = pSchema->tblHash; temp2 = pSchema->trigHash; - sqlite3HashInit(&pSchema->trigHash, 0); - sqlite3HashClear(&pSchema->aFKey); + sqlite3HashInit(&pSchema->trigHash); sqlite3HashClear(&pSchema->idxHash); for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ sqlite3DeleteTrigger(0, (Trigger*)sqliteHashData(pElem)); } sqlite3HashClear(&temp2); - sqlite3HashInit(&pSchema->tblHash, 0); + sqlite3HashInit(&pSchema->tblHash); for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ Table *pTab = sqliteHashData(pElem); assert( pTab->dbMem==0 ); @@ -445,10 +444,9 @@ Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){ if( !p ){ db->mallocFailed = 1; }else if ( 0==p->file_format ){ - sqlite3HashInit(&p->tblHash, 0); - sqlite3HashInit(&p->idxHash, 0); - sqlite3HashInit(&p->trigHash, 0); - sqlite3HashInit(&p->aFKey, 1); + sqlite3HashInit(&p->tblHash); + sqlite3HashInit(&p->idxHash); + sqlite3HashInit(&p->trigHash); p->enc = SQLITE_UTF8; } return p; diff --git a/src/complete.c b/src/complete.c index 8e2dbc2..8993cfd 100644 --- a/src/complete.c +++ b/src/complete.c @@ -16,7 +16,7 @@ ** separating it out, the code will be automatically omitted from ** static links that do not use it. ** -** $Id: complete.c,v 1.7 2008/06/13 18:24:27 drh Exp $ +** $Id: complete.c,v 1.8 2009/04/28 04:46:42 drh Exp $ */ #include "sqliteInt.h" #ifndef SQLITE_OMIT_COMPLETE @@ -112,7 +112,7 @@ int sqlite3_complete(const char *zSql){ /* State: ** SEMI WS OTHER EXPLAIN CREATE TEMP TRIGGER END */ /* 0 START: */ { 0, 0, 1, 2, 3, 1, 1, 1, }, /* 1 NORMAL: */ { 0, 1, 1, 1, 1, 1, 1, 1, }, - /* 2 EXPLAIN: */ { 0, 2, 1, 1, 3, 1, 1, 1, }, + /* 2 EXPLAIN: */ { 0, 2, 2, 1, 3, 1, 1, 1, }, /* 3 CREATE: */ { 0, 3, 1, 1, 1, 3, 4, 1, }, /* 4 TRIGGER: */ { 5, 4, 4, 4, 4, 4, 4, 4, }, /* 5 SEMI: */ { 5, 5, 4, 4, 4, 4, 4, 6, }, diff --git a/src/date.c b/src/date.c index 5b1de72..bcd0ea8 100644 --- a/src/date.c +++ b/src/date.c @@ -16,7 +16,7 @@ ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.105 2009/04/03 12:04:37 drh Exp $ +** $Id: date.c,v 1.107 2009/05/03 20:23:53 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 @@ -344,6 +344,7 @@ static int parseDateOrTime( const char *zDate, DateTime *p ){ + int isRealNum; /* Return from sqlite3IsNumber(). Not used */ if( parseYyyyMmDd(zDate,p)==0 ){ return 0; }else if( parseHhMmSs(zDate, p)==0 ){ @@ -351,7 +352,7 @@ static int parseDateOrTime( }else if( sqlite3StrICmp(zDate,"now")==0){ setDateTimeToCurrent(context, p); return 0; - }else if( sqlite3IsNumber(zDate, 0, SQLITE_UTF8) ){ + }else if( sqlite3IsNumber(zDate, &isRealNum, SQLITE_UTF8) ){ double r; getValue(zDate, &r); p->iJD = (sqlite3_int64)(r*86400000.0 + 0.5); @@ -549,7 +550,7 @@ static int parseModifier(const char *zMod, DateTime *p){ ** 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 + 43200)/86400 + 21086676*(i64)10000000; clearYMD_HMS_TZ(p); rc = 0; } diff --git a/src/delete.c b/src/delete.c index 1850ac4..cf0a36e 100644 --- a/src/delete.c +++ b/src/delete.c @@ -12,7 +12,7 @@ ** 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.198 2009/03/05 03:48:07 shane Exp $ +** $Id: delete.c,v 1.201 2009/05/01 21:13:37 drh Exp $ */ #include "sqliteInt.h" @@ -62,26 +62,6 @@ int sqlite3IsReadOnly(Parse *pParse, Table *pTab, int viewOk){ return 0; } -/* -** Generate code that will open a table for reading. -*/ -void sqlite3OpenTable( - Parse *p, /* Generate code into this VDBE */ - int iCur, /* The cursor number of the table */ - int iDb, /* The database index in sqlite3.aDb[] */ - Table *pTab, /* The table to be opened */ - int opcode /* OP_OpenRead or OP_OpenWrite */ -){ - 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); - sqlite3VdbeAddOp3(v, opcode, iCur, pTab->tnum, iDb); - sqlite3VdbeChangeP4(v, -1, SQLITE_INT_TO_PTR(pTab->nCol), P4_INT32); - VdbeComment((v, "%s", pTab->zName)); -} - #if !defined(SQLITE_OMIT_VIEW) && !defined(SQLITE_OMIT_TRIGGER) /* @@ -107,6 +87,7 @@ void sqlite3MaterializeView( pWhere = sqlite3ExprDup(db, pWhere, 0); viewName.z = (u8*)pView->zName; viewName.n = (unsigned int)sqlite3Strlen30((const char*)viewName.z); + viewName.quoted = 0; pFrom = sqlite3SrcListAppendFromTerm(pParse, 0, 0, 0, &viewName, pDup, 0,0); pDup = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0); } @@ -377,10 +358,8 @@ void sqlite3DeleteFrom( */ if( rcauth==SQLITE_OK && pWhere==0 && !pTrigger && !IsVirtual(pTab) ){ assert( !isView ); - sqlite3VdbeAddOp3(v, OP_Clear, pTab->tnum, iDb, memCnt); - if( !pParse->nested ){ - sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_STATIC); - } + sqlite3VdbeAddOp4(v, OP_Clear, pTab->tnum, iDb, memCnt, + pTab->zName, P4_STATIC); for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ assert( pIdx->pSchema==pTab->pSchema ); sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb); @@ -393,13 +372,15 @@ void sqlite3DeleteFrom( { int iRowid = ++pParse->nMem; /* Used for storing rowid values. */ int iRowSet = ++pParse->nMem; /* Register for rowset of rows to delete */ + int regRowid; /* Actual register containing rowids */ /* Collect rowids of every row to be deleted. */ sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, - WHERE_FILL_ROWSET, iRowSet); + pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere,0,WHERE_DUPLICATES_OK); if( pWInfo==0 ) goto delete_from_cleanup; + regRowid = sqlite3ExprCodeGetColumn(pParse, pTab, -1, iCur, iRowid, 0); + sqlite3VdbeAddOp2(v, OP_RowSetAdd, iRowSet, regRowid); if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); } diff --git a/src/expr.c b/src/expr.c index 35a5853..1e3e4b3 100644 --- a/src/expr.c +++ b/src/expr.c @@ -12,7 +12,7 @@ ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.426 2009/04/08 13:51:51 drh Exp $ +** $Id: expr.c,v 1.432 2009/05/06 18:57:10 shane Exp $ */ #include "sqliteInt.h" @@ -407,21 +407,18 @@ Expr *sqlite3Expr( int c; assert( pToken->dyn==0 ); pNew->span = *pToken; - - /* The pToken->z value is read-only. But the new expression - ** node created here might be passed to sqlite3DequoteExpr() which - ** will attempt to modify pNew->token.z. Hence, if the token - ** is quoted, make a copy now so that DequoteExpr() will change - ** the copy rather than the original text. - */ if( pToken->n>=2 && ((c = pToken->z[0])=='\'' || c=='"' || c=='[' || c=='`') ){ sqlite3TokenCopy(db, &pNew->token, pToken); + if( pNew->token.z ){ + pNew->token.n = sqlite3Dequote((char*)pNew->token.z); + assert( pNew->token.n==(unsigned)sqlite3Strlen30((char*)pNew->token.z) ); + } + if( c=='"' ) pNew->flags |= EP_DblQuoted; }else{ pNew->token = *pToken; - pNew->flags |= EP_Dequoted; - VVA_ONLY( pNew->vvaFlags |= EVVA_ReadOnlyToken; ) } + pNew->token.quoted = 0; }else if( pLeft ){ if( pRight ){ if( pRight->span.dyn==0 && pLeft->span.dyn==0 ){ @@ -658,18 +655,6 @@ void sqlite3ExprDelete(sqlite3 *db, Expr *p){ sqlite3DbFree(db, p); } -/* -** The Expr.token field might be a string literal that is quoted. -** If so, remove the quotation marks. -*/ -void sqlite3DequoteExpr(Expr *p){ - if( !ExprHasAnyProperty(p, EP_Dequoted) ){ - ExprSetProperty(p, EP_Dequoted); - assert( (p->vvaFlags & EVVA_ReadOnlyToken)==0 ); - sqlite3Dequote((char*)p->token.z); - } -} - /* ** Return the number of bytes allocated for the expression structure ** passed as the first argument. This is always one of EXPR_FULLSIZE, @@ -1463,7 +1448,7 @@ void sqlite3CodeSubselect( int testAddr = 0; /* One-time test address */ Vdbe *v = sqlite3GetVdbe(pParse); if( v==0 ) return; - + sqlite3ExprCachePush(pParse); /* This code must be run in its entirety every time it is encountered ** if any of the following is true: @@ -1570,11 +1555,7 @@ void sqlite3CodeSubselect( } /* Evaluate the expression and insert it into the temp table */ - pParse->disableColCache++; r3 = sqlite3ExprCodeTarget(pParse, pE2, r1); - assert( pParse->disableColCache>0 ); - pParse->disableColCache--; - if( isRowid ){ sqlite3VdbeAddOp2(v, OP_MustBeInt, r3, sqlite3VdbeCurrentAddr(v)+2); sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3); @@ -1599,7 +1580,7 @@ void sqlite3CodeSubselect( ** value of this select in a memory cell and record the number ** of the memory cell in iColumn. */ - static const Token one = { (u8*)"1", 0, 1 }; + static const Token one = { (u8*)"1", 0, 0, 1 }; Select *pSel; SelectDest dest; @@ -1628,6 +1609,7 @@ void sqlite3CodeSubselect( if( testAddr ){ sqlite3VdbeJumpHere(v, testAddr-1); } + sqlite3ExprCachePop(pParse, 1); return; } @@ -1705,6 +1687,120 @@ static void codeInteger(Vdbe *v, Expr *pExpr, int negFlag, int iMem){ } } +/* +** Clear a cache entry. +*/ +static void cacheEntryClear(Parse *pParse, struct yColCache *p){ + if( p->tempReg ){ + if( pParse->nTempRegaTempReg) ){ + pParse->aTempReg[pParse->nTempReg++] = p->iReg; + } + p->tempReg = 0; + } +} + + +/* +** Record in the column cache that a particular column from a +** particular table is stored in a particular register. +*/ +void sqlite3ExprCacheStore(Parse *pParse, int iTab, int iCol, int iReg){ + int i; + int minLru; + int idxLru; + struct yColCache *p; + + /* First replace any existing entry */ + for(i=0, p=pParse->aColCache; iiReg && p->iTable==iTab && p->iColumn==iCol ){ + cacheEntryClear(pParse, p); + p->iLevel = pParse->iCacheLevel; + p->iReg = iReg; + p->affChange = 0; + p->lru = pParse->iCacheCnt++; + return; + } + } + if( iReg<=0 ) return; + + /* Find an empty slot and replace it */ + for(i=0, p=pParse->aColCache; iiReg==0 ){ + p->iLevel = pParse->iCacheLevel; + p->iTable = iTab; + p->iColumn = iCol; + p->iReg = iReg; + p->affChange = 0; + p->tempReg = 0; + p->lru = pParse->iCacheCnt++; + return; + } + } + + /* Replace the last recently used */ + minLru = 0x7fffffff; + idxLru = -1; + for(i=0, p=pParse->aColCache; ilrulru; + } + } + if( idxLru>=0 ){ + p = &pParse->aColCache[idxLru]; + p->iLevel = pParse->iCacheLevel; + p->iTable = iTab; + p->iColumn = iCol; + p->iReg = iReg; + p->affChange = 0; + p->tempReg = 0; + p->lru = pParse->iCacheCnt++; + return; + } +} + +/* +** Indicate that a register is being overwritten. Purge the register +** from the column cache. +*/ +void sqlite3ExprCacheRemove(Parse *pParse, int iReg){ + int i; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg==iReg ){ + cacheEntryClear(pParse, p); + p->iReg = 0; + } + } +} + +/* +** Remember the current column cache context. Any new entries added +** added to the column cache after this call are removed when the +** corresponding pop occurs. +*/ +void sqlite3ExprCachePush(Parse *pParse){ + pParse->iCacheLevel++; +} + +/* +** Remove from the column cache any entries that were added since the +** the previous N Push operations. In other words, restore the cache +** to the state it was in N Pushes ago. +*/ +void sqlite3ExprCachePop(Parse *pParse, int N){ + int i; + struct yColCache *p; + assert( N>0 ); + assert( pParse->iCacheLevel>=N ); + pParse->iCacheLevel -= N; + for(i=0, p=pParse->aColCache; iiReg && p->iLevel>pParse->iCacheLevel ){ + cacheEntryClear(pParse, p); + p->iReg = 0; + } + } +} /* ** Generate code that will extract the iColumn-th column from @@ -1733,20 +1829,21 @@ int sqlite3ExprCodeGetColumn( int i; struct yColCache *p; - for(i=0, p=pParse->aColCache; inColCache; i++, p++){ - if( p->iTable==iTable && p->iColumn==iColumn + for(i=0, p=pParse->aColCache; iiReg>0 && p->iTable==iTable && p->iColumn==iColumn && (!p->affChange || allowAffChng) ){ #if 0 sqlite3VdbeAddOp0(v, OP_Noop); VdbeComment((v, "OPT: tab%d.col%d -> r%d", iTable, iColumn, p->iReg)); #endif + p->lru = pParse->iCacheCnt++; + p->tempReg = 0; /* This pins the register, but also leaks it */ return p->iReg; } } assert( v!=0 ); if( iColumn<0 ){ - int op = (pTab && IsVirtual(pTab)) ? OP_VRowid : OP_Rowid; - sqlite3VdbeAddOp2(v, op, iTable, iReg); + sqlite3VdbeAddOp2(v, OP_Rowid, iTable, iReg); }else if( pTab==0 ){ sqlite3VdbeAddOp3(v, OP_Column, iTable, iColumn, iReg); }else{ @@ -1759,37 +1856,21 @@ int sqlite3ExprCodeGetColumn( } #endif } - if( pParse->disableColCache==0 ){ - i = pParse->iColCache; - p = &pParse->aColCache[i]; - p->iTable = iTable; - p->iColumn = iColumn; - p->iReg = iReg; - p->affChange = 0; - i++; - if( i>=ArraySize(pParse->aColCache) ) i = 0; - if( i>pParse->nColCache ) pParse->nColCache = i; - pParse->iColCache = i; - } + sqlite3ExprCacheStore(pParse, iTable, iColumn, iReg); return iReg; } /* -** Clear all column cache entries associated with the vdbe -** cursor with cursor number iTable. +** Clear all column cache entries. */ -void sqlite3ExprClearColumnCache(Parse *pParse, int iTable){ - if( iTable<0 ){ - pParse->nColCache = 0; - pParse->iColCache = 0; - }else{ - int i; - for(i=0; inColCache; i++){ - if( pParse->aColCache[i].iTable==iTable ){ - testcase( i==pParse->nColCache-1 ); - pParse->aColCache[i] = pParse->aColCache[--pParse->nColCache]; - pParse->iColCache = pParse->nColCache; - } +void sqlite3ExprCacheClear(Parse *pParse){ + int i; + struct yColCache *p; + + for(i=0, p=pParse->aColCache; iiReg ){ + cacheEntryClear(pParse, p); + p->iReg = 0; } } } @@ -1801,10 +1882,11 @@ void sqlite3ExprClearColumnCache(Parse *pParse, int iTable){ void sqlite3ExprCacheAffinityChange(Parse *pParse, int iStart, int iCount){ int iEnd = iStart + iCount - 1; int i; - for(i=0; inColCache; i++){ - int r = pParse->aColCache[i].iReg; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg; if( r>=iStart && r<=iEnd ){ - pParse->aColCache[i].affChange = 1; + p->affChange = 1; } } } @@ -1815,12 +1897,13 @@ void sqlite3ExprCacheAffinityChange(Parse *pParse, int iStart, int iCount){ */ void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iTo, int nReg){ int i; + struct yColCache *p; if( iFrom==iTo ) return; sqlite3VdbeAddOp3(pParse->pVdbe, OP_Move, iFrom, iTo, nReg); - for(i=0; inColCache; i++){ - int x = pParse->aColCache[i].iReg; + for(i=0, p=pParse->aColCache; iiReg; if( x>=iFrom && xaColCache[i].iReg += iTo-iFrom; + p->iReg += iTo-iFrom; } } } @@ -1843,32 +1926,14 @@ void sqlite3ExprCodeCopy(Parse *pParse, int iFrom, int iTo, int nReg){ */ static int usedAsColumnCache(Parse *pParse, int iFrom, int iTo){ int i; - for(i=0; inColCache; i++){ - int r = pParse->aColCache[i].iReg; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg; if( r>=iFrom && r<=iTo ) return 1; } return 0; } -/* -** There is a value in register iReg. -** -** 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. -*/ -void sqlite3ExprWritableRegister(Parse *pParse, int iReg){ - 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; - } - } - } -} - /* ** If the last instruction coded is an ephemeral copy of any of ** the registers in the nReg registers beginning with iReg, then @@ -1906,6 +1971,7 @@ void sqlite3ExprHardCopy(Parse *pParse, int iReg, int nReg){ ** alias has not yet been computed. */ static int codeAlias(Parse *pParse, int iAlias, Expr *pExpr, int target){ +#if 0 sqlite3 *db = pParse->db; int iReg; if( pParse->nAliasAllocnAlias ){ @@ -1920,7 +1986,7 @@ static int codeAlias(Parse *pParse, int iAlias, Expr *pExpr, int target){ assert( iAlias>0 && iAlias<=pParse->nAlias ); iReg = pParse->aAlias[iAlias-1]; if( iReg==0 ){ - if( pParse->disableColCache ){ + if( pParse->iCacheLevel>0 ){ iReg = sqlite3ExprCodeTarget(pParse, pExpr, target); }else{ iReg = ++pParse->nMem; @@ -1929,6 +1995,10 @@ static int codeAlias(Parse *pParse, int iAlias, Expr *pExpr, int target){ } } return iReg; +#else + UNUSED_PARAMETER(iAlias); + return sqlite3ExprCodeTarget(pParse, pExpr, target); +#endif } /* @@ -1998,8 +2068,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ break; } case TK_STRING: { - sqlite3DequoteExpr(pExpr); - sqlite3VdbeAddOp4(v,OP_String8, 0, target, 0, + sqlite3VdbeAddOp4(v, OP_String8, 0, target, 0, (char*)pExpr->token.z, pExpr->token.n); break; } @@ -2308,9 +2377,8 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ /* Code the from " IN (...)". The temporary table ** pExpr->iTable contains the values that make up the (...) set. */ - pParse->disableColCache++; + sqlite3ExprCachePush(pParse); sqlite3ExprCode(pParse, pExpr->pLeft, target); - pParse->disableColCache--; j2 = sqlite3VdbeAddOp1(v, OP_IsNull, target); if( eType==IN_INDEX_ROWID ){ j3 = sqlite3VdbeAddOp1(v, OP_MustBeInt, target); @@ -2371,6 +2439,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ } sqlite3VdbeJumpHere(v, j2); sqlite3VdbeJumpHere(v, j5); + sqlite3ExprCachePop(pParse, 1); VdbeComment((v, "end IN expr r%d", target)); break; } @@ -2447,6 +2516,7 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ Expr cacheX; /* Cached expression X */ Expr *pX; /* The X expression */ Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */ + VVA_ONLY( int iCacheLevel = pParse->iCacheLevel; ) assert( !ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList ); assert((pExpr->x.pList->nExpr % 2) == 0); @@ -2465,8 +2535,8 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ opCompare.pLeft = &cacheX; pTest = &opCompare; } - pParse->disableColCache++; for(i=0; iop==TK_REGISTER ); sqlite3ExprCode(pParse, aListelem[i+1].pExpr, target); sqlite3VdbeAddOp2(v, OP_Goto, 0, endLabel); + sqlite3ExprCachePop(pParse, 1); sqlite3VdbeResolveLabel(v, nextCase); } if( pExpr->pRight ){ + sqlite3ExprCachePush(pParse); sqlite3ExprCode(pParse, pExpr->pRight, target); + sqlite3ExprCachePop(pParse, 1); }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, target); } + assert( db->mallocFailed || pParse->nErr>0 + || pParse->iCacheLevel==iCacheLevel ); sqlite3VdbeResolveLabel(v, endLabel); - assert( pParse->disableColCache>0 ); - pParse->disableColCache--; break; } #ifndef SQLITE_OMIT_TRIGGER @@ -2503,7 +2576,6 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){ assert( pExpr->affinity==OE_Rollback || pExpr->affinity == OE_Abort || pExpr->affinity == OE_Fail ); - sqlite3DequoteExpr(pExpr); sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->affinity, 0, (char*)pExpr->token.z, pExpr->token.n); } else { @@ -2764,23 +2836,17 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ case TK_AND: { int d2 = sqlite3VdbeMakeLabel(v); testcase( jumpIfNull==0 ); - testcase( pParse->disableColCache==0 ); + sqlite3ExprCachePush(pParse); sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2,jumpIfNull^SQLITE_JUMPIFNULL); - pParse->disableColCache++; sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); - assert( pParse->disableColCache>0 ); - pParse->disableColCache--; sqlite3VdbeResolveLabel(v, d2); + sqlite3ExprCachePop(pParse, 1); break; } case TK_OR: { testcase( jumpIfNull==0 ); - testcase( pParse->disableColCache==0 ); sqlite3ExprIfTrue(pParse, pExpr->pLeft, dest, jumpIfNull); - pParse->disableColCache++; sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull); - assert( pParse->disableColCache>0 ); - pParse->disableColCache--; break; } case TK_NOT: { @@ -2924,24 +2990,18 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){ switch( pExpr->op ){ case TK_AND: { testcase( jumpIfNull==0 ); - testcase( pParse->disableColCache==0 ); sqlite3ExprIfFalse(pParse, pExpr->pLeft, dest, jumpIfNull); - pParse->disableColCache++; sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); - assert( pParse->disableColCache>0 ); - pParse->disableColCache--; break; } case TK_OR: { int d2 = sqlite3VdbeMakeLabel(v); testcase( jumpIfNull==0 ); - testcase( pParse->disableColCache==0 ); + sqlite3ExprCachePush(pParse); sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, jumpIfNull^SQLITE_JUMPIFNULL); - pParse->disableColCache++; sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull); - assert( pParse->disableColCache>0 ); - pParse->disableColCache--; sqlite3VdbeResolveLabel(v, d2); + sqlite3ExprCachePop(pParse, 1); break; } case TK_NOT: { @@ -3277,7 +3337,7 @@ void sqlite3ExprAnalyzeAggList(NameContext *pNC, ExprList *pList){ } /* -** Allocate or deallocate temporary use registers during code generation. +** Allocate a single new register for use to hold some intermediate result. */ int sqlite3GetTempReg(Parse *pParse){ if( pParse->nTempReg==0 ){ @@ -3285,9 +3345,25 @@ int sqlite3GetTempReg(Parse *pParse){ } return pParse->aTempReg[--pParse->nTempReg]; } + +/* +** Deallocate a register, making available for reuse for some other +** purpose. +** +** If a register is currently being used by the column cache, then +** the dallocation is deferred until the column cache line that uses +** the register becomes stale. +*/ void sqlite3ReleaseTempReg(Parse *pParse, int iReg){ if( iReg && pParse->nTempRegaTempReg) ){ - sqlite3ExprWritableRegister(pParse, iReg); + int i; + struct yColCache *p; + for(i=0, p=pParse->aColCache; iiReg==iReg ){ + p->tempReg = 1; + return; + } + } pParse->aTempReg[pParse->nTempReg++] = iReg; } } diff --git a/src/func.c b/src/func.c index 058b158..b7df817 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.231 2009/04/08 23:04:14 drh Exp $ +** $Id: func.c,v 1.234 2009/04/20 12:07:37 drh Exp $ */ #include "sqliteInt.h" #include @@ -1179,12 +1179,14 @@ static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){ p->n++; } +#ifndef SQLITE_OMIT_DEPRECATED /* The sqlite3_aggregate_count() function is deprecated. But just to make ** sure it still operates correctly, verify that its count agrees with our ** internal count when using count(*) and when the total count can be ** expressed as a 32-bit integer. */ assert( argc==1 || p==0 || p->n>0x7fffffff || p->n==sqlite3_aggregate_count(context) ); +#endif } static void countFinalize(sqlite3_context *context){ CountCtx *p; @@ -1258,9 +1260,15 @@ static void groupConcatStep( if( pAccum ){ sqlite3 *db = sqlite3_context_db_handle(context); + int n; pAccum->useMalloc = 1; pAccum->mxAlloc = db->aLimit[SQLITE_LIMIT_LENGTH]; - if( pAccum->nChar ){ +#ifdef SQLITE_OMIT_DEPRECATED + n = context->pMem->n; +#else + n = sqlite3_aggregate_count(context); +#endif + if( n>1 ){ if( argc==2 ){ zSep = (char*)sqlite3_value_text(argv[1]); nSep = sqlite3_value_bytes(argv[1]); diff --git a/src/hash.c b/src/hash.c index 013f41a..9c7b21c 100644 --- a/src/hash.c +++ b/src/hash.c @@ -12,7 +12,7 @@ ** 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.37 2009/05/02 13:29:38 drh Exp $ */ #include "sqliteInt.h" #include @@ -21,12 +21,9 @@ ** fields of the Hash structure. ** ** "pNew" is a pointer to the hash table that is to be initialized. -** "copyKey" is true if the hash table should make its own private -** copy of keys and false if it should just use the supplied pointer. */ -void sqlite3HashInit(Hash *pNew, int copyKey){ +void sqlite3HashInit(Hash *pNew){ assert( pNew!=0 ); - pNew->copyKey = copyKey!=0; pNew->first = 0; pNew->count = 0; pNew->htsize = 0; @@ -48,9 +45,6 @@ void sqlite3HashClear(Hash *pH){ pH->htsize = 0; while( elem ){ HashElem *next_elem = elem->next; - if( pH->copyKey ){ - sqlite3_free(elem->pKey); - } sqlite3_free(elem); elem = next_elem; } @@ -58,25 +52,21 @@ void sqlite3HashClear(Hash *pH){ } /* -** Hash and comparison functions when the mode is SQLITE_HASH_STRING +** The hashing function. */ -static int strHash(const void *pKey, int nKey){ - const char *z = (const char *)pKey; +static unsigned int strHash(const char *z, int nKey){ int h = 0; - if( nKey<=0 ) nKey = sqlite3Strlen30(z); + assert( nKey>=0 ); while( nKey > 0 ){ h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++]; nKey--; } - return h & 0x7fffffff; -} -static int strCompare(const void *pKey1, int n1, const void *pKey2, int n2){ - if( n1!=n2 ) return 1; - return sqlite3StrNICmp((const char*)pKey1,(const char*)pKey2,n1); + return h; } -/* Link an element into the hash table +/* Link pNew element into the hash table pH. If pEntry!=0 then also +** insert pNew into the pEntry hash bucket. */ static void insertElement( Hash *pH, /* The complete hash table */ @@ -84,7 +74,13 @@ static void insertElement( HashElem *pNew /* The element to be inserted */ ){ HashElem *pHead; /* First element already in pEntry */ - pHead = pEntry->chain; + if( pEntry ){ + pHead = pEntry->count ? pEntry->chain : 0; + pEntry->count++; + pEntry->chain = pNew; + }else{ + pHead = 0; + } if( pHead ){ pNew->next = pHead; pNew->prev = pHead->prev; @@ -97,44 +93,45 @@ static void insertElement( pNew->prev = 0; pH->first = pNew; } - pEntry->count++; - pEntry->chain = pNew; } /* Resize the hash table so that it cantains "new_size" buckets. -** "new_size" must be a power of 2. The hash table might fail -** to resize if sqlite3_malloc() fails. +** +** The hash table might fail to resize if sqlite3_malloc() fails or +** if the new size is the same as the prior size. +** Return TRUE if the resize occurs and false if not. */ -static void rehash(Hash *pH, int new_size){ +static int rehash(Hash *pH, unsigned int new_size){ struct _ht *new_ht; /* The new hash table */ HashElem *elem, *next_elem; /* For looping over existing elements */ -#ifdef SQLITE_MALLOC_SOFT_LIMIT +#if SQLITE_MALLOC_SOFT_LIMIT>0 if( new_size*sizeof(struct _ht)>SQLITE_MALLOC_SOFT_LIMIT ){ new_size = SQLITE_MALLOC_SOFT_LIMIT/sizeof(struct _ht); } - if( new_size==pH->htsize ) return; + if( new_size==pH->htsize ) return 0; #endif - /* There is a call to sqlite3_malloc() inside rehash(). If there is - ** already an allocation at pH->ht, then if this malloc() fails it - ** is benign (since failing to resize a hash table is a performance - ** hit only, not a fatal error). + /* The inability to allocates space for a larger hash table is + ** a performance hit but it is not a fatal error. So mark the + ** allocation as a benign. */ - if( pH->htsize>0 ) sqlite3BeginBenignMalloc(); - new_ht = (struct _ht *)sqlite3MallocZero( new_size*sizeof(struct _ht) ); - if( pH->htsize>0 ) sqlite3EndBenignMalloc(); + sqlite3BeginBenignMalloc(); + new_ht = (struct _ht *)sqlite3Malloc( new_size*sizeof(struct _ht) ); + sqlite3EndBenignMalloc(); - if( new_ht==0 ) return; + if( new_ht==0 ) return 0; sqlite3_free(pH->ht); pH->ht = new_ht; - pH->htsize = new_size; + pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht); + memset(new_ht, 0, new_size*sizeof(struct _ht)); for(elem=pH->first, pH->first=0; elem; elem = next_elem){ - int h = strHash(elem->pKey, elem->nKey) & (new_size-1); + unsigned int h = strHash(elem->pKey, elem->nKey) % new_size; next_elem = elem->next; insertElement(pH, &new_ht[h], elem); } + return 1; } /* This function (for internal use only) locates an element in an @@ -143,9 +140,9 @@ static void rehash(Hash *pH, int new_size){ */ static HashElem *findElementGivenHash( const Hash *pH, /* The pH to be searched */ - const void *pKey, /* The key we are searching for */ - int nKey, - int h /* The hash for this key. */ + const char *pKey, /* The key we are searching for */ + int nKey, /* Bytes in key (not counting zero terminator) */ + unsigned int h /* The hash for this key. */ ){ HashElem *elem; /* Used to loop thru the element list */ int count; /* Number of elements left to test */ @@ -154,12 +151,15 @@ static HashElem *findElementGivenHash( struct _ht *pEntry = &pH->ht[h]; elem = pEntry->chain; count = pEntry->count; - while( count-- && elem ){ - if( strCompare(elem->pKey,elem->nKey,pKey,nKey)==0 ){ - return elem; - } - elem = elem->next; + }else{ + elem = pH->first; + count = pH->count; + } + while( count-- && ALWAYS(elem) ){ + if( elem->nKey==nKey && sqlite3StrNICmp(elem->pKey,pKey,nKey)==0 ){ + return elem; } + elem = elem->next; } return 0; } @@ -170,7 +170,7 @@ static HashElem *findElementGivenHash( static void removeElementGivenHash( Hash *pH, /* The pH containing "elem" */ HashElem* elem, /* The element to be removed from the pH */ - int h /* Hash value for the element */ + unsigned int h /* Hash value for the element */ ){ struct _ht *pEntry; if( elem->prev ){ @@ -181,16 +181,13 @@ static void removeElementGivenHash( if( elem->next ){ elem->next->prev = elem->prev; } - pEntry = &pH->ht[h]; - if( pEntry->chain==elem ){ - pEntry->chain = elem->next; - } - pEntry->count--; - if( pEntry->count<=0 ){ - pEntry->chain = 0; - } - if( pH->copyKey ){ - sqlite3_free(elem->pKey); + if( pH->ht ){ + pEntry = &pH->ht[h]; + if( pEntry->chain==elem ){ + pEntry->chain = elem->next; + } + pEntry->count--; + assert( pEntry->count>=0 ); } sqlite3_free( elem ); pH->count--; @@ -201,28 +198,23 @@ static void removeElementGivenHash( } } -/* Attempt to locate an element of the hash table pH with a key -** that matches pKey,nKey. Return a pointer to the corresponding -** HashElem structure for this element if it is found, or NULL -** otherwise. -*/ -HashElem *sqlite3HashFindElem(const Hash *pH, const void *pKey, int nKey){ - int h; /* A hash on key */ - HashElem *elem; /* The element that matches key */ - - if( pH==0 || pH->ht==0 ) return 0; - h = strHash(pKey,nKey); - elem = findElementGivenHash(pH,pKey,nKey, h % pH->htsize); - return elem; -} - /* Attempt to locate an element of the hash table pH with a key ** that matches pKey,nKey. Return the data for this element if it is ** found, or NULL if there is no match. */ -void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){ +void *sqlite3HashFind(const Hash *pH, const char *pKey, int nKey){ HashElem *elem; /* The element that matches key */ - elem = sqlite3HashFindElem(pH, pKey, nKey); + unsigned int h; /* A hash on key */ + + assert( pH!=0 ); + assert( pKey!=0 ); + assert( nKey>=0 ); + if( pH->ht ){ + h = strHash(pKey, nKey) % pH->htsize; + }else{ + h = 0; + } + elem = findElementGivenHash(pH, pKey, nKey, h); return elem ? elem->data : 0; } @@ -230,8 +222,7 @@ void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){ ** and the data is "data". ** ** If no element exists with a matching key, then a new -** element is created. A copy of the key is made if the copyKey -** flag is set. NULL is returned. +** element is created and NULL is returned. ** ** If another element already exists with the same key, then the ** new data replaces the old data and the old data is returned. @@ -241,63 +232,47 @@ void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){ ** If the "data" parameter to this function is NULL, then the ** element corresponding to "key" is removed from the hash table. */ -void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){ - int hraw; /* Raw hash value of the key */ - int h; /* the hash of the key modulo hash table size */ +void *sqlite3HashInsert(Hash *pH, const char *pKey, int nKey, void *data){ + unsigned int h; /* the hash of the key modulo hash table size */ HashElem *elem; /* Used to loop thru the element list */ HashElem *new_elem; /* New element added to the pH */ assert( pH!=0 ); - hraw = strHash(pKey, nKey); + assert( pKey!=0 ); + assert( nKey>=0 ); if( pH->htsize ){ - h = hraw % pH->htsize; - elem = findElementGivenHash(pH,pKey,nKey,h); - if( elem ){ - void *old_data = elem->data; - if( data==0 ){ - removeElementGivenHash(pH,elem,h); - }else{ - elem->data = data; - if( !pH->copyKey ){ - elem->pKey = (void *)pKey; - } - assert(nKey==elem->nKey); - } - return old_data; + h = strHash(pKey, nKey) % pH->htsize; + }else{ + h = 0; + } + elem = findElementGivenHash(pH,pKey,nKey,h); + if( elem ){ + void *old_data = elem->data; + if( data==0 ){ + removeElementGivenHash(pH,elem,h); + }else{ + elem->data = data; + elem->pKey = pKey; + assert(nKey==elem->nKey); } + return old_data; } if( data==0 ) return 0; new_elem = (HashElem*)sqlite3Malloc( sizeof(HashElem) ); if( new_elem==0 ) return data; - if( pH->copyKey && pKey!=0 ){ - new_elem->pKey = sqlite3Malloc( nKey ); - if( new_elem->pKey==0 ){ - sqlite3_free(new_elem); - return data; - } - memcpy((void*)new_elem->pKey, pKey, nKey); - }else{ - new_elem->pKey = (void*)pKey; - } + new_elem->pKey = pKey; new_elem->nKey = nKey; + new_elem->data = data; pH->count++; - if( pH->htsize==0 ){ - rehash(pH, 128/sizeof(pH->ht[0])); - if( pH->htsize==0 ){ - pH->count = 0; - if( pH->copyKey ){ - sqlite3_free(new_elem->pKey); - } - sqlite3_free(new_elem); - return data; + if( pH->count>=10 && pH->count > 2*pH->htsize ){ + if( rehash(pH, pH->count*2) && pH->htsize ){ + h = strHash(pKey, nKey) % pH->htsize; } } - if( pH->count > pH->htsize ){ - rehash(pH,pH->htsize*2); + if( pH->ht ){ + insertElement(pH, &pH->ht[h], new_elem); + }else{ + insertElement(pH, 0, new_elem); } - assert( pH->htsize>0 ); - h = hraw % pH->htsize; - insertElement(pH, &pH->ht[h], new_elem); - new_elem->data = data; return 0; } diff --git a/src/hash.h b/src/hash.h index 16b391f..959f509 100644 --- a/src/hash.h +++ b/src/hash.h @@ -12,7 +12,7 @@ ** This is the header file for the generic hash-table implemenation ** used in SQLite. ** -** $Id: hash.h,v 1.12 2008/10/10 17:41:29 drh Exp $ +** $Id: hash.h,v 1.15 2009/05/02 13:29:38 drh Exp $ */ #ifndef _SQLITE_HASH_H_ #define _SQLITE_HASH_H_ @@ -25,13 +25,25 @@ typedef struct HashElem HashElem; ** The internals of this structure are intended to be opaque -- client ** code should not attempt to access or modify the fields of this structure ** directly. Change this structure only by using the routines below. -** However, many of the "procedures" and "functions" for modifying and +** However, some of the "procedures" and "functions" for modifying and ** accessing this structure are really macros, so we can't really make ** this structure opaque. +** +** All elements of the hash table are on a single doubly-linked list. +** Hash.first points to the head of this list. +** +** There are Hash.htsize buckets. Each bucket points to a spot in +** the global doubly-linked list. The contents of the bucket are the +** element pointed to plus the next _ht.count-1 elements in the list. +** +** Hash.htsize and Hash.ht may be zero. In that case lookup is done +** by a linear search of the global list. For small tables, the +** Hash.ht table is never allocated because if there are few elements +** in the table, it is faster to do a linear search than to manage +** the hash table. */ struct Hash { - unsigned int copyKey: 1; /* True if copy of key made on insert */ - unsigned int htsize : 31; /* Number of buckets in the hash table */ + unsigned int htsize; /* Number of buckets in the hash table */ unsigned int count; /* Number of entries in this table */ HashElem *first; /* The first element of the array */ struct _ht { /* the hash table */ @@ -47,18 +59,17 @@ struct Hash { ** be opaque because it is used by macros. */ struct HashElem { - HashElem *next, *prev; /* Next and previous elements in the table */ - void *data; /* Data associated with this element */ - void *pKey; int nKey; /* Key associated with this element */ + HashElem *next, *prev; /* Next and previous elements in the table */ + void *data; /* Data associated with this element */ + const char *pKey; int nKey; /* Key associated with this element */ }; /* ** Access routines. To delete, insert a NULL pointer. */ -void sqlite3HashInit(Hash*, int copyKey); -void *sqlite3HashInsert(Hash*, const void *pKey, int nKey, void *pData); -void *sqlite3HashFind(const Hash*, const void *pKey, int nKey); -HashElem *sqlite3HashFindElem(const Hash*, const void *pKey, int nKey); +void sqlite3HashInit(Hash*); +void *sqlite3HashInsert(Hash*, const char *pKey, int nKey, void *pData); +void *sqlite3HashFind(const Hash*, const char *pKey, int nKey); void sqlite3HashClear(Hash*); /* @@ -76,12 +87,12 @@ void sqlite3HashClear(Hash*); #define sqliteHashFirst(H) ((H)->first) #define sqliteHashNext(E) ((E)->next) #define sqliteHashData(E) ((E)->data) -#define sqliteHashKey(E) ((E)->pKey) -#define sqliteHashKeysize(E) ((E)->nKey) +/* #define sqliteHashKey(E) ((E)->pKey) // NOT USED */ +/* #define sqliteHashKeysize(E) ((E)->nKey) // NOT USED */ /* ** Number of entries in a hash table */ -#define sqliteHashCount(H) ((H)->count) +/* #define sqliteHashCount(H) ((H)->count) // NOT USED */ #endif /* _SQLITE_HASH_H_ */ diff --git a/src/insert.c b/src/insert.c index 9b23c86..89c5df6 100644 --- a/src/insert.c +++ b/src/insert.c @@ -12,10 +12,30 @@ ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** -** $Id: insert.c,v 1.260 2009/02/28 10:47:42 danielk1977 Exp $ +** $Id: insert.c,v 1.267 2009/05/04 11:42:30 danielk1977 Exp $ */ #include "sqliteInt.h" +/* +** Generate code that will open a table for reading. +*/ +void sqlite3OpenTable( + Parse *p, /* Generate code into this VDBE */ + int iCur, /* The cursor number of the table */ + int iDb, /* The database index in sqlite3.aDb[] */ + Table *pTab, /* The table to be opened */ + int opcode /* OP_OpenRead or OP_OpenWrite */ +){ + 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); + sqlite3VdbeAddOp3(v, opcode, iCur, pTab->tnum, iDb); + sqlite3VdbeChangeP4(v, -1, SQLITE_INT_TO_PTR(pTab->nCol), P4_INT32); + VdbeComment((v, "%s", pTab->zName)); +} + /* ** Set P4 of the most recently inserted opcode to a column affinity ** string for index pIdx. A column affinity string has one character @@ -415,7 +435,7 @@ void sqlite3Insert( */ assert( pTabList->nSrc==1 ); zTab = pTabList->a[0].zName; - if( zTab==0 ) goto insert_cleanup; + if( NEVER(zTab==0) ) goto insert_cleanup; pTab = sqlite3SrcListLookup(pParse, pTabList); if( pTab==0 ){ goto insert_cleanup; @@ -537,7 +557,8 @@ void sqlite3Insert( /* Resolve the expressions in the SELECT statement and execute it. */ rc = sqlite3Select(pParse, pSelect, &dest); - if( rc || pParse->nErr || db->mallocFailed ){ + assert( pParse->nErr==0 || rc ); + if( rc || NEVER(pParse->nErr) || db->mallocFailed ){ goto insert_cleanup; } sqlite3VdbeAddOp2(v, OP_Integer, 1, regEof); /* EOF <- 1 */ @@ -623,7 +644,7 @@ void sqlite3Insert( if( pColumn==0 && nColumn && nColumn!=(pTab->nCol-nHidden) ){ sqlite3ErrorMsg(pParse, "table %S has %d columns but %d values were supplied", - pTabList, 0, pTab->nCol, nColumn); + pTabList, 0, pTab->nCol-nHidden, nColumn); goto insert_cleanup; } if( pColumn!=0 && nColumn!=pColumn->nId ){ @@ -761,12 +782,14 @@ void sqlite3Insert( regTrigRowid = sqlite3GetTempReg(pParse); if( keyColumn<0 ){ sqlite3VdbeAddOp2(v, OP_Integer, -1, regTrigRowid); - }else if( useTempTable ){ - sqlite3VdbeAddOp3(v, OP_Column, srcTab, keyColumn, regTrigRowid); }else{ int j1; - assert( pSelect==0 ); /* Otherwise useTempTable is true */ - sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regTrigRowid); + if( useTempTable ){ + sqlite3VdbeAddOp3(v, OP_Column, srcTab, keyColumn, regTrigRowid); + }else{ + 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); sqlite3VdbeJumpHere(v, j1); @@ -840,7 +863,7 @@ void sqlite3Insert( VdbeOp *pOp; sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regRowid); pOp = sqlite3VdbeGetOp(v, sqlite3VdbeCurrentAddr(v) - 1); - if( pOp && pOp->opcode==OP_Null && !IsVirtual(pTab) ){ + if( ALWAYS(pOp) && pOp->opcode==OP_Null && !IsVirtual(pTab) ){ appendFlag = 1; pOp->opcode = OP_NewRowid; pOp->p1 = baseCur; @@ -920,27 +943,14 @@ void sqlite3Insert( }else #endif { - sqlite3GenerateConstraintChecks( - pParse, - pTab, - baseCur, - regIns, - aRegIdx, - keyColumn>=0, - 0, - onError, - endOfLoop + int isReplace; /* Set to true if constraints may cause a replace */ + sqlite3GenerateConstraintChecks(pParse, pTab, baseCur, regIns, aRegIdx, + keyColumn>=0, 0, onError, endOfLoop, &isReplace ); sqlite3CompleteInsertion( - pParse, - pTab, - baseCur, - regIns, - aRegIdx, - 0, - (tmask&TRIGGER_AFTER) ? newIdx : -1, - appendFlag - ); + pParse, pTab, baseCur, regIns, aRegIdx, 0, + (tmask&TRIGGER_AFTER) ? newIdx : -1, appendFlag, isReplace==0 + ); } } @@ -1090,18 +1100,19 @@ void sqlite3GenerateConstraintChecks( int rowidChng, /* True if the rowid might collide with existing entry */ int isUpdate, /* True for UPDATE, False for INSERT */ int overrideError, /* Override onError to this if not OE_Default */ - int ignoreDest /* Jump to this label on an OE_Ignore resolution */ + int ignoreDest, /* Jump to this label on an OE_Ignore resolution */ + int *pbMayReplace /* OUT: Set to true if constraint may cause a replace */ ){ - int i; - Vdbe *v; - int nCol; - int onError; + int i; /* loop counter */ + Vdbe *v; /* VDBE under constrution */ + int nCol; /* Number of columns */ + int onError; /* Conflict resolution strategy */ int j1; /* Addresss of jump instruction */ int j2 = 0, j3; /* Addresses of jump instructions */ int regData; /* Register containing first data column */ - int iCur; - Index *pIdx; - int seenReplace = 0; + int iCur; /* Table cursor number */ + Index *pIdx; /* Pointer to one of the indices */ + int seenReplace = 0; /* True if REPLACE is used to resolve INT PK conflict */ int hasTwoRowids = (isUpdate && rowidChng); v = sqlite3GetVdbe(pParse); @@ -1145,7 +1156,8 @@ void sqlite3GenerateConstraintChecks( sqlite3VdbeAddOp2(v, OP_IsNull, regData+i, ignoreDest); break; } - case OE_Replace: { + default: { + assert( onError==OE_Replace ); j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regData+i); sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regData+i); sqlite3VdbeJumpHere(v, j1); @@ -1242,11 +1254,13 @@ void sqlite3GenerateConstraintChecks( sqlite3VdbeAddOp3(v, OP_MakeRecord, regIdx, pIdx->nColumn+1, aRegIdx[iCur]); sqlite3IndexAffinityStr(v, pIdx); sqlite3ExprCacheAffinityChange(pParse, regIdx, pIdx->nColumn+1); - sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1); /* Find out what action to take in case there is an indexing conflict */ onError = pIdx->onError; - if( onError==OE_None ) continue; /* pIdx is not a UNIQUE index */ + if( onError==OE_None ){ + sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1); + continue; /* pIdx is not a UNIQUE index */ + } if( overrideError!=OE_Default ){ onError = overrideError; }else if( onError==OE_Default ){ @@ -1259,12 +1273,12 @@ void sqlite3GenerateConstraintChecks( /* Check to see if the new index entry will be unique */ - j2 = sqlite3VdbeAddOp3(v, OP_IsNull, regIdx, 0, pIdx->nColumn); regR = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp2(v, OP_SCopy, regRowid-hasTwoRowids, regR); j3 = sqlite3VdbeAddOp4(v, OP_IsUnique, baseCur+iCur+1, 0, - regR, SQLITE_INT_TO_PTR(aRegIdx[iCur]), + regR, SQLITE_INT_TO_PTR(regIdx), P4_INT32); + sqlite3ReleaseTempRange(pParse, regIdx, pIdx->nColumn+1); /* Generate code that executes if the new index entry is not unique */ assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail @@ -1273,30 +1287,25 @@ void sqlite3GenerateConstraintChecks( case OE_Rollback: case OE_Abort: case OE_Fail: { - int j, n1, n2; - char zErrMsg[200]; - sqlite3_snprintf(ArraySize(zErrMsg), zErrMsg, - pIdx->nColumn>1 ? "columns " : "column "); - n1 = sqlite3Strlen30(zErrMsg); - for(j=0; jnColumn && n1db; + zSep = pIdx->nColumn>1 ? "columns " : "column "; + for(j=0; jnColumn; j++){ char *zCol = pTab->aCol[pIdx->aiColumn[j]].zName; - n2 = sqlite3Strlen30(zCol); - if( j>0 ){ - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], ", "); - n1 += 2; - } - if( n1+n2>ArraySize(zErrMsg)-30 ){ - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], "..."); - n1 += 3; - break; - }else{ - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], "%s", zCol); - n1 += n2; - } + sqlite3StrAccumAppend(&errMsg, zSep, -1); + zSep = ", "; + sqlite3StrAccumAppend(&errMsg, zCol, -1); } - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], - pIdx->nColumn>1 ? " are not unique" : " is not unique"); - sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, onError, 0, zErrMsg,0); + sqlite3StrAccumAppend(&errMsg, + pIdx->nColumn>1 ? " are not unique" : " is not unique", -1); + zErr = sqlite3StrAccumFinish(&errMsg); + sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, onError, 0, zErr, 0); + sqlite3DbFree(errMsg.db, zErr); break; } case OE_Ignore: { @@ -1304,16 +1313,20 @@ void sqlite3GenerateConstraintChecks( sqlite3VdbeAddOp2(v, OP_Goto, 0, ignoreDest); break; } - case OE_Replace: { + default: { + assert( onError==OE_Replace ); sqlite3GenerateRowDelete(pParse, pTab, baseCur, regR, 0); seenReplace = 1; break; } } - sqlite3VdbeJumpHere(v, j2); sqlite3VdbeJumpHere(v, j3); sqlite3ReleaseTempReg(pParse, regR); } + + if( pbMayReplace ){ + *pbMayReplace = seenReplace; + } } /* @@ -1333,7 +1346,8 @@ void sqlite3CompleteInsertion( int *aRegIdx, /* Register used by each index. 0 for unused indices */ 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 appendBias, /* True if this is likely to be an append */ + int useSeekResult /* True to set the USESEEKRESULT flag on OP_[Idx]Insert */ ){ int i; Vdbe *v; @@ -1350,6 +1364,9 @@ void sqlite3CompleteInsertion( for(i=nIdx-1; i>=0; i--){ if( aRegIdx[i]==0 ) continue; sqlite3VdbeAddOp2(v, OP_IdxInsert, baseCur+i+1, aRegIdx[i]); + if( useSeekResult ){ + sqlite3VdbeChangeP5(v, OPFLAG_USESEEKRESULT); + } } regData = regRowid + 1; regRec = sqlite3GetTempReg(pParse); @@ -1370,6 +1387,9 @@ void sqlite3CompleteInsertion( if( appendBias ){ pik_flags |= OPFLAG_APPEND; } + if( useSeekResult ){ + pik_flags |= OPFLAG_USESEEKRESULT; + } sqlite3VdbeAddOp3(v, OP_Insert, baseCur, regRec, regRowid); if( !pParse->nested ){ sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_STATIC); @@ -1407,7 +1427,7 @@ int sqlite3OpenTableAndIndices( (char*)pKey, P4_KEYINFO_HANDOFF); VdbeComment((v, "%s", pIdx->zName)); } - if( pParse->nTab<=baseCur+i ){ + if( pParse->nTabnTab = baseCur+i; } return i-1; @@ -1467,7 +1487,7 @@ static int xferCompatibleIndex(Index *pDest, Index *pSrc){ if( pSrc->aSortOrder[i]!=pDest->aSortOrder[i] ){ return 0; /* Different sort orders */ } - if( pSrc->azColl[i]!=pDest->azColl[i] ){ + if( !xferCompatibleCollation(pSrc->azColl[i],pDest->azColl[i]) ){ return 0; /* Different collating sequences */ } } @@ -1698,7 +1718,7 @@ static int xferOptimization( sqlite3VdbeAddOp2(v, OP_Next, iSrc, addr1); autoIncEnd(pParse, iDbDest, pDest, regAutoinc); for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){ - for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){ + for(pSrcIdx=pSrc->pIndex; ALWAYS(pSrcIdx); pSrcIdx=pSrcIdx->pNext){ if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break; } assert( pSrcIdx ); diff --git a/src/legacy.c b/src/legacy.c index 75de5dc..7b27ec0 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: legacy.c,v 1.32 2009/03/19 18:51:07 danielk1977 Exp $ +** $Id: legacy.c,v 1.33 2009/05/05 20:02:48 drh Exp $ */ #include "sqliteInt.h" @@ -36,13 +36,12 @@ int sqlite3_exec( void *pArg, /* First argument to xCallback() */ char **pzErrMsg /* Write error messages here */ ){ - int rc = SQLITE_OK; - const char *zLeftover; - sqlite3_stmt *pStmt = 0; - char **azCols = 0; - - int nRetry = 0; - int nCallback; + int rc = SQLITE_OK; /* Return code */ + const char *zLeftover; /* Tail of unprocessed SQL */ + sqlite3_stmt *pStmt = 0; /* The current SQL statement */ + char **azCols = 0; /* Names of result columns */ + int nRetry = 0; /* Number of retry attempts */ + int callbackIsInit; /* True if callback data is initialized */ if( zSql==0 ) zSql = ""; @@ -64,7 +63,7 @@ int sqlite3_exec( continue; } - nCallback = 0; + callbackIsInit = 0; nCol = sqlite3_column_count(pStmt); while( 1 ){ @@ -73,13 +72,12 @@ int sqlite3_exec( /* Invoke the callback function if required */ if( xCallback && (SQLITE_ROW==rc || - (SQLITE_DONE==rc && !nCallback && db->flags&SQLITE_NullCallback)) ){ - if( 0==nCallback ){ + (SQLITE_DONE==rc && !callbackIsInit + && db->flags&SQLITE_NullCallback)) ){ + if( !callbackIsInit ){ + azCols = sqlite3DbMallocZero(db, 2*nCol*sizeof(const char*) + 1); if( azCols==0 ){ - azCols = sqlite3DbMallocZero(db, 2*nCol*sizeof(const char*) + 1); - if( azCols==0 ){ - goto exec_out; - } + goto exec_out; } for(i=0; i=0) && rc<(int)(sizeof(aMsg)/sizeof(aMsg[0])) && aMsg[rc]!=0 ){ + return aMsg[rc]; + }else{ + return "unknown error"; } - return z; } /* @@ -922,7 +930,7 @@ int sqlite3CreateFunc( (!xFunc && (xFinal && !xStep)) || (!xFunc && (!xFinal && xStep)) || (nArg<-1 || nArg>SQLITE_MAX_FUNCTION_ARG) || - (255<(nName = sqlite3Strlen(db, zFunctionName))) ){ + (255<(nName = sqlite3Strlen30( zFunctionName))) ){ sqlite3Error(db, SQLITE_ERROR, "bad parameters"); return SQLITE_ERROR; } @@ -1048,7 +1056,7 @@ int sqlite3_overload_function( const char *zName, int nArg ){ - int nName = sqlite3Strlen(db, zName); + int nName = sqlite3Strlen30(zName); int rc; sqlite3_mutex_enter(db->mutex); if( sqlite3FindFunction(db, zName, nName, nArg, SQLITE_UTF8, 0)==0 ){ @@ -1157,6 +1165,39 @@ void *sqlite3_rollback_hook( return pRet; } +/* +** This function returns true if main-memory should be used instead of +** a temporary file for transient pager files and statement journals. +** The value returned depends on the value of db->temp_store (runtime +** parameter) and the compile time value of SQLITE_TEMP_STORE. The +** following table describes the relationship between these two values +** and this functions return value. +** +** SQLITE_TEMP_STORE db->temp_store Location of temporary database +** ----------------- -------------- ------------------------------ +** 0 any file (return 0) +** 1 1 file (return 0) +** 1 2 memory (return 1) +** 1 0 file (return 0) +** 2 1 file (return 0) +** 2 2 memory (return 1) +** 2 0 memory (return 1) +** 3 any memory (return 1) +*/ +int sqlite3TempInMemory(const sqlite3 *db){ +#if SQLITE_TEMP_STORE==1 + return ( db->temp_store==2 ); +#endif +#if SQLITE_TEMP_STORE==2 + return ( db->temp_store!=1 ); +#endif +#if SQLITE_TEMP_STORE==3 + return 1; +#else + return 0; +#endif +} + /* ** This routine is called to create a connection to a database BTree ** driver. If zFilename is the name of a file, then that file is @@ -1167,20 +1208,8 @@ void *sqlite3_rollback_hook( ** soon as the connection is closed. ** ** A virtual database can be either a disk file (that is automatically -** deleted when the file is closed) or it an be held entirely in memory, -** depending on the values of the SQLITE_TEMP_STORE compile-time macro and the -** db->temp_store variable, according to the following chart: -** -** SQLITE_TEMP_STORE db->temp_store Location of temporary database -** ----------------- -------------- ------------------------------ -** 0 any file -** 1 1 file -** 1 2 memory -** 1 0 file -** 2 1 file -** 2 2 memory -** 2 0 memory -** 3 any memory +** deleted when the file is closed) or it an be held entirely in memory. +** The sqlite3TempInMemory() function is used to determine which. */ int sqlite3BtreeFactory( const sqlite3 *db, /* Main database when opening aux otherwise 0 */ @@ -1201,22 +1230,11 @@ int sqlite3BtreeFactory( if( db->flags & SQLITE_NoReadlock ){ btFlags |= BTREE_NO_READLOCK; } - if( zFilename==0 ){ -#if SQLITE_TEMP_STORE==0 - /* Do nothing */ -#endif #ifndef SQLITE_OMIT_MEMORYDB -#if SQLITE_TEMP_STORE==1 - if( db->temp_store==2 ) zFilename = ":memory:"; -#endif -#if SQLITE_TEMP_STORE==2 - if( db->temp_store!=1 ) zFilename = ":memory:"; -#endif -#if SQLITE_TEMP_STORE==3 + if( zFilename==0 && sqlite3TempInMemory(db) ){ zFilename = ":memory:"; -#endif -#endif /* SQLITE_OMIT_MEMORYDB */ } +#endif if( (vfsFlags & SQLITE_OPEN_MAIN_DB)!=0 && (zFilename==0 || *zFilename==0) ){ vfsFlags = (vfsFlags & ~SQLITE_OPEN_MAIN_DB) | SQLITE_OPEN_TEMP_DB; @@ -1352,11 +1370,13 @@ static int createCollation( ** to one of SQLITE_UTF16LE or SQLITE_UTF16BE using the ** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally. */ - enc2 = enc & ~SQLITE_UTF16_ALIGNED; - if( enc2==SQLITE_UTF16 ){ + enc2 = enc; + testcase( enc2==SQLITE_UTF16 ); + testcase( enc2==SQLITE_UTF16_ALIGNED ); + if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){ enc2 = SQLITE_UTF16NATIVE; } - if( (enc2&~3)!=0 ){ + if( enc2SQLITE_UTF16BE ){ return SQLITE_MISUSE; } @@ -1364,7 +1384,7 @@ static int createCollation( ** sequence. If so, and there are active VMs, return busy. If there ** are no active VMs, invalidate any pre-compiled statements. */ - nName = sqlite3Strlen(db, zName); + nName = sqlite3Strlen30(zName); pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, nName, 0); if( pColl && pColl->xCmp ){ if( db->activeVdbeCnt ){ @@ -1501,6 +1521,7 @@ static int openDatabase( CollSeq *pColl; int isThreadsafe; + *ppDb = 0; #ifndef SQLITE_OMIT_AUTOINIT rc = sqlite3_initialize(); if( rc ) return rc; @@ -1560,9 +1581,9 @@ static int openDatabase( | SQLITE_LoadExtension #endif ; - sqlite3HashInit(&db->aCollSeq, 0); + sqlite3HashInit(&db->aCollSeq); #ifndef SQLITE_OMIT_VIRTUALTABLE - sqlite3HashInit(&db->aModule, 0); + sqlite3HashInit(&db->aModule); #endif db->pVfs = sqlite3_vfs_find(zVfs); diff --git a/src/malloc.c b/src/malloc.c index 92e5639..70d6916 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -12,7 +12,7 @@ ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.61 2009/03/24 15:08:10 drh Exp $ +** $Id: malloc.c,v 1.62 2009/05/03 20:23:54 drh Exp $ */ #include "sqliteInt.h" #include @@ -651,7 +651,7 @@ char *sqlite3DbStrDup(sqlite3 *db, const char *z){ if( z==0 ){ return 0; } - n = (db ? sqlite3Strlen(db, z) : sqlite3Strlen30(z))+1; + n = sqlite3Strlen30(z) + 1; assert( (n&0x7fffffff)==n ); zNew = sqlite3DbMallocRaw(db, (int)n); if( zNew ){ diff --git a/src/memjournal.c b/src/memjournal.c index 15665a0..df770b4 100644 --- a/src/memjournal.c +++ b/src/memjournal.c @@ -14,7 +14,7 @@ ** The in-memory rollback journal is used to journal transactions for ** ":memory:" databases and when the journal_mode=MEMORY pragma is used. ** -** @(#) $Id: memjournal.c,v 1.11 2009/04/05 12:22:09 drh Exp $ +** @(#) $Id: memjournal.c,v 1.12 2009/05/04 11:42:30 danielk1977 Exp $ */ #include "sqliteInt.h" @@ -129,7 +129,7 @@ static int memjrnlWrite( /* An in-memory journal file should only ever be appended to. Random ** access writes are not required by sqlite. */ - assert(iOfst==p->endpoint.iOffset); + assert( iOfst==p->endpoint.iOffset ); UNUSED_PARAMETER(iOfst); while( nWrite>0 ){ diff --git a/src/os_win.c b/src/os_win.c index 8f705cf..3bc769b 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -12,7 +12,7 @@ ** ** This file contains code that is specific to windows. ** -** $Id: os_win.c,v 1.154 2009/04/09 14:27:07 chw Exp $ +** $Id: os_win.c,v 1.156 2009/04/23 19:08:33 shane Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_WIN /* This file is used for windows only */ @@ -1312,16 +1312,23 @@ static int winOpen( }else{ dwDesiredAccess = GENERIC_READ; } - if( flags & SQLITE_OPEN_CREATE ){ + /* SQLITE_OPEN_EXCLUSIVE is used to make sure that a new file is + ** created. SQLite doesn't use it to indicate "exclusive access" + ** as it is usually understood. + */ + assert(!(flags & SQLITE_OPEN_EXCLUSIVE) || (flags & SQLITE_OPEN_CREATE)); + if( flags & SQLITE_OPEN_EXCLUSIVE ){ + /* Creates a new file, only if it does not already exist. */ + /* If the file exists, it fails. */ + dwCreationDisposition = CREATE_NEW; + }else if( flags & SQLITE_OPEN_CREATE ){ + /* Open existing file, or create if it doesn't exist */ dwCreationDisposition = OPEN_ALWAYS; }else{ + /* Opens a file, only if it exists. */ dwCreationDisposition = OPEN_EXISTING; } - if( flags & SQLITE_OPEN_MAIN_DB ){ - dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - }else{ - dwShareMode = 0; - } + dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; if( flags & SQLITE_OPEN_DELETEONCLOSE ){ #if SQLITE_OS_WINCE dwFlagsAndAttributes = FILE_ATTRIBUTE_HIDDEN; @@ -1600,13 +1607,11 @@ static int getSectorSize( void *zConverted = convertUtf8Filename(zFullpath); if( zConverted ){ if( isNT() ){ - int i; /* trim path to just drive reference */ WCHAR *p = zConverted; - for(i=0;ierrCode ){ sqlite3BackupRestart(pPager->pBackup); sqlite3PcacheClear(pPager->pPCache); + pPager->dbSizeValid = 0; } } @@ -1054,7 +1062,7 @@ static void releaseAllSavepoints(Pager *pPager){ for(ii=0; iinSavepoint; ii++){ sqlite3BitvecDestroy(pPager->aSavepoint[ii].pInSavepoint); } - if( !pPager->exclusiveMode ){ + if( !pPager->exclusiveMode || sqlite3IsMemJournal(pPager->sjfd) ){ sqlite3OsClose(pPager->sjfd); } sqlite3_free(pPager->aSavepoint); @@ -1290,7 +1298,11 @@ static int pager_end_transaction(Pager *pPager, int hasMaster){ rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); } }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){ - rc = sqlite3OsTruncate(pPager->jfd, 0); + if( pPager->journalOff==0 ){ + rc = SQLITE_OK; + }else{ + rc = sqlite3OsTruncate(pPager->jfd, 0); + } pPager->journalOff = 0; pPager->journalStarted = 0; }else if( pPager->exclusiveMode @@ -3179,7 +3191,7 @@ int sqlite3PagerOpen( nPathname + 1 + /* zFilename */ nPathname + 8 + 1 /* zJournal */ ); - assert( EIGHT_BYTE_ALIGNMENT(journalFileSize) ); + assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) ); if( !pPtr ){ sqlite3_free(zPathname); return SQLITE_NOMEM; @@ -3664,9 +3676,15 @@ static int pagerSharedLock(Pager *pPager){ /* ** If the reference count has reached zero, rollback any active ** transaction and unlock the pager. +** +** Except, in locking_mode=EXCLUSIVE when there is nothing to in +** the rollback journal, the unlock is not performed and there is +** nothing to rollback, so this routine is a no-op. */ static void pagerUnlockIfUnused(Pager *pPager){ - if( sqlite3PcacheRefCount(pPager->pPCache)==0 ){ + if( (sqlite3PcacheRefCount(pPager->pPCache)==0) + && (!pPager->exclusiveMode || pPager->journalOff>0) + ){ pagerUnlockAndRollback(pPager); } } @@ -3894,7 +3912,7 @@ void sqlite3PagerUnref(DbPage *pPg){ static int openSubJournal(Pager *pPager){ int rc = SQLITE_OK; if( isOpen(pPager->jfd) && !isOpen(pPager->sjfd) ){ - if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ + if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->subjInMemory ){ sqlite3MemJournalOpen(pPager->sjfd); }else{ rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL); @@ -4013,10 +4031,19 @@ static int pager_open_journal(Pager *pPager){ ** ** If the journal file is opened (or if it is already open), then a ** journal-header is written to the start of it. +** +** If the subjInMemory argument is non-zero, then any sub-journal opened +** within this transaction will be opened as an in-memory file. This +** has no effect if the sub-journal is already opened (as it may be when +** running in exclusive mode) or if the transaction does not require a +** sub-journal. If the subjInMemory argument is zero, then any required +** sub-journal is implemented in-memory if pPager is an in-memory database, +** or using a temporary file otherwise. */ -int sqlite3PagerBegin(Pager *pPager, int exFlag){ +int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){ int rc = SQLITE_OK; assert( pPager->state!=PAGER_UNLOCK ); + pPager->subjInMemory = (u8)subjInMemory; if( pPager->state==PAGER_SHARED ){ assert( pPager->pInJournal==0 ); assert( !MEMDB && !pPager->tempFile ); @@ -4101,7 +4128,7 @@ static int pager_write(PgHdr *pPg){ ** create it if it does not. */ assert( pPager->state!=PAGER_UNLOCK ); - rc = sqlite3PagerBegin(pPager, 0); + rc = sqlite3PagerBegin(pPager, 0, pPager->subjInMemory); if( rc!=SQLITE_OK ){ return rc; } @@ -5184,11 +5211,14 @@ int sqlite3PagerLockingMode(Pager *pPager, int eMode){ ** PAGER_JOURNALMODE_OFF ** PAGER_JOURNALMODE_MEMORY ** -** If the parameter is not _QUERY, then the journal-mode is set to the -** value specified. Except, an in-memory database can only have its -** journal mode set to _OFF or _MEMORY. Attempts to change the journal -** mode of an in-memory database to something other than _OFF or _MEMORY -** are silently ignored. +** If the parameter is not _QUERY, then the journal_mode is set to the +** value specified if the change is allowed. The change is disallowed +** for the following reasons: +** +** * An in-memory database can only have its journal_mode set to _OFF +** or _MEMORY. +** +** * The journal mode may not be changed while a transaction is active. ** ** The returned indicate the current (possibly updated) journal-mode. */ @@ -5200,8 +5230,15 @@ int sqlite3PagerJournalMode(Pager *pPager, int eMode){ || eMode==PAGER_JOURNALMODE_OFF || eMode==PAGER_JOURNALMODE_MEMORY ); assert( PAGER_JOURNALMODE_QUERY<0 ); - if( eMode>=0 && (!MEMDB || eMode==PAGER_JOURNALMODE_MEMORY - || eMode==PAGER_JOURNALMODE_OFF) ){ + if( eMode>=0 + && (!MEMDB || eMode==PAGER_JOURNALMODE_MEMORY + || eMode==PAGER_JOURNALMODE_OFF) + && !pPager->dbModified + && (!isOpen(pPager->jfd) || 0==pPager->journalOff) + ){ + if( isOpen(pPager->jfd) ){ + sqlite3OsClose(pPager->jfd); + } pPager->journalMode = (u8)eMode; } return (int)pPager->journalMode; diff --git a/src/pager.h b/src/pager.h index 011f91c..a0110f8 100644 --- a/src/pager.h +++ b/src/pager.h @@ -13,7 +13,7 @@ ** 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.101 2009/04/30 09:10:38 danielk1977 Exp $ */ #ifndef _PAGER_H_ @@ -119,7 +119,7 @@ void *sqlite3PagerGetExtra(DbPage *); /* Functions used to manage pager transactions and savepoints. */ int sqlite3PagerPagecount(Pager*, int*); -int sqlite3PagerBegin(Pager*, int exFlag); +int sqlite3PagerBegin(Pager*, int exFlag, int); int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, int); int sqlite3PagerSync(Pager *pPager); int sqlite3PagerCommitPhaseTwo(Pager*); diff --git a/src/parse.y b/src/parse.y index 7024814..26017bd 100644 --- a/src/parse.y +++ b/src/parse.y @@ -14,7 +14,7 @@ ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** -** @(#) $Id: parse.y,v 1.274 2009/04/06 14:16:43 drh Exp $ +** @(#) $Id: parse.y,v 1.275 2009/05/01 21:13:37 drh Exp $ */ // All token codes are small integers with #defines that begin with "TK_" @@ -166,6 +166,8 @@ columnlist ::= column. column(A) ::= columnid(X) type carglist. { A.z = X.z; A.n = (int)(pParse->sLastToken.z-X.z) + pParse->sLastToken.n; + A.quoted = 0; + A.dyn = 0; } columnid(A) ::= nm(X). { sqlite3AddColumn(pParse,&X); diff --git a/src/pcache1.c b/src/pcache1.c index 0f2c36d..c77aa23 100644 --- a/src/pcache1.c +++ b/src/pcache1.c @@ -16,7 +16,7 @@ ** If the default page cache implementation is overriden, then neither of ** these two features are available. ** -** @(#) $Id: pcache1.c,v 1.10 2009/03/23 04:33:33 danielk1977 Exp $ +** @(#) $Id: pcache1.c,v 1.11 2009/04/14 18:44:39 aswift Exp $ */ #include "sqliteInt.h" @@ -527,7 +527,7 @@ static void *pcache1Fetch(sqlite3_pcache *p, unsigned int iKey, int createFlag){ /* Step 4. Try to recycle a page buffer if appropriate. */ if( pCache->bPurgeable && pcache1.pLruTail && ( - pCache->nPage>=pCache->nMax-1 || pcache1.nCurrentPage>=pcache1.nMaxPage + (pCache->nPage+1>=pCache->nMax) || pcache1.nCurrentPage>=pcache1.nMaxPage )){ pPage = pcache1.pLruTail; pcache1RemoveFromHash(pPage); diff --git a/src/prepare.c b/src/prepare.c index e3479f3..c5f4de9 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -13,7 +13,7 @@ ** interface, and routines that contribute to loading the database schema ** from disk. ** -** $Id: prepare.c,v 1.116 2009/04/02 18:32:27 drh Exp $ +** $Id: prepare.c,v 1.117 2009/04/20 17:43:03 drh Exp $ */ #include "sqliteInt.h" @@ -127,6 +127,7 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){ */ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ int rc; + int i; BtCursor *curMain; int size; Table *pTab; @@ -216,7 +217,8 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ } sqlite3BtreeEnter(pDb->pBt); rc = sqlite3BtreeCursor(pDb->pBt, MASTER_ROOT, 0, 0, curMain); - if( rc!=SQLITE_OK && rc!=SQLITE_EMPTY ){ + if( rc==SQLITE_EMPTY ) rc = SQLITE_OK; + if( rc!=SQLITE_OK ){ sqlite3SetString(pzErrMsg, db, "%s", sqlite3ErrStr(rc)); goto initone_error_out; } @@ -238,17 +240,12 @@ static int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg){ ** 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; - } + for(i=0; ipBt, i+1, (u32 *)&meta[i]); + if( rc ){ + sqlite3SetString(pzErrMsg, db, "%s", sqlite3ErrStr(rc)); + goto initone_error_out; } - }else{ - memset(meta, 0, sizeof(meta)); } pDb->pSchema->schema_cookie = meta[0]; diff --git a/src/printf.c b/src/printf.c index bc8d022..a2c79c5 100644 --- a/src/printf.c +++ b/src/printf.c @@ -5,7 +5,7 @@ ** 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.102 2009/04/08 16:10:04 drh Exp $ +** $Id: printf.c,v 1.103 2009/05/04 20:20:16 drh Exp $ ** ************************************************************************** ** @@ -391,9 +391,13 @@ void sqlite3VXPrintf( case etRADIX: if( infop->flags & FLAG_SIGNED ){ i64 v; - if( flag_longlong ) v = va_arg(ap,i64); - else if( flag_long ) v = va_arg(ap,long int); - else v = va_arg(ap,int); + if( flag_longlong ){ + v = va_arg(ap,i64); + }else if( flag_long ){ + v = va_arg(ap,long int); + }else{ + v = va_arg(ap,int); + } if( v<0 ){ longvalue = -v; prefix = '-'; @@ -404,9 +408,13 @@ void sqlite3VXPrintf( else prefix = 0; } }else{ - if( flag_longlong ) longvalue = va_arg(ap,u64); - else if( flag_long ) longvalue = va_arg(ap,unsigned long int); - else longvalue = va_arg(ap,unsigned int); + if( flag_longlong ){ + longvalue = va_arg(ap,u64); + }else if( flag_long ){ + longvalue = va_arg(ap,unsigned long int); + }else{ + longvalue = va_arg(ap,unsigned int); + } prefix = 0; } if( longvalue==0 ) flag_alternateform = 0; diff --git a/src/resolve.c b/src/resolve.c index 1f2641d..4d34317 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -14,7 +14,7 @@ ** resolve all identifiers by associating them with a particular ** table and column. ** -** $Id: resolve.c,v 1.20 2009/03/05 04:23:47 shane Exp $ +** $Id: resolve.c,v 1.22 2009/05/05 15:46:43 drh Exp $ */ #include "sqliteInt.h" #include @@ -248,7 +248,11 @@ static int lookupName( if( iCol>=0 ){ testcase( iCol==31 ); testcase( iCol==32 ); - *piColMask |= ((u32)1<=32?0xffffffff:0); + if( iCol>=32 ){ + *piColMask = 0xffffffff; + }else{ + *piColMask |= ((u32)1)<nRef ** fields are not changed in any context. */ - if( cnt==0 && zTab==0 && pColumnToken->z[0]=='"' ){ + if( cnt==0 && zTab==0 && ExprHasProperty(pExpr,EP_DblQuoted) ){ sqlite3DbFree(db, zCol); pExpr->op = TK_STRING; pExpr->pTab = 0; diff --git a/src/rowset.c b/src/rowset.c index e8f7a52..edfde11 100644 --- a/src/rowset.c +++ b/src/rowset.c @@ -10,47 +10,89 @@ ** ************************************************************************* ** -** This module implements an object we call a "Row Set". +** This module implements an object we call a "RowSet". ** -** 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. +** The RowSet object is a collection of rowids. Rowids +** are inserted into the RowSet in an arbitrary order. Inserts +** can be intermixed with tests to see if a given rowid has been +** previously inserted into the RowSet. ** -** 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. +** After all inserts are finished, it is possible to extract the +** elements of the RowSet in sorted order. Once this extraction +** process has started, no new elements may be inserted. ** -** Big chunks of rowid/next-ptr pairs are allocated at a time, to -** reduce the malloc overhead. +** Hence, the primitive operations for a RowSet are: ** -** $Id: rowset.c,v 1.4 2009/04/01 19:35:55 drh Exp $ +** CREATE +** INSERT +** TEST +** SMALLEST +** DESTROY +** +** The CREATE and DESTROY primitives are the constructor and destructor, +** obviously. The INSERT primitive adds a new element to the RowSet. +** TEST checks to see if an element is already in the RowSet. SMALLEST +** extracts the least value from the RowSet. +** +** The INSERT primitive might allocate additional memory. Memory is +** allocated in chunks so most INSERTs do no allocation. There is an +** upper bound on the size of allocated memory. No memory is freed +** until DESTROY. +** +** The TEST primitive includes a "batch" number. The TEST primitive +** will only see elements that were inserted before the last change +** in the batch number. In other words, if an INSERT occurs between +** two TESTs where the TESTs have the same batch nubmer, then the +** value added by the INSERT will not be visible to the second TEST. +** The initial batch number is zero, so if the very first TEST contains +** a non-zero batch number, it will see all prior INSERTs. +** +** No INSERTs may occurs after a SMALLEST. An assertion will fail if +** that is attempted. +** +** The cost of an INSERT is roughly constant. (Sometime new memory +** has to be allocated on an INSERT.) The cost of a TEST with a new +** batch number is O(NlogN) where N is the number of elements in the RowSet. +** The cost of a TEST using the same batch number is O(logN). The cost +** of the first SMALLEST is O(NlogN). Second and subsequent SMALLEST +** primitives are constant time. The cost of DESTROY is O(N). +** +** There is an added cost of O(N) when switching between TEST and +** SMALLEST primitives. +** +** $Id: rowset.c,v 1.6 2009/04/22 15:32:59 drh Exp $ */ #include "sqliteInt.h" + +/* +** Target size for allocation chunks. +*/ +#define ROWSET_ALLOCATION_SIZE 1024 + /* ** The number of rowset entries per allocation chunk. */ -#define ROWSET_ENTRY_PER_CHUNK 63 +#define ROWSET_ENTRY_PER_CHUNK \ + ((ROWSET_ALLOCATION_SIZE-8)/sizeof(struct RowSetEntry)) /* -** Each entry in a RowSet is an instance of the following -** structure: +** Each entry in a RowSet is an instance of the following object. */ struct RowSetEntry { i64 v; /* ROWID value for this entry */ - struct RowSetEntry *pNext; /* Next entry on a list of all entries */ + struct RowSetEntry *pRight; /* Right subtree (larger entries) or list */ + struct RowSetEntry *pLeft; /* Left subtree (smaller entries) */ }; /* -** Index entries are allocated in large chunks (instances of the +** RowSetEntry objects 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 RowSetChunk *pNextChunk; /* Next chunk on list of them all */ struct RowSetEntry aEntry[ROWSET_ENTRY_PER_CHUNK]; /* Allocated entries */ }; @@ -62,11 +104,13 @@ struct RowSetChunk { 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 *pEntry; /* List of entries using pRight */ struct RowSetEntry *pLast; /* Last entry on the pEntry list */ struct RowSetEntry *pFresh; /* Source of new entry objects */ + struct RowSetEntry *pTree; /* Binary tree of entries */ u16 nFresh; /* Number of objects on pFresh */ - u8 isSorted; /* True if content is sorted */ + u8 isSorted; /* True if pEntry is sorted */ + u8 iBatch; /* Current insert batch */ }; /* @@ -89,25 +133,30 @@ RowSet *sqlite3RowSetInit(sqlite3 *db, void *pSpace, unsigned int N){ p->db = db; p->pEntry = 0; p->pLast = 0; + p->pTree = 0; p->pFresh = (struct RowSetEntry*)&p[1]; p->nFresh = (u16)((N - sizeof(*p))/sizeof(struct RowSetEntry)); p->isSorted = 1; + p->iBatch = 0; return p; } /* -** Deallocate all chunks from a RowSet. +** Deallocate all chunks from a RowSet. This frees all memory that +** the RowSet has allocated over its lifetime. This routine is +** the destructor for the RowSet. */ void sqlite3RowSetClear(RowSet *p){ struct RowSetChunk *pChunk, *pNextChunk; for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){ - pNextChunk = pChunk->pNext; + pNextChunk = pChunk->pNextChunk; sqlite3DbFree(p->db, pChunk); } p->pChunk = 0; p->nFresh = 0; p->pEntry = 0; p->pLast = 0; + p->pTree = 0; p->isSorted = 1; } @@ -118,8 +167,8 @@ void sqlite3RowSetClear(RowSet *p){ ** memory allocation fails. */ void sqlite3RowSetInsert(RowSet *p, i64 rowid){ - struct RowSetEntry *pEntry; - struct RowSetEntry *pLast; + struct RowSetEntry *pEntry; /* The new entry */ + struct RowSetEntry *pLast; /* The last prior entry */ assert( p!=0 ); if( p->nFresh==0 ){ struct RowSetChunk *pNew; @@ -127,7 +176,7 @@ void sqlite3RowSetInsert(RowSet *p, i64 rowid){ if( pNew==0 ){ return; } - pNew->pNext = p->pChunk; + pNew->pNextChunk = p->pChunk; p->pChunk = pNew; p->pFresh = pNew->aEntry; p->nFresh = ROWSET_ENTRY_PER_CHUNK; @@ -135,26 +184,27 @@ void sqlite3RowSetInsert(RowSet *p, i64 rowid){ pEntry = p->pFresh++; p->nFresh--; pEntry->v = rowid; - pEntry->pNext = 0; + pEntry->pRight = 0; pLast = p->pLast; if( pLast ){ if( p->isSorted && rowid<=pLast->v ){ p->isSorted = 0; } - pLast->pNext = pEntry; + pLast->pRight = pEntry; }else{ - assert( p->pEntry==0 ); + assert( p->pEntry==0 ); /* Fires if INSERT after SMALLEST */ p->pEntry = pEntry; } p->pLast = pEntry; } /* -** Merge two lists of RowSet entries. Remove duplicates. +** Merge two lists of RowSetEntry objects. Remove duplicates. ** -** The input lists are assumed to be in sorted order. +** The input lists are connected via pRight pointers and are +** assumed to each already be in sorted order. */ -static struct RowSetEntry *boolidxMerge( +static struct RowSetEntry *rowSetMerge( struct RowSetEntry *pA, /* First sorted list to be merged */ struct RowSetEntry *pB /* Second sorted list to be merged */ ){ @@ -163,34 +213,34 @@ static struct RowSetEntry *boolidxMerge( pTail = &head; while( pA && pB ){ - assert( pA->pNext==0 || pA->v<=pA->pNext->v ); - assert( pB->pNext==0 || pB->v<=pB->pNext->v ); + assert( pA->pRight==0 || pA->v<=pA->pRight->v ); + assert( pB->pRight==0 || pB->v<=pB->pRight->v ); if( pA->vv ){ - pTail->pNext = pA; - pA = pA->pNext; - pTail = pTail->pNext; + pTail->pRight = pA; + pA = pA->pRight; + pTail = pTail->pRight; }else if( pB->vv ){ - pTail->pNext = pB; - pB = pB->pNext; - pTail = pTail->pNext; + pTail->pRight = pB; + pB = pB->pRight; + pTail = pTail->pRight; }else{ - pA = pA->pNext; + pA = pA->pRight; } } if( pA ){ - assert( pA->pNext==0 || pA->v<=pA->pNext->v ); - pTail->pNext = pA; + assert( pA->pRight==0 || pA->v<=pA->pRight->v ); + pTail->pRight = pA; }else{ - assert( pB==0 || pB->pNext==0 || pB->v<=pB->pNext->v ); - pTail->pNext = pB; + assert( pB==0 || pB->pRight==0 || pB->v<=pB->pRight->v ); + pTail->pRight = pB; } - return head.pNext; + return head.pRight; } /* -** Sort all elements of the RowSet into ascending order. +** Sort all elements on the pEntry list of the RowSet into ascending order. */ -static void sqlite3RowSetSort(RowSet *p){ +static void rowSetSort(RowSet *p){ unsigned int i; struct RowSetEntry *pEntry; struct RowSetEntry *aBucket[40]; @@ -199,35 +249,143 @@ static void sqlite3RowSetSort(RowSet *p){ memset(aBucket, 0, sizeof(aBucket)); while( p->pEntry ){ pEntry = p->pEntry; - p->pEntry = pEntry->pNext; - pEntry->pNext = 0; + p->pEntry = pEntry->pRight; + pEntry->pRight = 0; for(i=0; aBucket[i]; i++){ - pEntry = boolidxMerge(aBucket[i],pEntry); + pEntry = rowSetMerge(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. +** The input, pIn, is a binary tree (or subtree) of RowSetEntry objects. +** Convert this tree into a linked list connected by the pRight pointers +** and return pointers to the first and last elements of the new list. +*/ +static void rowSetTreeToList( + struct RowSetEntry *pIn, /* Root of the input tree */ + struct RowSetEntry **ppFirst, /* Write head of the output list here */ + struct RowSetEntry **ppLast /* Write tail of the output list here */ +){ + assert( pIn!=0 ); + if( pIn->pLeft ){ + struct RowSetEntry *p; + rowSetTreeToList(pIn->pLeft, ppFirst, &p); + p->pRight = pIn; + }else{ + *ppFirst = pIn; + } + if( pIn->pRight ){ + rowSetTreeToList(pIn->pRight, &pIn->pRight, ppLast); + }else{ + *ppLast = pIn; + } + assert( (*ppLast)->pRight==0 ); +} + + +/* +** Convert a sorted list of elements (connected by pRight) into a binary +** tree with depth of iDepth. A depth of 1 means the tree contains a single +** node taken from the head of *ppList. A depth of 2 means a tree with +** three nodes. And so forth. +** +** Use as many entries from the input list as required and update the +** *ppList to point to the unused elements of the list. If the input +** list contains too few elements, then construct an incomplete tree +** and leave *ppList set to NULL. +** +** Return a pointer to the root of the constructed binary tree. +*/ +static struct RowSetEntry *rowSetNDeepTree( + struct RowSetEntry **ppList, + int iDepth +){ + struct RowSetEntry *p; /* Root of the new tree */ + struct RowSetEntry *pLeft; /* Left subtree */ + if( *ppList==0 ){ + return 0; + } + if( iDepth==1 ){ + p = *ppList; + *ppList = p->pRight; + p->pLeft = p->pRight = 0; + return p; + } + pLeft = rowSetNDeepTree(ppList, iDepth-1); + p = *ppList; + if( p==0 ){ + return pLeft; + } + p->pLeft = pLeft; + *ppList = p->pRight; + p->pRight = rowSetNDeepTree(ppList, iDepth-1); + return p; +} + +/* +** Convert a sorted list of elements into a binary tree. Make the tree +** as deep as it needs to be in order to contain the entire list. +*/ +static struct RowSetEntry *rowSetListToTree(struct RowSetEntry *pList){ + int iDepth; /* Depth of the tree so far */ + struct RowSetEntry *p; /* Current tree root */ + struct RowSetEntry *pLeft; /* Left subtree */ + + assert( pList!=0 ); + p = pList; + pList = p->pRight; + p->pLeft = p->pRight = 0; + for(iDepth=1; pList; iDepth++){ + pLeft = p; + p = pList; + pList = p->pRight; + p->pLeft = pLeft; + p->pRight = rowSetNDeepTree(&pList, iDepth); + } + return p; +} + +/* +** Convert the list in p->pEntry into a sorted list if it is not +** sorted already. If there is a binary tree on p->pTree, then +** convert it into a list too and merge it into the p->pEntry list. +*/ +static void rowSetToList(RowSet *p){ + if( !p->isSorted ){ + rowSetSort(p); + } + if( p->pTree ){ + struct RowSetEntry *pHead, *pTail; + rowSetTreeToList(p->pTree, &pHead, &pTail); + p->pTree = 0; + p->pEntry = rowSetMerge(p->pEntry, pHead); + } +} + +/* +** Extract the smallest element from the RowSet. ** Write the element into *pRowid. Return 1 on success. Return ** 0 if the RowSet is already empty. +** +** After this routine has been called, the sqlite3RowSetInsert() +** routine may not be called again. */ int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ - if( !p->isSorted ){ - sqlite3RowSetSort(p); - } + rowSetToList(p); if( p->pEntry ){ *pRowid = p->pEntry->v; - p->pEntry = p->pEntry->pNext; + p->pEntry = p->pEntry->pRight; if( p->pEntry==0 ){ sqlite3RowSetClear(p); } @@ -236,3 +394,31 @@ int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ return 0; } } + +/* +** Check to see if element iRowid was inserted into the the rowset as +** part of any insert batch prior to iBatch. Return 1 or 0. +*/ +int sqlite3RowSetTest(RowSet *pRowSet, u8 iBatch, sqlite3_int64 iRowid){ + struct RowSetEntry *p; + if( iBatch!=pRowSet->iBatch ){ + if( pRowSet->pEntry ){ + rowSetToList(pRowSet); + pRowSet->pTree = rowSetListToTree(pRowSet->pEntry); + pRowSet->pEntry = 0; + pRowSet->pLast = 0; + } + pRowSet->iBatch = iBatch; + } + p = pRowSet->pTree; + while( p ){ + if( p->vpRight; + }else if( p->v>iRowid ){ + p = p->pLeft; + }else{ + return 1; + } + } + return 0; +} diff --git a/src/select.c b/src/select.c index 08d9e41..d1c0fb4 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.507 2009/04/02 16:59:47 drh Exp $ +** $Id: select.c,v 1.512 2009/05/03 20:23:54 drh Exp $ */ #include "sqliteInt.h" @@ -193,42 +193,7 @@ static void setToken(Token *p, const char *z){ p->z = (u8*)z; p->n = z ? sqlite3Strlen30(z) : 0; p->dyn = 0; -} - -/* -** Set the token to the double-quoted and escaped version of the string pointed -** to by z. For example; -** -** {a"bc} -> {"a""bc"} -*/ -static void setQuotedToken(Parse *pParse, Token *p, const char *z){ - - /* Check if the string appears to be quoted using "..." or `...` - ** or [...] or '...' or if the string contains any " characters. - ** If it does, then record a version of the string with the special - ** characters escaped. - */ - const char *z2 = z; - if( *z2!='[' && *z2!='`' && *z2!='\'' ){ - while( *z2 ){ - if( *z2=='"' ) break; - z2++; - } - } - - 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->dyn = 1; - } - }else{ - /* String contains no " characters - copy the pointer. */ - p->z = (u8*)z; - p->n = (int)(z2 - z); - p->dyn = 0; - } + p->quoted = 0; } /* @@ -421,6 +386,7 @@ static void pushOntoSorter( int nExpr = pOrderBy->nExpr; int regBase = sqlite3GetTempRange(pParse, nExpr+2); int regRecord = sqlite3GetTempReg(pParse); + sqlite3ExprCacheClear(pParse); sqlite3ExprCodeExprList(pParse, pOrderBy, regBase, 0); sqlite3VdbeAddOp2(v, OP_Sequence, pOrderBy->iECursor, regBase+nExpr); sqlite3ExprCodeMove(pParse, regData, regBase+nExpr+1, 1); @@ -573,6 +539,7 @@ static void selectInnerLoop( /* If the destination is an EXISTS(...) expression, the actual ** values returned by the SELECT are not required. */ + sqlite3ExprCacheClear(pParse); sqlite3ExprCodeExprList(pParse, pEList, regResult, eDest==SRT_Output); } nColumn = nResultCol; @@ -1190,7 +1157,6 @@ static int selectColumnsFromExprList( sqlite3DbFree(db, zName); break; } - 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. @@ -1346,6 +1312,7 @@ static void computeLimitRegisters(Parse *pParse, Select *p, int iBreak){ ** The current implementation interprets "LIMIT 0" to mean ** no rows. */ + sqlite3ExprCacheClear(pParse); if( p->pLimit ){ p->iLimit = iLimit = ++pParse->nMem; v = sqlite3GetVdbe(pParse); @@ -1394,7 +1361,8 @@ static CollSeq *multiSelectCollSeq(Parse *pParse, Select *p, int iCol){ }else{ pRet = 0; } - if( pRet==0 ){ + assert( iCol>=0 ); + if( pRet==0 && iColpEList->nExpr ){ pRet = sqlite3ExprCollSeq(pParse, p->pEList->a[iCol].pExpr); } return pRet; @@ -2101,7 +2069,7 @@ static int multiSelectOrderBy( } /* Compute the comparison permutation and keyinfo that is used with - ** the permutation in order to comparisons to determine if the next + ** the permutation used to determine if the next ** row of results comes from selectA or selectB. Also add explicit ** collations to the ORDER BY clause terms so that when the subqueries ** to the right and the left are evaluated, they use the correct @@ -3224,12 +3192,12 @@ static int selectExpander(Walker *pWalker, Select *p){ } pRight = sqlite3PExpr(pParse, TK_ID, 0, 0, 0); if( pRight==0 ) break; - setQuotedToken(pParse, &pRight->token, zName); + setToken(&pRight->token, zName); if( longNames || pTabList->nSrc>1 ){ Expr *pLeft = sqlite3PExpr(pParse, TK_ID, 0, 0, 0); pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight, 0); if( pExpr==0 ) break; - setQuotedToken(pParse, &pLeft->token, zTabName); + setToken(&pLeft->token, zTabName); setToken(&pExpr->span, sqlite3MPrintf(db, "%s.%s", zTabName, zName)); pExpr->span.dyn = 1; @@ -3455,6 +3423,7 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ struct AggInfo_col *pC; pAggInfo->directMode = 1; + sqlite3ExprCacheClear(pParse); for(i=0, pF=pAggInfo->aFunc; inFunc; i++, pF++){ int nArg; int addrNext = 0; @@ -3494,12 +3463,14 @@ static void updateAccumulator(Parse *pParse, AggInfo *pAggInfo){ sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); if( addrNext ){ sqlite3VdbeResolveLabel(v, addrNext); + sqlite3ExprCacheClear(pParse); } } for(i=0, pC=pAggInfo->aCol; inAccumulator; i++, pC++){ sqlite3ExprCode(pParse, pC->pExpr, pC->iMem); } pAggInfo->directMode = 0; + sqlite3ExprCacheClear(pParse); } /* @@ -3764,7 +3735,7 @@ int sqlite3Select( /* 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 @@ -3886,7 +3857,7 @@ int sqlite3Select( ** 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 @@ -3917,6 +3888,7 @@ int sqlite3Select( } } regBase = sqlite3GetTempRange(pParse, nCol); + sqlite3ExprCacheClear(pParse); sqlite3ExprCodeExprList(pParse, pGroupBy, regBase, 0); sqlite3VdbeAddOp2(v, OP_Sequence, sAggInfo.sortingIdx,regBase+nGroupBy); j = nGroupBy+1; @@ -3943,6 +3915,7 @@ int sqlite3Select( sqlite3VdbeAddOp2(v, OP_Sort, sAggInfo.sortingIdx, addrEnd); VdbeComment((v, "GROUP BY sort")); sAggInfo.useSortingIdx = 1; + sqlite3ExprCacheClear(pParse); } /* Evaluate the current GROUP BY terms and store in b0, b1, b2... @@ -3951,6 +3924,7 @@ int sqlite3Select( ** from the previous row currently stored in a0, a1, a2... */ addrTopOfLoop = sqlite3VdbeCurrentAddr(v); + sqlite3ExprCacheClear(pParse); for(j=0; jnExpr; j++){ if( groupBySort ){ sqlite3VdbeAddOp3(v, OP_Column, sAggInfo.sortingIdx, j, iBMem+j); @@ -4141,7 +4115,7 @@ int sqlite3Select( ** 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; diff --git a/src/sqlite.h.in b/src/sqlite.h.in index 967e785..8356078 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -30,7 +30,7 @@ ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** -** @(#) $Id: sqlite.h.in,v 1.440 2009/04/06 15:55:04 drh Exp $ +** @(#) $Id: sqlite.h.in,v 1.447 2009/04/30 15:59:56 drh Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ @@ -791,6 +791,11 @@ struct sqlite3_vfs { ** of sqlite3_initialize() does any initialization. All other calls ** are harmless no-ops. ** +** A call to sqlite3_shutdown() is an "effective" call if it is the first +** call to sqlite3_shutdown() since the last sqlite3_initialize(). Only +** an effective call to sqlite3_shutdown() does any deinitialization. +** All other calls to sqlite3_shutdown() are harmless no-ops. +** ** Among other things, sqlite3_initialize() shall invoke ** sqlite3_os_init(). Similarly, sqlite3_shutdown() ** shall invoke sqlite3_os_end(). @@ -1218,14 +1223,18 @@ sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** triggers are not counted. Use the [sqlite3_total_changes()] function ** to find the total number of changes including changes caused by triggers. ** +** Changes to a view that are simulated by an [INSTEAD OF trigger] +** are not counted. Only real table changes are counted. +** ** A "row change" is a change to a single row of a single table ** caused by an INSERT, DELETE, or UPDATE statement. Rows that -** are changed as side effects of REPLACE constraint resolution, -** rollback, ABORT processing, DROP TABLE, or by any other +** are changed as side effects of [REPLACE] constraint resolution, +** rollback, ABORT processing, [DROP TABLE], or by any other ** mechanisms do not count as direct row changes. ** ** A "trigger context" is a scope of execution that begins and -** ends with the script of a trigger. Most SQL statements are +** ends with the script of a [CREATE TRIGGER | trigger]. +** Most SQL statements are ** evaluated outside of any trigger. This is the "top level" ** trigger context. If a trigger fires from the top level, a ** new trigger context is entered for the duration of that one @@ -1247,16 +1256,8 @@ sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); ** However, the number returned does not include changes ** caused by subtriggers since those have their own context. ** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. Doing so is much faster than going -** through and deleting individual elements from the table. Because of this -** optimization, the deletions in "DELETE FROM table" are not row changes and -** will not be counted by the sqlite3_changes() or [sqlite3_total_changes()] -** functions, regardless of the number of elements that were originally -** in the table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. Or recompile using the -** [SQLITE_OMIT_TRUNCATE_OPTIMIZATION] compile-time option to disable the -** optimization on all queries. +** See also the [sqlite3_total_changes()] interface and the +** [count_changes pragma]. ** ** Requirements: ** [H12241] [H12243] @@ -1270,27 +1271,21 @@ int sqlite3_changes(sqlite3*); /* ** CAPI3REF: Total Number Of Rows Modified {H12260} ** -** This function returns the number of row changes caused by INSERT, -** UPDATE or DELETE statements since the [database connection] was opened. -** The count includes all changes from all trigger contexts. However, -** the count does not include changes used to implement REPLACE constraints, -** do rollbacks or ABORT processing, or DROP table processing. +** This function returns the number of row changes caused by [INSERT], +** [UPDATE] or [DELETE] statements since the [database connection] was opened. +** The count includes all changes from all +** [CREATE TRIGGER | trigger] contexts. However, +** the count does not include changes used to implement [REPLACE] constraints, +** do rollbacks or ABORT processing, or [DROP TABLE] processing. The +** count does not rows of views that fire an [INSTEAD OF trigger], though if +** the INSTEAD OF trigger makes changes of its own, those changes are +** counted. ** The changes are counted as soon as the statement that makes them is ** completed (when the statement handle is passed to [sqlite3_reset()] or ** [sqlite3_finalize()]). ** -** SQLite implements the command "DELETE FROM table" without a WHERE clause -** by dropping and recreating the table. (This is much faster than going -** through and deleting individual elements from the table.) Because of this -** optimization, the deletions in "DELETE FROM table" are not row changes and -** will not be counted by the sqlite3_changes() or [sqlite3_total_changes()] -** functions, regardless of the number of elements that were originally -** in the table. To get an accurate count of the number of rows deleted, use -** "DELETE FROM table WHERE 1" instead. Or recompile using the -** [SQLITE_OMIT_TRUNCATE_OPTIMIZATION] compile-time option to disable the -** optimization on all queries. -** -** See also the [sqlite3_changes()] interface. +** See also the [sqlite3_changes()] interface and the +** [count_changes pragma]. ** ** Requirements: ** [H12261] [H12263] @@ -1324,8 +1319,16 @@ int sqlite3_total_changes(sqlite3*); ** that is inside an explicit transaction, then the entire transaction ** will be rolled back automatically. ** -** A call to sqlite3_interrupt() has no effect on SQL statements -** that are started after sqlite3_interrupt() returns. +** The sqlite3_interrupt(D) call is in effect until all currently running +** SQL statements on [database connection] D complete. Any new SQL statements +** that are started after the sqlite3_interrupt() call and before the +** running statements reaches zero are interrupted as if they had been +** running prior to the sqlite3_interrupt() call. New SQL statements +** that are started after the running statement count reaches zero are +** not effected by the sqlite3_interrupt(). +** A call to sqlite3_interrupt(D) that occurs when there are no running +** SQL statements is a no-op and has no effect on SQL statements +** that are started after the sqlite3_interrupt() call returns. ** ** Requirements: ** [H12271] [H12272] @@ -1338,20 +1341,30 @@ void sqlite3_interrupt(sqlite3*); /* ** CAPI3REF: Determine If An SQL Statement Is Complete {H10510} ** -** These routines are useful for command-line input to determine if the -** currently entered text seems to form complete a SQL statement or +** These routines are useful during command-line input to determine if the +** currently entered text seems to form a complete SQL statement or ** if additional input is needed before sending the text into -** SQLite for parsing. These routines return true if the input string +** SQLite for parsing. These routines return 1 if the input string ** appears to be a complete SQL statement. A statement is judged to be -** complete if it ends with a semicolon token and is not a fragment of a -** CREATE TRIGGER statement. Semicolons that are embedded within +** complete if it ends with a semicolon token and is not a prefix of a +** well-formed CREATE TRIGGER statement. Semicolons that are embedded within ** string literals or quoted identifier names or comments are not ** independent tokens (they are part of the token in which they are -** embedded) and thus do not count as a statement terminator. +** embedded) and thus do not count as a statement terminator. Whitespace +** and comments that follow the final semicolon are ignored. +** +** These routines return 0 if the statement is incomplete. If a +** memory allocation fails, then SQLITE_NOMEM is returned. ** ** These routines do not parse the SQL statements thus ** will not detect syntactically incorrect SQL. ** +** If SQLite has not been initialized using [sqlite3_initialize()] prior +** to invoking sqlite3_complete16() then sqlite3_initialize() is invoked +** automatically by sqlite3_complete16(). If that initialization fails, +** then the return value from sqlite3_complete16() will be non-zero +** regardless of whether or not the input SQL is complete. +** ** Requirements: [H10511] [H10512] ** ** The input to [sqlite3_complete()] must be a zero-terminated @@ -1779,13 +1792,7 @@ void sqlite3_randomness(int N, void *P); ** requested is ok. When the callback returns [SQLITE_DENY], the ** [sqlite3_prepare_v2()] or equivalent call that triggered the ** authorizer will fail with an error message explaining that -** access is denied. If the authorizer code is [SQLITE_READ] -** and the callback returns [SQLITE_IGNORE] then the -** [prepared statement] statement is constructed to substitute -** a NULL value in place of the table column that would have -** been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE] -** return can be used to deny an untrusted user access to individual -** columns of a table. +** access is denied. ** ** The first parameter to the authorizer callback is a copy of the third ** parameter to the sqlite3_set_authorizer() interface. The second parameter @@ -1794,6 +1801,17 @@ void sqlite3_randomness(int N, void *P); ** to the callback are zero-terminated strings that contain additional ** details about the action to be authorized. ** +** If the action code is [SQLITE_READ] +** and the callback returns [SQLITE_IGNORE] then the +** [prepared statement] statement is constructed to substitute +** a NULL value in place of the table column that would have +** been read if [SQLITE_OK] had been returned. The [SQLITE_IGNORE] +** return can be used to deny an untrusted user access to individual +** columns of a table. +** If the action code is [SQLITE_DELETE] and the callback returns +** [SQLITE_IGNORE] then the [DELETE] operation proceeds but the +** [truncate optimization] is disabled and all rows are deleted individually. +** ** An authorizer is used when [sqlite3_prepare | preparing] ** SQL statements from an untrusted source, to ensure that the SQL statements ** do not try to access data they are not allowed to see, or that they do not @@ -1827,7 +1845,9 @@ void sqlite3_randomness(int N, void *P); ** ** Note that the authorizer callback is invoked only during ** [sqlite3_prepare()] or its variants. Authorization is not -** performed during statement evaluation in [sqlite3_step()]. +** performed during statement evaluation in [sqlite3_step()], unless +** as stated in the previous paragraph, sqlite3_step() invokes +** sqlite3_prepare_v2() to reprepare a statement after a schema change. ** ** Requirements: ** [H12501] [H12502] [H12503] [H12504] [H12505] [H12506] [H12507] [H12510] @@ -3483,12 +3503,14 @@ void sqlite3_result_zeroblob(sqlite3_context*, int n); ** the name is passed as the second function argument. ** ** The third argument may be one of the constants [SQLITE_UTF8], -** [SQLITE_UTF16LE] or [SQLITE_UTF16BE], indicating that the user-supplied +** [SQLITE_UTF16LE], or [SQLITE_UTF16BE], indicating that the user-supplied ** routine expects to be passed pointers to strings encoded using UTF-8, ** UTF-16 little-endian, or UTF-16 big-endian, respectively. The -** third argument might also be [SQLITE_UTF16_ALIGNED] to indicate that +** third argument might also be [SQLITE_UTF16] to indicate that the routine +** expects pointers to be UTF-16 strings in the native byte order, or the +** argument can be [SQLITE_UTF16_ALIGNED] if the ** the routine expects pointers to 16-bit word aligned strings -** of UTF-16 in the native byte order of the host computer. +** of UTF-16 in the native byte order. ** ** A pointer to the user supplied routine must be passed as the fifth ** argument. If it is NULL, this is the same as deleting the collation @@ -3513,6 +3535,8 @@ void sqlite3_result_zeroblob(sqlite3_context*, int n); ** collation creation functions or when the [database connection] is closed ** using [sqlite3_close()]. ** +** See also: [sqlite3_collation_needed()] and [sqlite3_collation_needed16()]. +** ** Requirements: ** [H16603] [H16604] [H16606] [H16609] [H16612] [H16615] [H16618] [H16621] ** [H16624] [H16627] [H16630] @@ -4066,15 +4090,20 @@ typedef struct sqlite3_module sqlite3_module; /* ** CAPI3REF: Virtual Table Object {H18000} -** KEYWORDS: sqlite3_module +** KEYWORDS: sqlite3_module {virtual table module} ** EXPERIMENTAL ** -** A module is a class of virtual tables. Each module is defined -** by an instance of the following structure. This structure consists -** mostly of methods for the module. +** This structure, sometimes called a a "virtual table module", +** defines the implementation of a [virtual tables]. +** This structure consists mostly of methods for the module. ** -** This interface is experimental and is subject to change or -** removal in future releases of SQLite. +** A virtual table module is created by filling in a persistent +** instance of this structure and passing a pointer to that instance +** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. +** The registration remains valid until it is replaced by a different +** module or until the [database connection] closes. The content +** of this structure must not change while it is registered with +** any database connection. */ struct sqlite3_module { int iVersion; @@ -4112,8 +4141,8 @@ struct sqlite3_module { ** EXPERIMENTAL ** ** The sqlite3_index_info structure and its substructures is used to -** pass information into and receive the reply from the xBestIndex -** method of an sqlite3_module. The fields under **Inputs** are the +** pass information into and receive the reply from the [xBestIndex] +** method of a [virtual table module]. The fields under **Inputs** are the ** inputs to xBestIndex and are read-only. xBestIndex inserts its ** results into the **Outputs** fields. ** @@ -4136,17 +4165,19 @@ struct sqlite3_module { ** Information about the ORDER BY clause is stored in aOrderBy[]. ** Each term of aOrderBy records a column of the ORDER BY clause. ** -** The xBestIndex method must fill aConstraintUsage[] with information +** The [xBestIndex] method must fill aConstraintUsage[] with information ** about what parameters to pass to xFilter. If argvIndex>0 then ** the right-hand side of the corresponding aConstraint[] is evaluated ** and becomes the argvIndex-th entry in argv. If aConstraintUsage[].omit ** is true, then the constraint is assumed to be fully handled by the ** virtual table and is not checked again by SQLite. ** -** The idxNum and idxPtr values are recorded and passed into xFilter. -** sqlite3_free() is used to free idxPtr if needToFreeIdxPtr is true. +** The idxNum and idxPtr values are recorded and passed into the +** [xFilter] method. +** [sqlite3_free()] is used to free idxPtr if and only iff +** needToFreeIdxPtr is true. ** -** The orderByConsumed means that output from xFilter will occur in +** The orderByConsumed means that output from [xFilter]/[xNext] will occur in ** the correct order to satisfy the ORDER BY clause so that no separate ** sorting step is required. ** @@ -4154,9 +4185,6 @@ struct sqlite3_module { ** particular lookup. A full scan of a table with N entries should have ** a cost of N. A binary search of a table of N entries should have a ** cost of approximately log(N). -** -** This interface is experimental and is subject to change or -** removal in future releases of SQLite. */ struct sqlite3_index_info { /* Inputs */ @@ -4194,34 +4222,44 @@ struct sqlite3_index_info { ** CAPI3REF: Register A Virtual Table Implementation {H18200} ** EXPERIMENTAL ** -** This routine is used to register a new module name with a -** [database connection]. Module names must be registered before -** creating new virtual tables on the module, or before using -** preexisting virtual tables of the module. +** This routine is used to register a new [virtual table module] name. +** Module names must be registered before +** creating a new [virtual table] using the module, or before using a +** preexisting [virtual table] for the module. ** -** This interface is experimental and is subject to change or -** removal in future releases of SQLite. +** The module name is registered on the [database connection] specified +** by the first parameter. The name of the module is given by the +** second parameter. The third parameter is a pointer to +** the implementation of the [virtual table module]. The fourth +** parameter is an arbitrary client data pointer that is passed through +** into the [xCreate] and [xConnect] methods of the virtual table module +** when a new virtual table is be being created or reinitialized. +** +** This interface has exactly the same effect as calling +** [sqlite3_create_module_v2()] with a NULL client data destructor. */ SQLITE_EXPERIMENTAL int sqlite3_create_module( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ - const sqlite3_module *, /* Methods for the module */ - void * /* Client data for xCreate/xConnect */ + const sqlite3_module *p, /* Methods for the module */ + void *pClientData /* Client data for xCreate/xConnect */ ); /* ** CAPI3REF: Register A Virtual Table Implementation {H18210} ** EXPERIMENTAL ** -** This routine is identical to the [sqlite3_create_module()] method above, -** except that it allows a destructor function to be specified. It is -** even more experimental than the rest of the virtual tables API. +** This routine is identical to the [sqlite3_create_module()] method, +** except that it has an extra parameter to specify +** a destructor function for the client data pointer. SQLite will +** invoke the destructor function (if it is not NULL) when SQLite +** no longer needs the pClientData pointer. */ SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( sqlite3 *db, /* SQLite connection to register module with */ const char *zName, /* Name of the module */ - const sqlite3_module *, /* Methods for the module */ - void *, /* Client data for xCreate/xConnect */ + const sqlite3_module *p, /* Methods for the module */ + void *pClientData, /* Client data for xCreate/xConnect */ void(*xDestroy)(void*) /* Module destructor function */ ); @@ -4230,8 +4268,9 @@ SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( ** KEYWORDS: sqlite3_vtab ** EXPERIMENTAL ** -** Every module implementation uses a subclass of the following structure -** to describe a particular instance of the module. Each subclass will +** Every [virtual table module] implementation uses a subclass +** of the following structure to describe a particular instance +** of the [virtual table]. Each subclass will ** be tailored to the specific needs of the module implementation. ** The purpose of this superclass is to define certain fields that are ** common to all module implementations. @@ -4241,13 +4280,7 @@ SQLITE_EXPERIMENTAL int sqlite3_create_module_v2( ** take care that any prior string is freed by a call to [sqlite3_free()] ** prior to assigning a new string to zErrMsg. After the error message ** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. Note -** that sqlite3_mprintf() and sqlite3_free() are used on the zErrMsg field -** since virtual tables are commonly implemented in loadable extensions which -** do not have access to sqlite3MPrintf() or sqlite3Free(). -** -** This interface is experimental and is subject to change or -** removal in future releases of SQLite. +** freed by sqlite3_free() and the zErrMsg field will be zeroed. */ struct sqlite3_vtab { const sqlite3_module *pModule; /* The module for this virtual table */ @@ -4258,20 +4291,21 @@ struct sqlite3_vtab { /* ** CAPI3REF: Virtual Table Cursor Object {H18020} -** KEYWORDS: sqlite3_vtab_cursor +** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} ** EXPERIMENTAL ** -** Every module implementation uses a subclass of the following structure -** to describe cursors that point into the virtual table and are used +** Every [virtual table module] implementation uses a subclass of the +** following structure to describe cursors that point into the +** [virtual table] and are used ** to loop through the virtual table. Cursors are created using the -** xOpen method of the module. Each module implementation will define +** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed +** by the [sqlite3_module.xClose | xClose] method. Cussors are used +** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods +** of the module. Each module implementation will define ** the content of a cursor structure to suit its own needs. ** ** This superclass exists in order to define fields of the cursor that ** are common to all implementations. -** -** This interface is experimental and is subject to change or -** removal in future releases of SQLite. */ struct sqlite3_vtab_cursor { sqlite3_vtab *pVtab; /* Virtual table of this cursor */ @@ -4282,21 +4316,20 @@ struct sqlite3_vtab_cursor { ** CAPI3REF: Declare The Schema Of A Virtual Table {H18280} ** EXPERIMENTAL ** -** The xCreate and xConnect methods of a module use the following API +** The [xCreate] and [xConnect] methods of a +** [virtual table module] call this interface ** to declare the format (the names and datatypes of the columns) of ** the virtual tables they implement. -** -** This interface is experimental and is subject to change or -** removal in future releases of SQLite. */ -SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable); +SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zSQL); /* ** CAPI3REF: Overload A Function For A Virtual Table {H18300} ** EXPERIMENTAL ** ** Virtual tables can provide alternative implementations of functions -** using the xFindFunction method. But global versions of those functions +** using the [xFindFunction] method of the [virtual table module]. +** But global versions of those functions ** must exist in order to be overloaded. ** ** This API makes sure a global version of a function with a particular @@ -4305,10 +4338,7 @@ SQLITE_EXPERIMENTAL int sqlite3_declare_vtab(sqlite3*, const char *zCreateTable) ** of the new function always causes an exception to be thrown. So ** the new function is not good for anything by itself. Its only ** purpose is to be a placeholder function that can be overloaded -** by virtual tables. -** -** This API should be considered part of the virtual table interface, -** which is experimental and subject to change. +** by a [virtual table]. */ SQLITE_EXPERIMENTAL int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); diff --git a/src/sqliteInt.h b/src/sqliteInt.h index a74b30a..82330f9 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.854 2009/04/08 13:51:51 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.868 2009/05/04 11:42:30 danielk1977 Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -145,10 +145,10 @@ #endif /* -** If SQLITE_MALLOC_SOFT_LIMIT is defined, then try to keep the +** If SQLITE_MALLOC_SOFT_LIMIT is not zero, then try to keep the ** sizes of memory allocations below this value where possible. */ -#if defined(SQLITE_POW2_MEMORY_SIZE) && !defined(SQLITE_MALLOC_SOFT_LIMIT) +#if !defined(SQLITE_MALLOC_SOFT_LIMIT) # define SQLITE_MALLOC_SOFT_LIMIT 1024 #endif @@ -219,6 +219,20 @@ # define TESTONLY(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 + /* ** The ALWAYS and NEVER macros surround boolean expressions which ** are intended to always be true or false, respectively. Such @@ -260,20 +274,6 @@ # 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" @@ -639,7 +639,6 @@ struct Schema { Hash tblHash; /* All tables indexed by name */ Hash idxHash; /* All (named) indices indexed by name */ Hash trigHash; /* All triggers indexed by name */ - Hash aFKey; /* Foreign keys indexed by to-table */ Table *pSeqTab; /* The sqlite_sequence table used by AUTOINCREMENT */ u8 file_format; /* Schema format version for this file */ u8 enc; /* Text encoding used by this database */ @@ -1195,28 +1194,21 @@ struct Table { ** ** 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 -** 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. +** the from-table is created. The existence of the to-table is not checked. */ struct FKey { Table *pFrom; /* The table that contains 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 */ - int iFrom; /* Index of column in pFrom */ - char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */ - } *aCol; /* One entry for each of nCol column s */ u8 isDeferred; /* True if constraint checking is deferred till COMMIT */ u8 updateConf; /* How to resolve conflicts that occur on UPDATE */ u8 deleteConf; /* How to resolve conflicts that occur on DELETE */ u8 insertConf; /* How to resolve conflicts that occur on INSERT */ + struct sColMap { /* Mapping of columns in pFrom to columns in zTo */ + int iFrom; /* Index of column in pFrom */ + char *zCol; /* Name of column in zTo. If 0 use PRIMARY KEY */ + } aCol[1]; /* One entry for each of nCol column s */ }; /* @@ -1290,6 +1282,7 @@ struct UnpackedRecord { KeyInfo *pKeyInfo; /* Collation and sort-order information */ u16 nField; /* Number of entries in apMem[] */ u16 flags; /* Boolean settings. UNPACKED_... below */ + i64 rowid; /* Used by UNPACKED_PREFIX_SEARCH */ Mem *aMem; /* Values */ }; @@ -1301,6 +1294,7 @@ struct UnpackedRecord { #define UNPACKED_IGNORE_ROWID 0x0004 /* Ignore trailing rowid on key1 */ #define UNPACKED_INCRKEY 0x0008 /* Make this key an epsilon larger */ #define UNPACKED_PREFIX_MATCH 0x0010 /* A prefix match is considered OK */ +#define UNPACKED_PREFIX_SEARCH 0x0020 /* A prefix match is considered OK */ /* ** Each SQL index is represented in memory by an @@ -1354,8 +1348,9 @@ struct Index { */ struct Token { const unsigned char *z; /* Text of the token. Not NULL-terminated! */ - unsigned dyn : 1; /* True for malloced memory, false for static */ - unsigned n : 31; /* Number of characters in this token */ + unsigned dyn : 1; /* True for malloced memory, false for static */ + unsigned quoted : 1; /* True if token still has its quotes */ + unsigned n : 30; /* Number of characters in this token */ }; /* @@ -1517,7 +1512,7 @@ struct Expr { #define EP_Error 0x0008 /* Expression contains one or more errors */ #define EP_Distinct 0x0010 /* Aggregate function with DISTINCT keyword */ #define EP_VarSelect 0x0020 /* pSelect is correlated, not constant */ -#define EP_Dequoted 0x0040 /* True if the string has been dequoted */ +#define EP_DblQuoted 0x0040 /* token.z was originally in "..." */ #define EP_InfixFunc 0x0080 /* True for an infix function: LIKE, GLOB, etc */ #define EP_ExpCollate 0x0100 /* Collating sequence specified explicitly */ #define EP_AnyAff 0x0200 /* Can take a cached column of any affinity */ @@ -1742,15 +1737,17 @@ struct WhereLevel { }; /* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin(). +** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() +** and the WhereInfo.wctrlFlags member. */ #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_DUPLICATES_OK 0x0008 /* Ok to return a row more than once */ +#define WHERE_OMIT_OPEN 0x0010 /* Table cursor are already open */ +#define WHERE_OMIT_CLOSE 0x0020 /* Omit close of table & index cursors */ +#define WHERE_FORCE_TABLE 0x0040 /* Do not use an index-only search */ /* ** The WHERE clause processing routine has two halves. The @@ -1763,7 +1760,6 @@ 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 */ @@ -1891,6 +1887,13 @@ struct SelectDest { int nMem; /* Number of registers allocated */ }; +/* +** Size of the column cache +*/ +#ifndef SQLITE_N_COLCACHE +# define SQLITE_N_COLCACHE 10 +#endif + /* ** An SQL parser context. A copy of this structure is passed through ** the parser and down into all the parser action routine in order to @@ -1927,15 +1930,19 @@ struct Parse { int nMem; /* Number of memory cells used so far */ int nSet; /* Number of sets used so far */ int ckBase; /* Base register of data during check constraints */ - int disableColCache; /* True to disable adding to column cache */ - int nColCache; /* Number of entries in the column cache */ - int iColCache; /* Next entry of the cache to replace */ + int iCacheLevel; /* ColCache valid when aColCache[].iLevel<=iCacheLevel */ + int iCacheCnt; /* Counter used to generate aColCache[].lru values */ + u8 nColCache; /* Number of entries in the column cache */ + u8 iColCache; /* Next entry of the cache to replace */ struct yColCache { int iTable; /* Table cursor number */ int iColumn; /* Table column number */ - char affChange; /* True if this register has had an affinity change */ - int iReg; /* Register holding value of this column */ - } aColCache[10]; /* One for each valid column cache entry */ + u8 affChange; /* True if this register has had an affinity change */ + u8 tempReg; /* iReg is a temp register that needs to be freed */ + int iLevel; /* Nesting level */ + int iReg; /* Reg with value of this column. 0 means none. */ + int lru; /* Least recently used entry has the smallest value */ + } aColCache[SQLITE_N_COLCACHE]; /* One for each column cache entry */ u32 writeMask; /* Start a write transaction on these databases */ u32 cookieMask; /* Bitmask of schema verified databases */ int cookieGoto; /* Address of OP_Goto to cookie verifier subroutine */ @@ -1993,12 +2000,13 @@ struct AuthContext { }; /* -** Bitfield flags for P2 value in OP_Insert and OP_Delete +** Bitfield flags for P5 value in OP_Insert and OP_Delete */ -#define OPFLAG_NCHANGE 1 /* Set to update db->nChange */ -#define OPFLAG_LASTROWID 2 /* Set to update db->lastRowid */ -#define OPFLAG_ISUPDATE 4 /* This OP_Insert is an sql UPDATE */ -#define OPFLAG_APPEND 8 /* This is likely to be an append */ +#define OPFLAG_NCHANGE 1 /* Set to update db->nChange */ +#define OPFLAG_LASTROWID 2 /* Set to update db->lastRowid */ +#define OPFLAG_ISUPDATE 4 /* This OP_Insert is an sql UPDATE */ +#define OPFLAG_APPEND 8 /* This is likely to be an append */ +#define OPFLAG_USESEEKRESULT 16 /* Try to avoid a seek in BtreeInsert() */ /* * Each trigger present in the database schema is stored as an instance of @@ -2289,7 +2297,6 @@ int sqlite3WalkSelectFrom(Walker*, Select*); 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); @@ -2348,8 +2355,7 @@ char *sqlite3MAppendf(sqlite3*,char*,const char*,...); void sqlite3SetString(char **, sqlite3*, const char*, ...); void sqlite3ErrorMsg(Parse*, const char*, ...); void sqlite3ErrorClear(Parse*); -void sqlite3Dequote(char*); -void sqlite3DequoteExpr(Expr*); +int sqlite3Dequote(char*); int sqlite3KeywordCode(const unsigned char*, int); int sqlite3RunParser(Parse*, const char*, char **); void sqlite3FinishCoding(Parse*); @@ -2397,6 +2403,7 @@ int sqlite3BitvecBuiltinTest(int,int*); RowSet *sqlite3RowSetInit(sqlite3*, void*, unsigned int); void sqlite3RowSetClear(RowSet*); void sqlite3RowSetInsert(RowSet*, i64); +int sqlite3RowSetTest(RowSet*, u8 iBatch, i64); int sqlite3RowSetNext(RowSet*, i64*); void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int,int); @@ -2438,14 +2445,17 @@ Expr *sqlite3LimitWhere(Parse *, SrcList *, Expr *, ExprList *, Expr *, Expr *, #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**, u16); 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 sqlite3ExprCacheStore(Parse*, int, int, int); +void sqlite3ExprCachePush(Parse*); +void sqlite3ExprCachePop(Parse*, int); +void sqlite3ExprCacheRemove(Parse*, int); +void sqlite3ExprCacheClear(Parse*); void sqlite3ExprCacheAffinityChange(Parse*, int, int); -void sqlite3ExprWritableRegister(Parse*,int); void sqlite3ExprHardCopy(Parse*,int,int); int sqlite3ExprCode(Parse*, Expr*, int); int sqlite3ExprCodeTemp(Parse*, Expr*, int*); @@ -2487,8 +2497,8 @@ 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); + 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*,int); @@ -2749,6 +2759,8 @@ int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *); int sqlite3Reprepare(Vdbe*); void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*); CollSeq *sqlite3BinaryCompareCollSeq(Parse *, Expr *, Expr *); +int sqlite3TempInMemory(const sqlite3*); + /* diff --git a/src/test1.c b/src/test1.c index d6f7f79..72eeb1a 100644 --- a/src/test1.c +++ b/src/test1.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.351 2009/04/08 15:45:32 drh Exp $ +** $Id: test1.c,v 1.353 2009/05/03 20:23:54 drh Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -1217,18 +1217,6 @@ static int sqlite3_mprintf_int( return TCL_OK; } -/* -** If zNum represents an integer that will fit in 64-bits, then set -** *pValue to that integer and return true. Otherwise return false. -*/ -static int sqlite3GetInt64(const char *zNum, i64 *pValue){ - if( sqlite3FitsIn64Bits(zNum, 0) ){ - sqlite3Atoi64(zNum, pValue); - return 1; - } - return 0; -} - /* ** Usage: sqlite3_mprintf_int64 FORMAT INTEGER INTEGER INTEGER ** @@ -1249,7 +1237,7 @@ static int sqlite3_mprintf_int64( return TCL_ERROR; } for(i=2; i<5; i++){ - if( !sqlite3GetInt64(argv[i], &a[i-2]) ){ + if( !sqlite3Atoi64(argv[i], &a[i-2]) ){ Tcl_AppendResult(interp, "argument is not a valid 64-bit integer", 0); return TCL_ERROR; } @@ -2488,11 +2476,9 @@ static int add_alignment_test_collations( sqlite3 *db; if( objc>=2 ){ if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; - sqlite3_create_collation(db, "utf16_unaligned", - SQLITE_UTF16, + sqlite3_create_collation(db, "utf16_unaligned", SQLITE_UTF16, 0, alignmentCollFunc); - sqlite3_create_collation(db, "utf16_aligned", - SQLITE_UTF16 | SQLITE_UTF16_ALIGNED, + sqlite3_create_collation(db, "utf16_aligned", SQLITE_UTF16_ALIGNED, 0, alignmentCollFunc); } return SQLITE_OK; diff --git a/src/test3.c b/src/test3.c index 0f10447..3a795b7 100644 --- a/src/test3.c +++ b/src/test3.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test3.c,v 1.103 2009/03/18 10:33:02 danielk1977 Exp $ +** $Id: test3.c,v 1.104 2009/05/04 11:42:30 danielk1977 Exp $ */ #include "sqliteInt.h" #include "btreeInt.h" @@ -782,7 +782,7 @@ static int btree_insert( return TCL_ERROR; } pBuf = Tcl_GetByteArrayFromObj(objv[3], &len); - rc = sqlite3BtreeInsert(pCur, 0, iKey, pBuf, len, nZero, 0); + rc = sqlite3BtreeInsert(pCur, 0, iKey, pBuf, len, nZero, 0, 0); }else{ int keylen; int dlen; @@ -790,7 +790,7 @@ static int btree_insert( unsigned char *pDBuf; pKBuf = Tcl_GetByteArrayFromObj(objv[2], &keylen); pDBuf = Tcl_GetByteArrayFromObj(objv[3], &dlen); - rc = sqlite3BtreeInsert(pCur, pKBuf, keylen, pDBuf, dlen, nZero, 0); + rc = sqlite3BtreeInsert(pCur, pKBuf, keylen, pDBuf, dlen, nZero, 0, 0); } sqlite3BtreeLeave(pCur->pBtree); if( rc ){ diff --git a/src/test8.c b/src/test8.c index da17fb7..a313c26 100644 --- a/src/test8.c +++ b/src/test8.c @@ -13,7 +13,7 @@ ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test8.c,v 1.76 2009/04/08 15:45:32 drh Exp $ +** $Id: test8.c,v 1.78 2009/04/29 11:50:54 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" @@ -695,7 +695,7 @@ static int echoFilter( rc = sqlite3_prepare(db, idxStr, -1, &pCur->pStmt, 0); assert( pCur->pStmt || rc!=SQLITE_OK ); for(i=0; rc==SQLITE_OK && ipStmt, i+1, argv[i]); + rc = sqlite3_bind_value(pCur->pStmt, i+1, argv[i]); } /* If everything was successful, advance to the first row of the scan */ @@ -893,16 +893,16 @@ static int echoBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ pIdxInfo->idxNum = hashString(zQuery); pIdxInfo->idxStr = zQuery; pIdxInfo->needToFreeIdxStr = 1; - if (useCost) { + if( useCost ){ pIdxInfo->estimatedCost = cost; - } else if( useIdx ){ + }else if( useIdx ){ /* Approximation of log2(nRow). */ for( ii=0; ii<(sizeof(int)*8); ii++ ){ if( nRow & (1<estimatedCost = (double)ii; } } - } else { + }else{ pIdxInfo->estimatedCost = (double)nRow; } return rc; diff --git a/src/test_async.c b/src/test_async.c index 40cd65d..52ed94b 100644 --- a/src/test_async.c +++ b/src/test_async.c @@ -10,1762 +10,85 @@ ** ************************************************************************* ** -** $Id: test_async.c,v 1.57 2009/04/07 11:21:29 danielk1977 Exp $ +** $Id: test_async.c,v 1.62 2009/04/28 13:01:09 drh Exp $ ** -** This file contains an example implementation of an asynchronous IO -** backend for SQLite. -** -** WHAT IS ASYNCHRONOUS I/O? -** -** With asynchronous I/O, write requests are handled by a separate thread -** running in the background. This means that the thread that initiates -** a database write does not have to wait for (sometimes slow) disk I/O -** to occur. The write seems to happen very quickly, though in reality -** it is happening at its usual slow pace in the background. -** -** Asynchronous I/O appears to give better responsiveness, but at a price. -** You lose the Durable property. With the default I/O backend of SQLite, -** once a write completes, you know that the information you wrote is -** safely on disk. With the asynchronous I/O, this is not the case. If -** your program crashes or if a power loss occurs after the database -** write but before the asynchronous write thread has completed, then the -** database change might never make it to disk and the next user of the -** database might not see your change. -** -** You lose Durability with asynchronous I/O, but you still retain the -** other parts of ACID: Atomic, Consistent, and Isolated. Many -** appliations get along fine without the Durablity. -** -** HOW IT WORKS -** -** Asynchronous I/O works by creating a special SQLite "vfs" structure -** and registering it with sqlite3_vfs_register(). When files opened via -** this vfs are written to (using sqlite3OsWrite()), the data is not -** written directly to disk, but is placed in the "write-queue" to be -** handled by the background thread. -** -** When files opened with the asynchronous vfs are read from -** (using sqlite3OsRead()), the data is read from the file on -** disk and the write-queue, so that from the point of view of -** the vfs reader the OsWrite() appears to have already completed. -** -** The special vfs is registered (and unregistered) by calls to -** function asyncEnable() (see below). -** -** LIMITATIONS -** -** This demonstration code is deliberately kept simple in order to keep -** the main ideas clear and easy to understand. Real applications that -** want to do asynchronous I/O might want to add additional capabilities. -** For example, in this demonstration if writes are happening at a steady -** stream that exceeds the I/O capability of the background writer thread, -** the queue of pending write operations will grow without bound until we -** run out of memory. Users of this technique may want to keep track of -** the quantity of pending writes and stop accepting new write requests -** when the buffer gets to be too big. -** -** LOCKING + CONCURRENCY -** -** Multiple connections from within a single process that use this -** implementation of asynchronous IO may access a single database -** file concurrently. From the point of view of the user, if all -** connections are from within a single process, there is no difference -** between the concurrency offered by "normal" SQLite and SQLite -** using the asynchronous backend. -** -** If connections from within multiple database files may access the -** database file, the ENABLE_FILE_LOCKING symbol (see below) must be -** defined. If it is not defined, then no locks are established on -** the database file. In this case, if multiple processes access -** the database file, corruption will quickly result. -** -** If ENABLE_FILE_LOCKING is defined (the default), then connections -** from within multiple processes may access a single database file -** without risking corruption. However concurrency is reduced as -** follows: -** -** * When a connection using asynchronous IO begins a database -** transaction, the database is locked immediately. However the -** lock is not released until after all relevant operations -** in the write-queue have been flushed to disk. This means -** (for example) that the database may remain locked for some -** time after a "COMMIT" or "ROLLBACK" is issued. -** -** * If an application using asynchronous IO executes transactions -** in quick succession, other database users may be effectively -** locked out of the database. This is because when a BEGIN -** is executed, a database lock is established immediately. But -** when the corresponding COMMIT or ROLLBACK occurs, the lock -** is not released until the relevant part of the write-queue -** has been flushed through. As a result, if a COMMIT is followed -** by a BEGIN before the write-queue is flushed through, the database -** is never unlocked,preventing other processes from accessing -** the database. -** -** Defining ENABLE_FILE_LOCKING when using an NFS or other remote -** file-system may slow things down, as synchronous round-trips to the -** server may be required to establish database file locks. +** This file contains a binding of the asynchronous IO extension interface +** (defined in ext/async/sqlite3async.h) to Tcl. */ -#define ENABLE_FILE_LOCKING -#ifndef SQLITE_AMALGAMATION -# include "sqliteInt.h" -# include -# include -#endif +#define TCL_THREADS #include -/* -** This test uses pthreads and hence only works on unix and with -** a threadsafe build of SQLite. -*/ -#if SQLITE_OS_UNIX && SQLITE_THREADSAFE +#ifdef SQLITE_ENABLE_ASYNCIO + +#include "sqlite3async.h" +#include "sqlite3.h" +#include + +/* From test1.c */ +const char *sqlite3TestErrorName(int); + + +struct TestAsyncGlobal { + int isInstalled; /* True when async VFS is installed */ +} testasync_g = { 0 }; + +TCL_DECLARE_MUTEX(testasync_g_writerMutex); /* -** This demo uses pthreads. If you do not have a pthreads implementation -** for your operating system, you will need to recode the threading -** logic. +** sqlite3async_initialize PARENT-VFS ISDEFAULT */ -#include -#include - -/* Useful macros used in several places */ -#define MIN(x,y) ((x)<(y)?(x):(y)) -#define MAX(x,y) ((x)>(y)?(x):(y)) - -/* Forward references */ -typedef struct AsyncWrite AsyncWrite; -typedef struct AsyncFile AsyncFile; -typedef struct AsyncFileData AsyncFileData; -typedef struct AsyncFileLock AsyncFileLock; -typedef struct AsyncLock AsyncLock; - -/* Enable for debugging */ -static int sqlite3async_trace = 0; -# define ASYNC_TRACE(X) if( sqlite3async_trace ) asyncTrace X -static void asyncTrace(const char *zFormat, ...){ - char *z; - va_list ap; - va_start(ap, zFormat); - z = sqlite3_vmprintf(zFormat, ap); - va_end(ap); - fprintf(stderr, "[%d] %s", (int)pthread_self(), z); - sqlite3_free(z); -} - -/* -** THREAD SAFETY NOTES -** -** Basic rules: -** -** * Both read and write access to the global write-op queue must be -** protected by the async.queueMutex. As are the async.ioError and -** async.nFile variables. -** -** * The async.pLock list and all AsyncLock and AsyncFileLock -** structures must be protected by the async.lockMutex mutex. -** -** * The file handles from the underlying system are not assumed to -** be thread safe. -** -** * See the last two paragraphs under "The Writer Thread" for -** an assumption to do with file-handle synchronization by the Os. -** -** Deadlock prevention: -** -** There are three mutex used by the system: the "writer" mutex, -** the "queue" mutex and the "lock" mutex. Rules are: -** -** * It is illegal to block on the writer mutex when any other mutex -** are held, and -** -** * It is illegal to block on the queue mutex when the lock mutex -** is held. -** -** i.e. mutex's must be grabbed in the order "writer", "queue", "lock". -** -** File system operations (invoked by SQLite thread): -** -** xOpen -** xDelete -** xFileExists -** -** File handle operations (invoked by SQLite thread): -** -** asyncWrite, asyncClose, asyncTruncate, asyncSync -** -** The operations above add an entry to the global write-op list. They -** prepare the entry, acquire the async.queueMutex momentarily while -** list pointers are manipulated to insert the new entry, then release -** the mutex and signal the writer thread to wake up in case it happens -** to be asleep. -** -** -** asyncRead, asyncFileSize. -** -** Read operations. Both of these read from both the underlying file -** first then adjust their result based on pending writes in the -** write-op queue. So async.queueMutex is held for the duration -** of these operations to prevent other threads from changing the -** queue in mid operation. -** -** -** asyncLock, asyncUnlock, asyncCheckReservedLock -** -** These primitives implement in-process locking using a hash table -** on the file name. Files are locked correctly for connections coming -** from the same process. But other processes cannot see these locks -** and will therefore not honor them. -** -** -** The writer thread: -** -** The async.writerMutex is used to make sure only there is only -** a single writer thread running at a time. -** -** Inside the writer thread is a loop that works like this: -** -** WHILE (write-op list is not empty) -** Do IO operation at head of write-op list -** Remove entry from head of write-op list -** END WHILE -** -** The async.queueMutex is always held during the test, and when the entry is removed from the head -** of the write-op list. Sometimes it is held for the interim -** period (while the IO is performed), and sometimes it is -** relinquished. It is relinquished if (a) the IO op is an -** ASYNC_CLOSE or (b) when the file handle was opened, two of -** the underlying systems handles were opened on the same -** file-system entry. -** -** If condition (b) above is true, then one file-handle -** (AsyncFile.pBaseRead) is used exclusively by sqlite threads to read the -** file, the other (AsyncFile.pBaseWrite) by sqlite3_async_flush() -** threads to perform write() operations. This means that read -** operations are not blocked by asynchronous writes (although -** asynchronous writes may still be blocked by reads). -** -** This assumes that the OS keeps two handles open on the same file -** properly in sync. That is, any read operation that starts after a -** write operation on the same file system entry has completed returns -** data consistent with the write. We also assume that if one thread -** reads a file while another is writing it all bytes other than the -** ones actually being written contain valid data. -** -** If the above assumptions are not true, set the preprocessor symbol -** SQLITE_ASYNC_TWO_FILEHANDLES to 0. -*/ - -#ifndef SQLITE_ASYNC_TWO_FILEHANDLES -/* #define SQLITE_ASYNC_TWO_FILEHANDLES 0 */ -#define SQLITE_ASYNC_TWO_FILEHANDLES 1 -#endif - -/* -** State information is held in the static variable "async" defined -** as the following structure. -** -** Both async.ioError and async.nFile are protected by async.queueMutex. -*/ -static struct TestAsyncStaticData { - pthread_mutex_t lockMutex; /* For access to aLock hash table */ - pthread_mutex_t queueMutex; /* Mutex for access to write operation queue */ - pthread_mutex_t writerMutex; /* Prevents multiple writer threads */ - pthread_cond_t queueSignal; /* For waking up sleeping writer thread */ - pthread_cond_t emptySignal; /* Notify when the write queue is empty */ - AsyncWrite *pQueueFirst; /* Next write operation to be processed */ - AsyncWrite *pQueueLast; /* Last write operation on the list */ - AsyncLock *pLock; /* Linked list of all AsyncLock structures */ - volatile int ioDelay; /* Extra delay between write operations */ - volatile int writerHaltWhenIdle; /* Writer thread halts when queue empty */ - volatile int writerHaltNow; /* Writer thread halts after next op */ - int ioError; /* True if an IO error has occurred */ - int nFile; /* Number of open files (from sqlite pov) */ -} async = { - PTHREAD_MUTEX_INITIALIZER, - PTHREAD_MUTEX_INITIALIZER, - PTHREAD_MUTEX_INITIALIZER, - PTHREAD_COND_INITIALIZER, - PTHREAD_COND_INITIALIZER, -}; - -/* Possible values of AsyncWrite.op */ -#define ASYNC_NOOP 0 -#define ASYNC_WRITE 1 -#define ASYNC_SYNC 2 -#define ASYNC_TRUNCATE 3 -#define ASYNC_CLOSE 4 -#define ASYNC_DELETE 5 -#define ASYNC_OPENEXCLUSIVE 6 -#define ASYNC_UNLOCK 7 - -/* Names of opcodes. Used for debugging only. -** Make sure these stay in sync with the macros above! -*/ -static const char *azOpcodeName[] = { - "NOOP", "WRITE", "SYNC", "TRUNCATE", "CLOSE", "DELETE", "OPENEX", "UNLOCK" -}; - -/* -** Entries on the write-op queue are instances of the AsyncWrite -** structure, defined here. -** -** The interpretation of the iOffset and nByte variables varies depending -** on the value of AsyncWrite.op: -** -** ASYNC_NOOP: -** No values used. -** -** ASYNC_WRITE: -** iOffset -> Offset in file to write to. -** nByte -> Number of bytes of data to write (pointed to by zBuf). -** -** ASYNC_SYNC: -** nByte -> flags to pass to sqlite3OsSync(). -** -** ASYNC_TRUNCATE: -** iOffset -> Size to truncate file to. -** nByte -> Unused. -** -** ASYNC_CLOSE: -** iOffset -> Unused. -** nByte -> Unused. -** -** ASYNC_DELETE: -** iOffset -> Contains the "syncDir" flag. -** nByte -> Number of bytes of zBuf points to (file name). -** -** ASYNC_OPENEXCLUSIVE: -** iOffset -> Value of "delflag". -** nByte -> Number of bytes of zBuf points to (file name). -** -** ASYNC_UNLOCK: -** nByte -> Argument to sqlite3OsUnlock(). -** -** -** For an ASYNC_WRITE operation, zBuf points to the data to write to the file. -** This space is sqlite3_malloc()d along with the AsyncWrite structure in a -** single blob, so is deleted when sqlite3_free() is called on the parent -** structure. -*/ -struct AsyncWrite { - AsyncFileData *pFileData; /* File to write data to or sync */ - int op; /* One of ASYNC_xxx etc. */ - sqlite_int64 iOffset; /* See above */ - int nByte; /* See above */ - char *zBuf; /* Data to write to file (or NULL if op!=ASYNC_WRITE) */ - AsyncWrite *pNext; /* Next write operation (to any file) */ -}; - -/* -** An instance of this structure is created for each distinct open file -** (i.e. if two handles are opened on the one file, only one of these -** structures is allocated) and stored in the async.aLock hash table. The -** keys for async.aLock are the full pathnames of the opened files. -** -** AsyncLock.pList points to the head of a linked list of AsyncFileLock -** structures, one for each handle currently open on the file. -** -** If the opened file is not a main-database (the SQLITE_OPEN_MAIN_DB is -** not passed to the sqlite3OsOpen() call), or if ENABLE_FILE_LOCKING is -** not defined at compile time, variables AsyncLock.pFile and -** AsyncLock.eLock are never used. Otherwise, pFile is a file handle -** opened on the file in question and used to obtain the file-system -** locks required by database connections within this process. -** -** See comments above the asyncLock() function for more details on -** the implementation of database locking used by this backend. -*/ -struct AsyncLock { - char *zFile; - int nFile; - sqlite3_file *pFile; - int eLock; - AsyncFileLock *pList; - AsyncLock *pNext; /* Next in linked list headed by async.pLock */ -}; - -/* -** An instance of the following structure is allocated along with each -** AsyncFileData structure (see AsyncFileData.lock), but is only used if the -** file was opened with the SQLITE_OPEN_MAIN_DB. -*/ -struct AsyncFileLock { - int eLock; /* Internally visible lock state (sqlite pov) */ - int eAsyncLock; /* Lock-state with write-queue unlock */ - AsyncFileLock *pNext; -}; - -/* -** The AsyncFile structure is a subclass of sqlite3_file used for -** asynchronous IO. -** -** All of the actual data for the structure is stored in the structure -** pointed to by AsyncFile.pData, which is allocated as part of the -** sqlite3OsOpen() using sqlite3_malloc(). The reason for this is that the -** lifetime of the AsyncFile structure is ended by the caller after OsClose() -** is called, but the data in AsyncFileData may be required by the -** writer thread after that point. -*/ -struct AsyncFile { - sqlite3_io_methods *pMethod; - AsyncFileData *pData; -}; -struct AsyncFileData { - char *zName; /* Underlying OS filename - used for debugging */ - int nName; /* Number of characters in zName */ - sqlite3_file *pBaseRead; /* Read handle to the underlying Os file */ - sqlite3_file *pBaseWrite; /* Write handle to the underlying Os file */ - AsyncFileLock lock; /* Lock state for this handle */ - AsyncLock *pLock; /* AsyncLock object for this file system entry */ - AsyncWrite closeOp; /* Preallocated close operation */ -}; - -/* -** The following async_XXX functions are debugging wrappers around the -** corresponding pthread_XXX functions: -** -** pthread_mutex_lock(); -** pthread_mutex_unlock(); -** pthread_mutex_trylock(); -** pthread_cond_wait(); -** -** It is illegal to pass any mutex other than those stored in the -** following global variables of these functions. -** -** async.queueMutex -** async.writerMutex -** async.lockMutex -** -** If NDEBUG is defined, these wrappers do nothing except call the -** corresponding pthreads function. If NDEBUG is not defined, then the -** following variables are used to store the thread-id (as returned -** by pthread_self()) currently holding the mutex, or 0 otherwise: -** -** asyncdebug.queueMutexHolder -** asyncdebug.writerMutexHolder -** asyncdebug.lockMutexHolder -** -** These variables are used by some assert() statements that verify -** the statements made in the "Deadlock Prevention" notes earlier -** in this file. -*/ -#ifndef NDEBUG - -static struct TestAsyncDebugData { - pthread_t lockMutexHolder; - pthread_t queueMutexHolder; - pthread_t writerMutexHolder; -} asyncdebug = {0, 0, 0}; - -/* -** Wrapper around pthread_mutex_lock(). Checks that we have not violated -** the anti-deadlock rules (see "Deadlock prevention" above). -*/ -static int async_mutex_lock(pthread_mutex_t *pMutex){ - int iIdx; - int rc; - pthread_mutex_t *aMutex = (pthread_mutex_t *)(&async); - pthread_t *aHolder = (pthread_t *)(&asyncdebug); - - /* The code in this 'ifndef NDEBUG' block depends on a certain alignment - * of the variables in TestAsyncStaticData and TestAsyncDebugData. The - * following assert() statements check that this has not been changed. - * - * Really, these only need to be run once at startup time. - */ - assert(&(aMutex[0])==&async.lockMutex); - assert(&(aMutex[1])==&async.queueMutex); - assert(&(aMutex[2])==&async.writerMutex); - assert(&(aHolder[0])==&asyncdebug.lockMutexHolder); - assert(&(aHolder[1])==&asyncdebug.queueMutexHolder); - assert(&(aHolder[2])==&asyncdebug.writerMutexHolder); - - assert( pthread_self()!=0 ); - for(iIdx=0; iIdx<3; iIdx++){ - if( pMutex==&aMutex[iIdx] ) break; - - /* This is the key assert(). Here we are checking that if the caller - * is trying to block on async.writerMutex, neither of the other two - * mutex are held. If the caller is trying to block on async.queueMutex, - * lockMutex is not held. - */ - assert(!pthread_equal(aHolder[iIdx], pthread_self())); - } - assert(iIdx<3); - - rc = pthread_mutex_lock(pMutex); - if( rc==0 ){ - assert(aHolder[iIdx]==0); - aHolder[iIdx] = pthread_self(); - } - return rc; -} - -/* -** Wrapper around pthread_mutex_unlock(). -*/ -static int async_mutex_unlock(pthread_mutex_t *pMutex){ - int iIdx; - int rc; - pthread_mutex_t *aMutex = (pthread_mutex_t *)(&async); - pthread_t *aHolder = (pthread_t *)(&asyncdebug); - - for(iIdx=0; iIdx<3; iIdx++){ - if( pMutex==&aMutex[iIdx] ) break; - } - assert(iIdx<3); - - assert(pthread_equal(aHolder[iIdx], pthread_self())); - aHolder[iIdx] = 0; - rc = pthread_mutex_unlock(pMutex); - assert(rc==0); - - return 0; -} - -/* -** Wrapper around pthread_mutex_trylock(). -*/ -static int async_mutex_trylock(pthread_mutex_t *pMutex){ - int iIdx; - int rc; - pthread_mutex_t *aMutex = (pthread_mutex_t *)(&async); - pthread_t *aHolder = (pthread_t *)(&asyncdebug); - - for(iIdx=0; iIdx<3; iIdx++){ - if( pMutex==&aMutex[iIdx] ) break; - } - assert(iIdx<3); - - rc = pthread_mutex_trylock(pMutex); - if( rc==0 ){ - assert(aHolder[iIdx]==0); - aHolder[iIdx] = pthread_self(); - } - return rc; -} - -/* -** Wrapper around pthread_cond_wait(). -*/ -static int async_cond_wait(pthread_cond_t *pCond, pthread_mutex_t *pMutex){ - int iIdx; - int rc; - pthread_mutex_t *aMutex = (pthread_mutex_t *)(&async); - pthread_t *aHolder = (pthread_t *)(&asyncdebug); - - for(iIdx=0; iIdx<3; iIdx++){ - if( pMutex==&aMutex[iIdx] ) break; - } - assert(iIdx<3); - - assert(pthread_equal(aHolder[iIdx],pthread_self())); - aHolder[iIdx] = 0; - rc = pthread_cond_wait(pCond, pMutex); - if( rc==0 ){ - aHolder[iIdx] = pthread_self(); - } - return rc; -} - -/* -** Assert that the mutex is held by the current thread. -*/ -static void assert_mutex_is_held(pthread_mutex_t *pMutex){ - int iIdx; - pthread_mutex_t *aMutex = (pthread_mutex_t *)(&async); - pthread_t *aHolder = (pthread_t *)(&asyncdebug); - - for(iIdx=0; iIdx<3; iIdx++){ - if( pMutex==&aMutex[iIdx] ) break; - } - assert(iIdx<3); - assert( aHolder[iIdx]==pthread_self() ); -} - -/* Call our async_XX wrappers instead of selected pthread_XX functions */ -#define pthread_mutex_lock async_mutex_lock -#define pthread_mutex_unlock async_mutex_unlock -#define pthread_mutex_trylock async_mutex_trylock -#define pthread_cond_wait async_cond_wait - -#else /* if defined(NDEBUG) */ - -#define assert_mutex_is_held(X) /* A no-op when not debugging */ - -#endif /* !defined(NDEBUG) */ - -/* -** Add an entry to the end of the global write-op list. pWrite should point -** to an AsyncWrite structure allocated using sqlite3_malloc(). The writer -** thread will call sqlite3_free() to free the structure after the specified -** operation has been completed. -** -** Once an AsyncWrite structure has been added to the list, it becomes the -** property of the writer thread and must not be read or modified by the -** caller. -*/ -static void addAsyncWrite(AsyncWrite *pWrite){ - /* We must hold the queue mutex in order to modify the queue pointers */ - if( pWrite->op!=ASYNC_UNLOCK ){ - pthread_mutex_lock(&async.queueMutex); - } - - /* Add the record to the end of the write-op queue */ - assert( !pWrite->pNext ); - if( async.pQueueLast ){ - assert( async.pQueueFirst ); - async.pQueueLast->pNext = pWrite; - }else{ - async.pQueueFirst = pWrite; - } - async.pQueueLast = pWrite; - ASYNC_TRACE(("PUSH %p (%s %s %d)\n", pWrite, azOpcodeName[pWrite->op], - pWrite->pFileData ? pWrite->pFileData->zName : "-", pWrite->iOffset)); - - if( pWrite->op==ASYNC_CLOSE ){ - async.nFile--; - } - - /* Drop the queue mutex */ - if( pWrite->op!=ASYNC_UNLOCK ){ - pthread_mutex_unlock(&async.queueMutex); - } - - /* The writer thread might have been idle because there was nothing - ** on the write-op queue for it to do. So wake it up. */ - pthread_cond_signal(&async.queueSignal); -} - -/* -** Increment async.nFile in a thread-safe manner. -*/ -static void incrOpenFileCount(void){ - /* We must hold the queue mutex in order to modify async.nFile */ - pthread_mutex_lock(&async.queueMutex); - if( async.nFile==0 ){ - async.ioError = SQLITE_OK; - } - async.nFile++; - pthread_mutex_unlock(&async.queueMutex); -} - -/* -** This is a utility function to allocate and populate a new AsyncWrite -** structure and insert it (via addAsyncWrite() ) into the global list. -*/ -static int addNewAsyncWrite( - AsyncFileData *pFileData, - int op, - sqlite3_int64 iOffset, - int nByte, - const char *zByte +static int testAsyncInit( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] ){ - AsyncWrite *p; - if( op!=ASYNC_CLOSE && async.ioError ){ - return async.ioError; + const char *zParent; + int isDefault; + int rc; + + if( objc!=3 ){ + Tcl_WrongNumArgs(interp, 1, objv, "PARENT-VFS ISDEFAULT"); + return TCL_ERROR; } - p = sqlite3_malloc(sizeof(AsyncWrite) + (zByte?nByte:0)); - if( !p ){ - /* The upper layer does not expect operations like OsWrite() to - ** return SQLITE_NOMEM. This is partly because under normal conditions - ** SQLite is required to do rollback without calling malloc(). So - ** if malloc() fails here, treat it as an I/O error. The above - ** layer knows how to handle that. - */ - return SQLITE_IOERR; + zParent = Tcl_GetString(objv[1]); + if( !*zParent ) { + zParent = 0; } - p->op = op; - p->iOffset = iOffset; - p->nByte = nByte; - p->pFileData = pFileData; - p->pNext = 0; - if( zByte ){ - p->zBuf = (char *)&p[1]; - memcpy(p->zBuf, zByte, nByte); - }else{ - p->zBuf = 0; - } - addAsyncWrite(p); - return SQLITE_OK; -} - -/* -** Close the file. This just adds an entry to the write-op list, the file is -** not actually closed. -*/ -static int asyncClose(sqlite3_file *pFile){ - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - - /* Unlock the file, if it is locked */ - pthread_mutex_lock(&async.lockMutex); - p->lock.eLock = 0; - pthread_mutex_unlock(&async.lockMutex); - - addAsyncWrite(&p->closeOp); - return SQLITE_OK; -} - -/* -** Implementation of sqlite3OsWrite() for asynchronous files. Instead of -** writing to the underlying file, this function adds an entry to the end of -** the global AsyncWrite list. Either SQLITE_OK or SQLITE_NOMEM may be -** returned. -*/ -static int asyncWrite( - sqlite3_file *pFile, - const void *pBuf, - int amt, - sqlite3_int64 iOff -){ - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - return addNewAsyncWrite(p, ASYNC_WRITE, iOff, amt, pBuf); -} - -/* -** Read data from the file. First we read from the filesystem, then adjust -** the contents of the buffer based on ASYNC_WRITE operations in the -** write-op queue. -** -** This method holds the mutex from start to finish. -*/ -static int asyncRead( - sqlite3_file *pFile, - void *zOut, - int iAmt, - sqlite3_int64 iOffset -){ - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - int rc = SQLITE_OK; - sqlite3_int64 filesize; - int nRead; - sqlite3_file *pBase = p->pBaseRead; - - /* Grab the write queue mutex for the duration of the call */ - pthread_mutex_lock(&async.queueMutex); - - /* If an I/O error has previously occurred in this virtual file - ** system, then all subsequent operations fail. - */ - if( async.ioError!=SQLITE_OK ){ - rc = async.ioError; - goto asyncread_out; + if( Tcl_GetBooleanFromObj(interp, objv[2], &isDefault) ){ + return TCL_ERROR; } - if( pBase->pMethods ){ - rc = pBase->pMethods->xFileSize(pBase, &filesize); - if( rc!=SQLITE_OK ){ - goto asyncread_out; - } - nRead = MIN(filesize - iOffset, iAmt); - if( nRead>0 ){ - rc = pBase->pMethods->xRead(pBase, zOut, nRead, iOffset); - ASYNC_TRACE(("READ %s %d bytes at %d\n", p->zName, nRead, iOffset)); - } - } - - if( rc==SQLITE_OK ){ - AsyncWrite *pWrite; - char *zName = p->zName; - - for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ - if( pWrite->op==ASYNC_WRITE && ( - (pWrite->pFileData==p) || - (zName && pWrite->pFileData->zName==zName) - )){ - int iBeginOut = (pWrite->iOffset-iOffset); - int iBeginIn = -iBeginOut; - int nCopy; - - if( iBeginIn<0 ) iBeginIn = 0; - if( iBeginOut<0 ) iBeginOut = 0; - nCopy = MIN(pWrite->nByte-iBeginIn, iAmt-iBeginOut); - - if( nCopy>0 ){ - memcpy(&((char *)zOut)[iBeginOut], &pWrite->zBuf[iBeginIn], nCopy); - ASYNC_TRACE(("OVERREAD %d bytes at %d\n", nCopy, iBeginOut+iOffset)); - } - } - } - } - -asyncread_out: - pthread_mutex_unlock(&async.queueMutex); - return rc; -} - -/* -** Truncate the file to nByte bytes in length. This just adds an entry to -** the write-op list, no IO actually takes place. -*/ -static int asyncTruncate(sqlite3_file *pFile, sqlite3_int64 nByte){ - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - return addNewAsyncWrite(p, ASYNC_TRUNCATE, nByte, 0, 0); -} - -/* -** Sync the file. This just adds an entry to the write-op list, the -** sync() is done later by sqlite3_async_flush(). -*/ -static int asyncSync(sqlite3_file *pFile, int flags){ - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - return addNewAsyncWrite(p, ASYNC_SYNC, 0, flags, 0); -} - -/* -** Read the size of the file. First we read the size of the file system -** entry, then adjust for any ASYNC_WRITE or ASYNC_TRUNCATE operations -** currently in the write-op list. -** -** This method holds the mutex from start to finish. -*/ -int asyncFileSize(sqlite3_file *pFile, sqlite3_int64 *piSize){ - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - int rc = SQLITE_OK; - sqlite3_int64 s = 0; - sqlite3_file *pBase; - - pthread_mutex_lock(&async.queueMutex); - - /* Read the filesystem size from the base file. If pBaseRead is NULL, this - ** means the file hasn't been opened yet. In this case all relevant data - ** must be in the write-op queue anyway, so we can omit reading from the - ** file-system. - */ - pBase = p->pBaseRead; - if( pBase->pMethods ){ - rc = pBase->pMethods->xFileSize(pBase, &s); - } - - if( rc==SQLITE_OK ){ - AsyncWrite *pWrite; - for(pWrite=async.pQueueFirst; pWrite; pWrite = pWrite->pNext){ - if( pWrite->op==ASYNC_DELETE - && p->zName - && strcmp(p->zName, pWrite->zBuf)==0 - ){ - s = 0; - }else if( pWrite->pFileData && ( - (pWrite->pFileData==p) - || (p->zName && pWrite->pFileData->zName==p->zName) - )){ - switch( pWrite->op ){ - case ASYNC_WRITE: - s = MAX(pWrite->iOffset + (sqlite3_int64)(pWrite->nByte), s); - break; - case ASYNC_TRUNCATE: - s = MIN(s, pWrite->iOffset); - break; - } - } - } - *piSize = s; - } - pthread_mutex_unlock(&async.queueMutex); - return rc; -} - -/* -** Lock or unlock the actual file-system entry. -*/ -static int getFileLock(AsyncLock *pLock){ - int rc = SQLITE_OK; - AsyncFileLock *pIter; - int eRequired = 0; - - if( pLock->pFile ){ - for(pIter=pLock->pList; pIter; pIter=pIter->pNext){ - assert(pIter->eAsyncLock>=pIter->eLock); - if( pIter->eAsyncLock>eRequired ){ - eRequired = pIter->eAsyncLock; - assert(eRequired>=0 && eRequired<=SQLITE_LOCK_EXCLUSIVE); - } - } - - if( eRequired>pLock->eLock ){ - rc = pLock->pFile->pMethods->xLock(pLock->pFile, eRequired); - if( rc==SQLITE_OK ){ - pLock->eLock = eRequired; - } - } - else if( eRequiredeLock && eRequired<=SQLITE_LOCK_SHARED ){ - rc = pLock->pFile->pMethods->xUnlock(pLock->pFile, eRequired); - if( rc==SQLITE_OK ){ - pLock->eLock = eRequired; - } - } - } - - return rc; -} - -/* -** Return the AsyncLock structure from the global async.pLock list -** associated with the file-system entry identified by path zName -** (a string of nName bytes). If no such structure exists, return 0. -*/ -static AsyncLock *findLock(const char *zName, int nName){ - AsyncLock *p = async.pLock; - while( p && (p->nFile!=nName || memcmp(p->zFile, zName, nName)) ){ - p = p->pNext; - } - return p; -} - -/* -** The following two methods - asyncLock() and asyncUnlock() - are used -** to obtain and release locks on database files opened with the -** asynchronous backend. -*/ -static int asyncLock(sqlite3_file *pFile, int eLock){ - int rc = SQLITE_OK; - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - - if( p->zName ){ - pthread_mutex_lock(&async.lockMutex); - if( p->lock.eLockpLock; - AsyncFileLock *pIter; - assert(pLock && pLock->pList); - for(pIter=pLock->pList; pIter; pIter=pIter->pNext){ - if( pIter!=&p->lock && ( - (eLock==SQLITE_LOCK_EXCLUSIVE && pIter->eLock>=SQLITE_LOCK_SHARED) || - (eLock==SQLITE_LOCK_PENDING && pIter->eLock>=SQLITE_LOCK_RESERVED) || - (eLock==SQLITE_LOCK_RESERVED && pIter->eLock>=SQLITE_LOCK_RESERVED) || - (eLock==SQLITE_LOCK_SHARED && pIter->eLock>=SQLITE_LOCK_PENDING) - )){ - rc = SQLITE_BUSY; - } - } - if( rc==SQLITE_OK ){ - p->lock.eLock = eLock; - p->lock.eAsyncLock = MAX(p->lock.eAsyncLock, eLock); - } - assert(p->lock.eAsyncLock>=p->lock.eLock); - if( rc==SQLITE_OK ){ - rc = getFileLock(pLock); - } - } - pthread_mutex_unlock(&async.lockMutex); - } - - ASYNC_TRACE(("LOCK %d (%s) rc=%d\n", eLock, p->zName, rc)); - return rc; -} -static int asyncUnlock(sqlite3_file *pFile, int eLock){ - int rc = SQLITE_OK; - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - if( p->zName ){ - AsyncFileLock *pLock = &p->lock; - pthread_mutex_lock(&async.queueMutex); - pthread_mutex_lock(&async.lockMutex); - pLock->eLock = MIN(pLock->eLock, eLock); - rc = addNewAsyncWrite(p, ASYNC_UNLOCK, 0, eLock, 0); - pthread_mutex_unlock(&async.lockMutex); - pthread_mutex_unlock(&async.queueMutex); - } - return rc; -} - -/* -** This function is called when the pager layer first opens a database file -** and is checking for a hot-journal. -*/ -static int asyncCheckReservedLock(sqlite3_file *pFile, int *pResOut){ - int ret = 0; - AsyncFileLock *pIter; - AsyncFileData *p = ((AsyncFile *)pFile)->pData; - - pthread_mutex_lock(&async.lockMutex); - for(pIter=p->pLock->pList; pIter; pIter=pIter->pNext){ - if( pIter->eLock>=SQLITE_LOCK_RESERVED ){ - ret = 1; - } - } - pthread_mutex_unlock(&async.lockMutex); - - ASYNC_TRACE(("CHECK-LOCK %d (%s)\n", ret, p->zName)); - *pResOut = ret; - return SQLITE_OK; -} - -/* -** sqlite3_file_control() implementation. -*/ -static int asyncFileControl(sqlite3_file *id, int op, void *pArg){ - switch( op ){ - case SQLITE_FCNTL_LOCKSTATE: { - pthread_mutex_lock(&async.lockMutex); - *(int*)pArg = ((AsyncFile*)id)->pData->lock.eLock; - pthread_mutex_unlock(&async.lockMutex); - return SQLITE_OK; - } - } - return SQLITE_ERROR; -} - -/* -** Return the device characteristics and sector-size of the device. It -** is not tricky to implement these correctly, as this backend might -** not have an open file handle at this point. -*/ -static int asyncSectorSize(sqlite3_file *pFile){ - return 512; -} -static int asyncDeviceCharacteristics(sqlite3_file *pFile){ - return 0; -} - -static int unlinkAsyncFile(AsyncFileData *pData){ - AsyncFileLock **ppIter; - int rc = SQLITE_OK; - - if( pData->zName ){ - AsyncLock *pLock = pData->pLock; - for(ppIter=&pLock->pList; *ppIter; ppIter=&((*ppIter)->pNext)){ - if( (*ppIter)==&pData->lock ){ - *ppIter = pData->lock.pNext; - break; - } - } - if( !pLock->pList ){ - AsyncLock **pp; - if( pLock->pFile ){ - pLock->pFile->pMethods->xClose(pLock->pFile); - } - for(pp=&async.pLock; *pp!=pLock; pp=&((*pp)->pNext)); - *pp = pLock->pNext; - sqlite3_free(pLock); - }else{ - rc = getFileLock(pLock); - } - } - - return rc; -} - -/* -** The parameter passed to this function is a copy of a 'flags' parameter -** passed to this modules xOpen() method. This function returns true -** if the file should be opened asynchronously, or false if it should -** be opened immediately. -** -** If the file is to be opened asynchronously, then asyncOpen() will add -** an entry to the event queue and the file will not actually be opened -** until the event is processed. Otherwise, the file is opened directly -** by the caller. -*/ -static int doAsynchronousOpen(int flags){ - return (flags&SQLITE_OPEN_CREATE) && ( - (flags&SQLITE_OPEN_MAIN_JOURNAL) || - (flags&SQLITE_OPEN_TEMP_JOURNAL) || - (flags&SQLITE_OPEN_DELETEONCLOSE) - ); -} - -/* -** Open a file. -*/ -static int asyncOpen( - sqlite3_vfs *pAsyncVfs, - const char *zName, - sqlite3_file *pFile, - int flags, - int *pOutFlags -){ - static sqlite3_io_methods async_methods = { - 1, /* iVersion */ - asyncClose, /* xClose */ - asyncRead, /* xRead */ - asyncWrite, /* xWrite */ - asyncTruncate, /* xTruncate */ - asyncSync, /* xSync */ - asyncFileSize, /* xFileSize */ - asyncLock, /* xLock */ - asyncUnlock, /* xUnlock */ - asyncCheckReservedLock, /* xCheckReservedLock */ - asyncFileControl, /* xFileControl */ - asyncSectorSize, /* xSectorSize */ - asyncDeviceCharacteristics /* xDeviceCharacteristics */ - }; - - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - AsyncFile *p = (AsyncFile *)pFile; - int nName = 0; - int rc = SQLITE_OK; - int nByte; - AsyncFileData *pData; - AsyncLock *pLock = 0; - char *z; - int isAsyncOpen = doAsynchronousOpen(flags); - - /* If zName is NULL, then the upper layer is requesting an anonymous file */ - if( zName ){ - nName = strlen(zName)+1; - } - - nByte = ( - sizeof(AsyncFileData) + /* AsyncFileData structure */ - 2 * pVfs->szOsFile + /* AsyncFileData.pBaseRead and pBaseWrite */ - nName /* AsyncFileData.zName */ - ); - z = sqlite3_malloc(nByte); - if( !z ){ - return SQLITE_NOMEM; - } - memset(z, 0, nByte); - pData = (AsyncFileData*)z; - z += sizeof(pData[0]); - pData->pBaseRead = (sqlite3_file*)z; - z += pVfs->szOsFile; - pData->pBaseWrite = (sqlite3_file*)z; - pData->closeOp.pFileData = pData; - pData->closeOp.op = ASYNC_CLOSE; - - if( zName ){ - z += pVfs->szOsFile; - pData->zName = z; - pData->nName = nName; - memcpy(pData->zName, zName, nName); - } - - if( !isAsyncOpen ){ - int flagsout; - rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, &flagsout); - if( rc==SQLITE_OK && (flagsout&SQLITE_OPEN_READWRITE) ){ - rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseWrite, flags, 0); - } - if( pOutFlags ){ - *pOutFlags = flagsout; - } - } - - pthread_mutex_lock(&async.lockMutex); - - if( zName && rc==SQLITE_OK ){ - pLock = findLock(pData->zName, pData->nName); - if( !pLock ){ - int nByte = pVfs->szOsFile + sizeof(AsyncLock) + pData->nName + 1; - pLock = (AsyncLock *)sqlite3_malloc(nByte); - if( pLock ){ - memset(pLock, 0, nByte); -#ifdef ENABLE_FILE_LOCKING - if( flags&SQLITE_OPEN_MAIN_DB ){ - pLock->pFile = (sqlite3_file *)&pLock[1]; - rc = pVfs->xOpen(pVfs, pData->zName, pLock->pFile, flags, 0); - if( rc!=SQLITE_OK ){ - sqlite3_free(pLock); - pLock = 0; - } - } -#endif - if( pLock ){ - pLock->nFile = pData->nName; - pLock->zFile = &((char *)(&pLock[1]))[pVfs->szOsFile]; - memcpy(pLock->zFile, pData->zName, pLock->nFile); - pLock->pNext = async.pLock; - async.pLock = pLock; - } - }else{ - rc = SQLITE_NOMEM; - } - } - } - - if( rc==SQLITE_OK ){ - p->pMethod = &async_methods; - p->pData = pData; - - /* Link AsyncFileData.lock into the linked list of - ** AsyncFileLock structures for this file. - */ - if( zName ){ - pData->lock.pNext = pLock->pList; - pLock->pList = &pData->lock; - pData->zName = pLock->zFile; - } - }else{ - if( pData->pBaseRead->pMethods ){ - pData->pBaseRead->pMethods->xClose(pData->pBaseRead); - } - if( pData->pBaseWrite->pMethods ){ - pData->pBaseWrite->pMethods->xClose(pData->pBaseWrite); - } - sqlite3_free(pData); - } - - pthread_mutex_unlock(&async.lockMutex); - - if( rc==SQLITE_OK ){ - incrOpenFileCount(); - pData->pLock = pLock; - } - - if( rc==SQLITE_OK && isAsyncOpen ){ - rc = addNewAsyncWrite(pData, ASYNC_OPENEXCLUSIVE, (sqlite3_int64)flags,0,0); - if( rc==SQLITE_OK ){ - if( pOutFlags ) *pOutFlags = flags; - }else{ - pthread_mutex_lock(&async.lockMutex); - unlinkAsyncFile(pData); - pthread_mutex_unlock(&async.lockMutex); - sqlite3_free(pData); - } - } + rc = sqlite3async_initialize(zParent, isDefault); if( rc!=SQLITE_OK ){ - p->pMethod = 0; - } - return rc; -} - -/* -** Implementation of sqlite3OsDelete. Add an entry to the end of the -** write-op queue to perform the delete. -*/ -static int asyncDelete(sqlite3_vfs *pAsyncVfs, const char *z, int syncDir){ - return addNewAsyncWrite(0, ASYNC_DELETE, syncDir, strlen(z)+1, z); -} - -/* -** Implementation of sqlite3OsAccess. This method holds the mutex from -** start to finish. -*/ -static int asyncAccess( - sqlite3_vfs *pAsyncVfs, - const char *zName, - int flags, - int *pResOut -){ - int rc; - int ret; - AsyncWrite *p; - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - - assert(flags==SQLITE_ACCESS_READWRITE - || flags==SQLITE_ACCESS_READ - || flags==SQLITE_ACCESS_EXISTS - ); - - pthread_mutex_lock(&async.queueMutex); - rc = pVfs->xAccess(pVfs, zName, flags, &ret); - if( rc==SQLITE_OK && flags==SQLITE_ACCESS_EXISTS ){ - for(p=async.pQueueFirst; p; p = p->pNext){ - if( p->op==ASYNC_DELETE && 0==strcmp(p->zBuf, zName) ){ - ret = 0; - }else if( p->op==ASYNC_OPENEXCLUSIVE - && p->pFileData->zName - && 0==strcmp(p->pFileData->zName, zName) - ){ - ret = 1; - } - } - } - ASYNC_TRACE(("ACCESS(%s): %s = %d\n", - flags==SQLITE_ACCESS_READWRITE?"read-write": - flags==SQLITE_ACCESS_READ?"read":"exists" - , zName, ret) - ); - pthread_mutex_unlock(&async.queueMutex); - *pResOut = ret; - return rc; -} - -/* -** Fill in zPathOut with the full path to the file identified by zPath. -*/ -static int asyncFullPathname( - sqlite3_vfs *pAsyncVfs, - const char *zPath, - int nPathOut, - char *zPathOut -){ - int rc; - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - rc = pVfs->xFullPathname(pVfs, zPath, nPathOut, zPathOut); - - /* Because of the way intra-process file locking works, this backend - ** needs to return a canonical path. The following block assumes the - ** file-system uses unix style paths. - */ - if( rc==SQLITE_OK ){ - int i, j; - int n = nPathOut; - char *z = zPathOut; - 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 rc; -} -static void *asyncDlOpen(sqlite3_vfs *pAsyncVfs, const char *zPath){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - return pVfs->xDlOpen(pVfs, zPath); -} -static void asyncDlError(sqlite3_vfs *pAsyncVfs, int nByte, char *zErrMsg){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - pVfs->xDlError(pVfs, nByte, zErrMsg); -} -static void (*asyncDlSym( - sqlite3_vfs *pAsyncVfs, - void *pHandle, - const char *zSymbol -))(void){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - return pVfs->xDlSym(pVfs, pHandle, zSymbol); -} -static void asyncDlClose(sqlite3_vfs *pAsyncVfs, void *pHandle){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - pVfs->xDlClose(pVfs, pHandle); -} -static int asyncRandomness(sqlite3_vfs *pAsyncVfs, int nByte, char *zBufOut){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - return pVfs->xRandomness(pVfs, nByte, zBufOut); -} -static int asyncSleep(sqlite3_vfs *pAsyncVfs, int nMicro){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - return pVfs->xSleep(pVfs, nMicro); -} -static int asyncCurrentTime(sqlite3_vfs *pAsyncVfs, double *pTimeOut){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)pAsyncVfs->pAppData; - return pVfs->xCurrentTime(pVfs, pTimeOut); -} - -static sqlite3_vfs async_vfs = { - 1, /* iVersion */ - sizeof(AsyncFile), /* szOsFile */ - 0, /* mxPathname */ - 0, /* pNext */ - "async", /* zName */ - 0, /* pAppData */ - asyncOpen, /* xOpen */ - asyncDelete, /* xDelete */ - asyncAccess, /* xAccess */ - asyncFullPathname, /* xFullPathname */ - asyncDlOpen, /* xDlOpen */ - asyncDlError, /* xDlError */ - asyncDlSym, /* xDlSym */ - asyncDlClose, /* xDlClose */ - asyncRandomness, /* xDlError */ - asyncSleep, /* xDlSym */ - asyncCurrentTime /* xDlClose */ -}; - -/* -** Call this routine to enable or disable the -** asynchronous IO features implemented in this file. -** -** This routine is not even remotely threadsafe. Do not call -** this routine while any SQLite database connections are open. -*/ -static void asyncEnable(int enable){ - if( enable ){ - if( !async_vfs.pAppData ){ - async_vfs.pAppData = (void *)sqlite3_vfs_find(0); - async_vfs.mxPathname = ((sqlite3_vfs *)async_vfs.pAppData)->mxPathname; - sqlite3_vfs_register(&async_vfs, 1); - } - }else{ - if( async_vfs.pAppData ){ - sqlite3_vfs_unregister(&async_vfs); - async_vfs.pAppData = 0; - } - } -} - -/* -** This procedure runs in a separate thread, reading messages off of the -** write queue and processing them one by one. -** -** If async.writerHaltNow is true, then this procedure exits -** after processing a single message. -** -** If async.writerHaltWhenIdle is true, then this procedure exits when -** the write queue is empty. -** -** If both of the above variables are false, this procedure runs -** indefinately, waiting for operations to be added to the write queue -** and processing them in the order in which they arrive. -** -** An artifical delay of async.ioDelay milliseconds is inserted before -** each write operation in order to simulate the effect of a slow disk. -** -** Only one instance of this procedure may be running at a time. -*/ -static void *asyncWriterThread(void *pIsStarted){ - sqlite3_vfs *pVfs = (sqlite3_vfs *)(async_vfs.pAppData); - AsyncWrite *p = 0; - int rc = SQLITE_OK; - int holdingMutex = 0; - - if( pthread_mutex_trylock(&async.writerMutex) ){ - return 0; - } - (*(int *)pIsStarted) = 1; - while( async.writerHaltNow==0 ){ - int doNotFree = 0; - sqlite3_file *pBase = 0; - - if( !holdingMutex ){ - pthread_mutex_lock(&async.queueMutex); - } - while( (p = async.pQueueFirst)==0 ){ - pthread_cond_broadcast(&async.emptySignal); - if( async.writerHaltWhenIdle ){ - pthread_mutex_unlock(&async.queueMutex); - break; - }else{ - ASYNC_TRACE(("IDLE\n")); - pthread_cond_wait(&async.queueSignal, &async.queueMutex); - ASYNC_TRACE(("WAKEUP\n")); - } - } - if( p==0 ) break; - holdingMutex = 1; - - /* Right now this thread is holding the mutex on the write-op queue. - ** Variable 'p' points to the first entry in the write-op queue. In - ** the general case, we hold on to the mutex for the entire body of - ** the loop. - ** - ** However in the cases enumerated below, we relinquish the mutex, - ** perform the IO, and then re-request the mutex before removing 'p' from - ** the head of the write-op queue. The idea is to increase concurrency with - ** sqlite threads. - ** - ** * An ASYNC_CLOSE operation. - ** * An ASYNC_OPENEXCLUSIVE operation. For this one, we relinquish - ** the mutex, call the underlying xOpenExclusive() function, then - ** re-aquire the mutex before seting the AsyncFile.pBaseRead - ** variable. - ** * ASYNC_SYNC and ASYNC_WRITE operations, if - ** SQLITE_ASYNC_TWO_FILEHANDLES was set at compile time and two - ** file-handles are open for the particular file being "synced". - */ - if( async.ioError!=SQLITE_OK && p->op!=ASYNC_CLOSE ){ - p->op = ASYNC_NOOP; - } - if( p->pFileData ){ - pBase = p->pFileData->pBaseWrite; - if( - p->op==ASYNC_CLOSE || - p->op==ASYNC_OPENEXCLUSIVE || - (pBase->pMethods && (p->op==ASYNC_SYNC || p->op==ASYNC_WRITE) ) - ){ - pthread_mutex_unlock(&async.queueMutex); - holdingMutex = 0; - } - if( !pBase->pMethods ){ - pBase = p->pFileData->pBaseRead; - } - } - - switch( p->op ){ - case ASYNC_NOOP: - break; - - case ASYNC_WRITE: - assert( pBase ); - ASYNC_TRACE(("WRITE %s %d bytes at %d\n", - p->pFileData->zName, p->nByte, p->iOffset)); - rc = pBase->pMethods->xWrite(pBase, (void *)(p->zBuf), p->nByte, p->iOffset); - break; - - case ASYNC_SYNC: - assert( pBase ); - ASYNC_TRACE(("SYNC %s\n", p->pFileData->zName)); - rc = pBase->pMethods->xSync(pBase, p->nByte); - break; - - case ASYNC_TRUNCATE: - assert( pBase ); - ASYNC_TRACE(("TRUNCATE %s to %d bytes\n", - p->pFileData->zName, p->iOffset)); - rc = pBase->pMethods->xTruncate(pBase, p->iOffset); - break; - - case ASYNC_CLOSE: { - AsyncFileData *pData = p->pFileData; - ASYNC_TRACE(("CLOSE %s\n", p->pFileData->zName)); - if( pData->pBaseWrite->pMethods ){ - pData->pBaseWrite->pMethods->xClose(pData->pBaseWrite); - } - if( pData->pBaseRead->pMethods ){ - pData->pBaseRead->pMethods->xClose(pData->pBaseRead); - } - - /* Unlink AsyncFileData.lock from the linked list of AsyncFileLock - ** structures for this file. Obtain the async.lockMutex mutex - ** before doing so. - */ - pthread_mutex_lock(&async.lockMutex); - rc = unlinkAsyncFile(pData); - pthread_mutex_unlock(&async.lockMutex); - - if( !holdingMutex ){ - pthread_mutex_lock(&async.queueMutex); - holdingMutex = 1; - } - assert_mutex_is_held(&async.queueMutex); - async.pQueueFirst = p->pNext; - sqlite3_free(pData); - doNotFree = 1; - break; - } - - case ASYNC_UNLOCK: { - AsyncWrite *pIter; - AsyncFileData *pData = p->pFileData; - int eLock = p->nByte; - - /* When a file is locked by SQLite using the async backend, it is - ** locked within the 'real' file-system synchronously. When it is - ** unlocked, an ASYNC_UNLOCK event is added to the write-queue to - ** unlock the file asynchronously. The design of the async backend - ** requires that the 'real' file-system file be locked from the - ** time that SQLite first locks it (and probably reads from it) - ** until all asynchronous write events that were scheduled before - ** SQLite unlocked the file have been processed. - ** - ** This is more complex if SQLite locks and unlocks the file multiple - ** times in quick succession. For example, if SQLite does: - ** - ** lock, write, unlock, lock, write, unlock - ** - ** Each "lock" operation locks the file immediately. Each "write" - ** and "unlock" operation adds an event to the event queue. If the - ** second "lock" operation is performed before the first "unlock" - ** operation has been processed asynchronously, then the first - ** "unlock" cannot be safely processed as is, since this would mean - ** the file was unlocked when the second "write" operation is - ** processed. To work around this, when processing an ASYNC_UNLOCK - ** operation, SQLite: - ** - ** 1) Unlocks the file to the minimum of the argument passed to - ** the xUnlock() call and the current lock from SQLite's point - ** of view, and - ** - ** 2) Only unlocks the file at all if this event is the last - ** ASYNC_UNLOCK event on this file in the write-queue. - */ - assert( holdingMutex==1 ); - assert( async.pQueueFirst==p ); - for(pIter=async.pQueueFirst->pNext; pIter; pIter=pIter->pNext){ - if( pIter->pFileData==pData && pIter->op==ASYNC_UNLOCK ) break; - } - if( !pIter ){ - pthread_mutex_lock(&async.lockMutex); - pData->lock.eAsyncLock = MIN( - pData->lock.eAsyncLock, MAX(pData->lock.eLock, eLock) - ); - assert(pData->lock.eAsyncLock>=pData->lock.eLock); - rc = getFileLock(pData->pLock); - pthread_mutex_unlock(&async.lockMutex); - } - break; - } - - case ASYNC_DELETE: - ASYNC_TRACE(("DELETE %s\n", p->zBuf)); - rc = pVfs->xDelete(pVfs, p->zBuf, (int)p->iOffset); - break; - - case ASYNC_OPENEXCLUSIVE: { - int flags = (int)p->iOffset; - AsyncFileData *pData = p->pFileData; - ASYNC_TRACE(("OPEN %s flags=%d\n", p->zBuf, (int)p->iOffset)); - assert(pData->pBaseRead->pMethods==0 && pData->pBaseWrite->pMethods==0); - rc = pVfs->xOpen(pVfs, pData->zName, pData->pBaseRead, flags, 0); - assert( holdingMutex==0 ); - pthread_mutex_lock(&async.queueMutex); - holdingMutex = 1; - break; - } - - default: assert(!"Illegal value for AsyncWrite.op"); - } - - /* If we didn't hang on to the mutex during the IO op, obtain it now - ** so that the AsyncWrite structure can be safely removed from the - ** global write-op queue. - */ - if( !holdingMutex ){ - pthread_mutex_lock(&async.queueMutex); - holdingMutex = 1; - } - /* ASYNC_TRACE(("UNLINK %p\n", p)); */ - if( p==async.pQueueLast ){ - async.pQueueLast = 0; - } - if( !doNotFree ){ - assert_mutex_is_held(&async.queueMutex); - async.pQueueFirst = p->pNext; - sqlite3_free(p); - } - assert( holdingMutex ); - - /* An IO error has occurred. We cannot report the error back to the - ** connection that requested the I/O since the error happened - ** asynchronously. The connection has already moved on. There - ** really is nobody to report the error to. - ** - ** The file for which the error occurred may have been a database or - ** journal file. Regardless, none of the currently queued operations - ** associated with the same database should now be performed. Nor should - ** any subsequently requested IO on either a database or journal file - ** handle for the same database be accepted until the main database - ** file handle has been closed and reopened. - ** - ** Furthermore, no further IO should be queued or performed on any file - ** handle associated with a database that may have been part of a - ** multi-file transaction that included the database associated with - ** the IO error (i.e. a database ATTACHed to the same handle at some - ** point in time). - */ - if( rc!=SQLITE_OK ){ - async.ioError = rc; - } - - if( async.ioError && !async.pQueueFirst ){ - pthread_mutex_lock(&async.lockMutex); - if( 0==async.pLock ){ - async.ioError = SQLITE_OK; - } - pthread_mutex_unlock(&async.lockMutex); - } - - /* Drop the queue mutex before continuing to the next write operation - ** in order to give other threads a chance to work with the write queue. - */ - if( !async.pQueueFirst || !async.ioError ){ - pthread_mutex_unlock(&async.queueMutex); - holdingMutex = 0; - if( async.ioDelay>0 ){ - pVfs->xSleep(pVfs, async.ioDelay); - }else{ - sched_yield(); - } - } - } - - pthread_mutex_unlock(&async.writerMutex); - return 0; -} - -/************************************************************************** -** The remaining code defines a Tcl interface for testing the asynchronous -** IO implementation in this file. -** -** To adapt the code to a non-TCL environment, delete or comment out -** the code that follows. -*/ - -/* -** sqlite3async_enable ?YES/NO? -** -** Enable or disable the asynchronous I/O backend. This command is -** not thread-safe. Do not call it while any database connections -** are open. -*/ -static int testAsyncEnable( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - if( objc!=1 && objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "?YES/NO?"); - return TCL_ERROR; - } - if( objc==1 ){ - Tcl_SetObjResult(interp, Tcl_NewBooleanObj(async_vfs.pAppData!=0)); - }else{ - int en; - if( Tcl_GetBooleanFromObj(interp, objv[1], &en) ) return TCL_ERROR; - asyncEnable(en); - } - return TCL_OK; -} - -/* -** sqlite3async_halt "now"|"idle"|"never" -** -** Set the conditions at which the writer thread will halt. -*/ -static int testAsyncHalt( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - const char *zCond; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "\"now\"|\"idle\"|\"never\""); - return TCL_ERROR; - } - zCond = Tcl_GetString(objv[1]); - if( strcmp(zCond, "now")==0 ){ - async.writerHaltNow = 1; - pthread_cond_broadcast(&async.queueSignal); - }else if( strcmp(zCond, "idle")==0 ){ - async.writerHaltWhenIdle = 1; - async.writerHaltNow = 0; - pthread_cond_broadcast(&async.queueSignal); - }else if( strcmp(zCond, "never")==0 ){ - async.writerHaltWhenIdle = 0; - async.writerHaltNow = 0; - }else{ - Tcl_AppendResult(interp, - "should be one of: \"now\", \"idle\", or \"never\"", (char*)0); + Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3TestErrorName(rc), -1)); return TCL_ERROR; } return TCL_OK; } /* -** sqlite3async_delay ?MS? -** -** Query or set the number of milliseconds of delay in the writer -** thread after each write operation. The default is 0. By increasing -** the memory delay we can simulate the effect of slow disk I/O. +** sqlite3async_shutdown */ -static int testAsyncDelay( +static int testAsyncShutdown( void * clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[] ){ - if( objc!=1 && objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "?MS?"); - return TCL_ERROR; - } - if( objc==1 ){ - Tcl_SetObjResult(interp, Tcl_NewIntObj(async.ioDelay)); - }else{ - int ioDelay; - if( Tcl_GetIntFromObj(interp, objv[1], &ioDelay) ) return TCL_ERROR; - async.ioDelay = ioDelay; - } + sqlite3async_shutdown(); return TCL_OK; } +static Tcl_ThreadCreateType tclWriterThread(ClientData pIsStarted){ + Tcl_MutexLock(&testasync_g_writerMutex); + *((int *)pIsStarted) = 1; + sqlite3async_run(); + Tcl_MutexUnlock(&testasync_g_writerMutex); + TCL_THREAD_CREATE_RETURN; +} + /* ** sqlite3async_start ** @@ -1777,18 +100,21 @@ static int testAsyncStart( int objc, Tcl_Obj *CONST objv[] ){ - pthread_t x; - int rc; volatile int isStarted = 0; - rc = pthread_create(&x, 0, asyncWriterThread, (void *)&isStarted); - if( rc ){ - Tcl_AppendResult(interp, "failed to create the thread", 0); + ClientData threadData = (ClientData)&isStarted; + + Tcl_ThreadId x; + const int nStack = TCL_THREAD_STACK_DEFAULT; + const int flags = TCL_THREAD_NOFLAGS; + int rc; + + rc = Tcl_CreateThread(&x, tclWriterThread, threadData, nStack, flags); + if( rc!=TCL_OK ){ + Tcl_AppendResult(interp, "Tcl_CreateThread() failed", 0); return TCL_ERROR; } - pthread_detach(x); - while( isStarted==0 ){ - sched_yield(); - } + + while( isStarted==0 ) { /* Busy loop */ } return TCL_OK; } @@ -1806,31 +132,97 @@ static int testAsyncWait( int objc, Tcl_Obj *CONST objv[] ){ - int cnt = 10; - if( async.writerHaltNow==0 && async.writerHaltWhenIdle==0 ){ + int eCond; + if( objc!=1 ){ + Tcl_WrongNumArgs(interp, 1, objv, ""); + return TCL_ERROR; + } + + sqlite3async_control(SQLITEASYNC_GET_HALT, &eCond); + if( eCond==SQLITEASYNC_HALT_NEVER ){ Tcl_AppendResult(interp, "would block forever", (char*)0); return TCL_ERROR; } - while( cnt-- && !pthread_mutex_trylock(&async.writerMutex) ){ - pthread_mutex_unlock(&async.writerMutex); - sched_yield(); - } - if( cnt>=0 ){ - ASYNC_TRACE(("WAIT\n")); - pthread_mutex_lock(&async.queueMutex); - pthread_cond_broadcast(&async.queueSignal); - pthread_mutex_unlock(&async.queueMutex); - pthread_mutex_lock(&async.writerMutex); - pthread_mutex_unlock(&async.writerMutex); - }else{ - ASYNC_TRACE(("NO-WAIT\n")); - } + Tcl_MutexLock(&testasync_g_writerMutex); + Tcl_MutexUnlock(&testasync_g_writerMutex); return TCL_OK; } +/* +** sqlite3async_control OPTION ?VALUE? +*/ +static int testAsyncControl( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int rc = SQLITE_OK; + int aeOpt[] = { SQLITEASYNC_HALT, SQLITEASYNC_DELAY, SQLITEASYNC_LOCKFILES }; + const char *azOpt[] = { "halt", "delay", "lockfiles", 0 }; + const char *az[] = { "never", "now", "idle", 0 }; + int iVal; + int eOpt; -#endif /* SQLITE_OS_UNIX and SQLITE_THREADSAFE */ + if( objc!=2 && objc!=3 ){ + Tcl_WrongNumArgs(interp, 1, objv, "OPTION ?VALUE?"); + return TCL_ERROR; + } + if( Tcl_GetIndexFromObj(interp, objv[1], azOpt, "option", 0, &eOpt) ){ + return TCL_ERROR; + } + eOpt = aeOpt[eOpt]; + + if( objc==3 ){ + switch( eOpt ){ + case SQLITEASYNC_HALT: { + assert( SQLITEASYNC_HALT_NEVER==0 ); + assert( SQLITEASYNC_HALT_NOW==1 ); + assert( SQLITEASYNC_HALT_IDLE==2 ); + if( Tcl_GetIndexFromObj(interp, objv[2], az, "value", 0, &iVal) ){ + return TCL_ERROR; + } + break; + } + case SQLITEASYNC_DELAY: + if( Tcl_GetIntFromObj(interp, objv[2], &iVal) ){ + return TCL_ERROR; + } + break; + + case SQLITEASYNC_LOCKFILES: + if( Tcl_GetBooleanFromObj(interp, objv[2], &iVal) ){ + return TCL_ERROR; + } + break; + } + + rc = sqlite3async_control(eOpt, iVal); + } + + if( rc==SQLITE_OK ){ + rc = sqlite3async_control( + eOpt==SQLITEASYNC_HALT ? SQLITEASYNC_GET_HALT : + eOpt==SQLITEASYNC_DELAY ? SQLITEASYNC_GET_DELAY : + SQLITEASYNC_GET_LOCKFILES, &iVal); + } + + if( rc!=SQLITE_OK ){ + Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3TestErrorName(rc), -1)); + return TCL_ERROR; + } + + if( eOpt==SQLITEASYNC_HALT ){ + Tcl_SetObjResult(interp, Tcl_NewStringObj(az[iVal], -1)); + }else{ + Tcl_SetObjResult(interp, Tcl_NewIntObj(iVal)); + } + + return TCL_OK; +} + +#endif /* SQLITE_ENABLE_ASYNCIO */ /* ** This routine registers the custom TCL commands defined in this @@ -1838,14 +230,13 @@ static int testAsyncWait( ** of this module. */ int Sqlitetestasync_Init(Tcl_Interp *interp){ -#if SQLITE_OS_UNIX && SQLITE_THREADSAFE - Tcl_CreateObjCommand(interp,"sqlite3async_enable",testAsyncEnable,0,0); - Tcl_CreateObjCommand(interp,"sqlite3async_halt",testAsyncHalt,0,0); - Tcl_CreateObjCommand(interp,"sqlite3async_delay",testAsyncDelay,0,0); +#if SQLITE_ENABLE_ASYNCIO Tcl_CreateObjCommand(interp,"sqlite3async_start",testAsyncStart,0,0); Tcl_CreateObjCommand(interp,"sqlite3async_wait",testAsyncWait,0,0); - Tcl_LinkVar(interp, "sqlite3async_trace", - (char*)&sqlite3async_trace, TCL_LINK_INT); -#endif /* SQLITE_OS_UNIX and SQLITE_THREADSAFE */ + + Tcl_CreateObjCommand(interp,"sqlite3async_control",testAsyncControl,0,0); + Tcl_CreateObjCommand(interp,"sqlite3async_initialize",testAsyncInit,0,0); + Tcl_CreateObjCommand(interp,"sqlite3async_shutdown",testAsyncShutdown,0,0); +#endif /* SQLITE_ENABLE_ASYNCIO */ return TCL_OK; } diff --git a/src/tokenize.c b/src/tokenize.c index 4677811..a933de1 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.155 2009/03/31 03:41:57 shane Exp $ +** $Id: tokenize.c,v 1.156 2009/05/01 21:13:37 drh Exp $ */ #include "sqliteInt.h" #include @@ -413,10 +413,12 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ assert( pParse->apVarExpr==0 ); enableLookaside = db->lookaside.bEnabled; if( db->lookaside.pStart ) db->lookaside.bEnabled = 1; + pParse->sLastToken.quoted = 1; while( !db->mallocFailed && zSql[i]!=0 ){ assert( i>=0 ); pParse->sLastToken.z = (u8*)&zSql[i]; assert( pParse->sLastToken.dyn==0 ); + assert( pParse->sLastToken.quoted ); pParse->sLastToken.n = sqlite3GetToken((unsigned char*)&zSql[i],&tokenType); i += pParse->sLastToken.n; if( i>mxSqlLen ){ diff --git a/src/trigger.c b/src/trigger.c index 34b3f09..70d2fac 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -10,7 +10,7 @@ ************************************************************************* ** ** -** $Id: trigger.c,v 1.135 2009/02/28 10:47:42 danielk1977 Exp $ +** $Id: trigger.c,v 1.138 2009/05/06 18:42:21 drh Exp $ */ #include "sqliteInt.h" @@ -285,7 +285,7 @@ void sqlite3FinishTrigger( db->mallocFailed = 1; }else if( pLink->pSchema==pLink->pTabSchema ){ Table *pTab; - int n = sqlite3Strlen30(pLink->table) + 1; + int n = sqlite3Strlen30(pLink->table); pTab = sqlite3HashFind(&pLink->pTabSchema->tblHash, pLink->table, n); assert( pTab!=0 ); pLink->pNext = pTab->pTrigger; @@ -512,7 +512,7 @@ drop_trigger_cleanup: ** is set on. */ static Table *tableOfTrigger(Trigger *pTrigger){ - int n = sqlite3Strlen30(pTrigger->table) + 1; + int n = sqlite3Strlen30(pTrigger->table); return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n); } @@ -663,6 +663,7 @@ static SrcList *targetSrcList( assert( iDbdb->nDb ); sDb.z = (u8*)pParse->db->aDb[iDb].zName; sDb.n = sqlite3Strlen30((char*)sDb.z); + sDb.quoted = 0; pSrc = sqlite3SrcListAppend(pParse->db, 0, &sDb, &pStep->target); } else { pSrc = sqlite3SrcListAppend(pParse->db, 0, &pStep->target, 0); @@ -689,7 +690,7 @@ static int codeTriggerProgram( sqlite3VdbeAddOp2(v, OP_ContextPush, 0, 0); VdbeComment((v, "begin trigger %s", pStepList->pTrig->name)); while( pTriggerStep ){ - sqlite3ExprClearColumnCache(pParse, -1); + sqlite3ExprCacheClear(pParse); orconf = (orconfin == OE_Default)?pTriggerStep->orconf:orconfin; pParse->trigStack->orconf = orconf; switch( pTriggerStep->op ){ diff --git a/src/update.c b/src/update.c index 8183183..daab3ad 100644 --- a/src/update.c +++ b/src/update.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** -** $Id: update.c,v 1.196 2009/02/28 10:47:42 danielk1977 Exp $ +** $Id: update.c,v 1.200 2009/05/05 15:46:10 drh Exp $ */ #include "sqliteInt.h" @@ -55,7 +55,8 @@ static void updateVirtualTable( ** sqlite3_value objects. */ void sqlite3ColumnDefault(Vdbe *v, Table *pTab, int i){ - if( pTab && !pTab->pSelect ){ + assert( pTab!=0 ); + if( !pTab->pSelect ){ sqlite3_value *pValue; u8 enc = ENC(sqlite3VdbeDb(v)); Column *pCol = &pTab->aCol[i]; @@ -345,14 +346,13 @@ void sqlite3Update( /* Begin the database scan */ sqlite3VdbeAddOp2(v, OP_Null, 0, regOldRowid); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, - WHERE_ONEPASS_DESIRED, 0); + pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere,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); + sqlite3VdbeAddOp2(v, OP_Rowid, iCur, regOldRowid); if( !okOnePass ){ regRowSet = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, regOldRowid); @@ -369,7 +369,7 @@ void sqlite3Update( sqlite3VdbeAddOp2(v, OP_Integer, 0, regRowCount); } - if( !isView && !IsVirtual(pTab) ){ + if( !isView ){ /* ** Open every index that needs updating. Note that if any ** index could potentially invoke a REPLACE conflict resolution @@ -448,7 +448,7 @@ void sqlite3Update( continue; } j = aXRef[i]; - if( new_col_mask&((u32)1< +#ifdef SQLITE_HAVE_ISNAN +# include +#endif /* ** Routine needed to support the testcase() macro. @@ -52,9 +55,20 @@ int sqlite3Assert(void){ /* ** Return true if the floating point value is Not a Number (NaN). +** +** Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN. +** Otherwise, we have our own implementation that works on most systems. */ int sqlite3IsNaN(double x){ - /* This NaN test sometimes fails if compiled on GCC with -ffast-math. + int rc; /* The value return */ +#if !defined(SQLITE_HAVE_ISNAN) + /* + ** Systems that support the isnan() library function should probably + ** make use of it by compiling with -DSQLITE_HAVE_ISNAN. But we have + ** found that many systems do not have a working isnan() function so + ** this implementation is provided as an alternative. + ** + ** This NaN test sometimes fails if compiled on GCC with -ffast-math. ** On the other hand, the use of -ffast-math comes with the following ** warning: ** @@ -76,12 +90,21 @@ int sqlite3IsNaN(double x){ #endif volatile double y = x; volatile double z = y; - return y!=z; + rc = (y!=z); +#else /* if defined(SQLITE_HAVE_ISNAN) */ + rc = isnan(x); +#endif /* SQLITE_HAVE_ISNAN */ + testcase( rc ); + return rc; } /* ** Compute a string length that is limited to what can be stored in ** lower 30 bits of a 32-bit signed integer. +** +** The value returned will never be negative. Nor will it ever be greater +** than the actual length of the string. For very long strings (greater +** than 1GiB) the value returned might be less than the true string length. */ int sqlite3Strlen30(const char *z){ const char *z2 = z; @@ -89,24 +112,6 @@ int sqlite3Strlen30(const char *z){ 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; - while( *z2 ){ z2++; } - x = (int)(z2 - z); - len = 0x7fffffff & x; - if( len!=x || len > db->aLimit[SQLITE_LIMIT_LENGTH] ){ - return db->aLimit[SQLITE_LIMIT_LENGTH]; - }else{ - return len; - } -} - /* ** Set the most recent error code and error string for the sqlite ** handle "db". The error code is set to "err_code". @@ -165,6 +170,7 @@ void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){ va_list ap; sqlite3 *db = pParse->db; pParse->nErr++; + testcase( pParse->zErrMsg!=0 ); sqlite3DbFree(db, pParse->zErrMsg); va_start(ap, zFormat); pParse->zErrMsg = sqlite3VMPrintf(db, zFormat, ap); @@ -189,35 +195,43 @@ void sqlite3ErrorClear(Parse *pParse){ ** input does not begin with a quote character, then this routine ** is a no-op. ** +** The input string must be zero-terminated. A new zero-terminator +** is added to the dequoted string. +** +** The return value is -1 if no dequoting occurs or the length of the +** dequoted string, exclusive of the zero terminator, if dequoting does +** occur. +** ** 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){ +int sqlite3Dequote(char *z){ char quote; int i, j; - if( z==0 ) return; + if( z==0 ) return -1; quote = z[0]; switch( quote ){ case '\'': break; case '"': break; case '`': break; /* For MySQL compatibility */ case '[': quote = ']'; break; /* For MS SqlServer compatibility */ - default: return; + default: return -1; } - for(i=1, j=0; z[i]; i++){ + for(i=1, j=0; ALWAYS(z[i]); i++){ if( z[i]==quote ){ if( z[i+1]==quote ){ z[j++] = quote; i++; }else{ - z[j++] = 0; break; } }else{ z[j++] = z[i]; } } + z[j] = 0; + return j; } /* Convenient short-hand */ @@ -243,10 +257,15 @@ int sqlite3StrNICmp(const char *zLeft, const char *zRight, int N){ } /* -** Return TRUE if z is a pure numeric string. Return FALSE if the -** string contains any character which is not part of a number. If -** the string is numeric and contains the '.' character, set *realnum -** to TRUE (otherwise FALSE). +** Return TRUE if z is a pure numeric string. Return FALSE and leave +** *realnum unchanged if the string contains any character which is not +** part of a number. +** +** If the string is pure numeric, set *realnum to TRUE if the string +** contains the '.' character or an "E+000" style exponentiation suffix. +** Otherwise set *realnum to FALSE. Note that just becaue *realnum is +** false does not mean that the number can be successfully converted into +** an integer - it might be too big. ** ** An empty string is considered non-numeric. */ @@ -258,20 +277,20 @@ int sqlite3IsNumber(const char *z, int *realnum, u8 enc){ return 0; } z += incr; - if( realnum ) *realnum = 0; + *realnum = 0; while( sqlite3Isdigit(*z) ){ z += incr; } if( *z=='.' ){ z += incr; if( !sqlite3Isdigit(*z) ) return 0; while( sqlite3Isdigit(*z) ){ z += incr; } - if( realnum ) *realnum = 1; + *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( realnum ) *realnum = 1; + *realnum = 1; } return *z==0; } @@ -430,25 +449,25 @@ int sqlite3Atoi64(const char *zNum, i64 *pNum){ } /* -** The string zNum represents an integer. There might be some other +** The string zNum represents an unsigned integer. There might be some other ** information following the integer too, but that part is ignored. ** If the integer that the prefix of zNum represents will fit in a ** 64-bit signed integer, return TRUE. Otherwise return FALSE. ** -** This routine returns FALSE for the string -9223372036854775808 even that -** that number will, in theory fit in a 64-bit integer. Positive -** 9223373036854775808 will not fit in 64 bits. So it seems safer to return -** false. +** If the negFlag parameter is true, that means that zNum really represents +** a negative number. (The leading "-" is omitted from zNum.) This +** parameter is needed to determine a boundary case. A string +** of "9223373036854775808" returns false if negFlag is false or true +** if negFlag is true. +** +** Leading zeros are ignored. */ int sqlite3FitsIn64Bits(const char *zNum, int negFlag){ int i, c; int neg = 0; - if( *zNum=='-' ){ - neg = 1; - zNum++; - }else if( *zNum=='+' ){ - zNum++; - } + + assert( zNum[0]>='0' && zNum[0]<='9' ); /* zNum is an unsigned number */ + if( negFlag ) neg = 1-neg; while( *zNum=='0' ){ zNum++; /* Skip leading zeros. Ticket #2454 */ @@ -753,33 +772,40 @@ u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ u32 a,b; + /* The 1-byte case. Overwhelmingly the most common. Handled inline + ** by the getVarin32() macro */ a = *p; /* a: p0 (unmasked) */ #ifndef getVarint32 if (!(a&0x80)) { + /* Values between 0 and 127 */ *v = a; return 1; } #endif + /* The 2-byte case */ p++; b = *p; /* b: p1 (unmasked) */ if (!(b&0x80)) { + /* Values between 128 and 16383 */ a &= 0x7f; a = a<<7; *v = a | b; return 2; } + /* The 3-byte case */ p++; a = a<<14; a |= *p; /* a: p0<<14 | p2 (unmasked) */ if (!(a&0x80)) { + /* Values between 16384 and 2097151 */ a &= (0x7f<<14)|(0x7f); b &= 0x7f; b = b<<7; @@ -787,12 +813,39 @@ u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ return 3; } + /* A 32-bit varint is used to store size information in btrees. + ** Objects are rarely larger than 2MiB limit of a 3-byte varint. + ** A 3-byte varint is sufficient, for example, to record the size + ** of a 1048569-byte BLOB or string. + ** + ** We only unroll the first 1-, 2-, and 3- byte cases. The very + ** rare larger cases can be handled by the slower 64-bit varint + ** routine. + */ +#if 1 + { + u64 v64; + u8 n; + + p -= 2; + n = sqlite3GetVarint(p, &v64); + assert( n>3 && n<=9 ); + *v = (u32)v64; + return n; + } + +#else + /* For following code (kept for historical record only) shows an + ** unrolling for the 3- and 4-byte varint cases. This code is + ** slightly faster, but it is also larger and much harder to test. + */ p++; b = b<<14; b |= *p; /* b: p1<<14 | p3 (unmasked) */ if (!(b&0x80)) { + /* Values between 2097152 and 268435455 */ b &= (0x7f<<14)|(0x7f); a &= (0x7f<<14)|(0x7f); a = a<<7; @@ -806,6 +859,7 @@ u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ /* a: p0<<28 | p2<<14 | p4 (unmasked) */ if (!(a&0x80)) { + /* Walues between 268435456 and 34359738367 */ a &= (0x1f<<28)|(0x7f<<14)|(0x7f); b &= (0x1f<<28)|(0x7f<<14)|(0x7f); b = b<<7; @@ -827,6 +881,7 @@ u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ *v = (u32)v64; return n; } +#endif } /* @@ -838,7 +893,7 @@ int sqlite3VarintLen(u64 v){ do{ i++; v >>= 7; - }while( v!=0 && i<9 ); + }while( v!=0 && ALWAYS(i<9) ); return i; } @@ -976,13 +1031,18 @@ int sqlite3SafetyCheckOk(sqlite3 *db){ u32 magic; if( db==0 ) return 0; magic = db->magic; - if( magic!=SQLITE_MAGIC_OPEN && - magic!=SQLITE_MAGIC_BUSY ) return 0; - return 1; + if( magic!=SQLITE_MAGIC_OPEN +#ifdef SQLITE_DEBUG + && magic!=SQLITE_MAGIC_BUSY +#endif + ){ + return 0; + }else{ + return 1; + } } int sqlite3SafetyCheckSickOrOk(sqlite3 *db){ u32 magic; - if( db==0 ) return 0; magic = db->magic; if( magic!=SQLITE_MAGIC_SICK && magic!=SQLITE_MAGIC_OPEN && diff --git a/src/vacuum.c b/src/vacuum.c index acea861..d443fc7 100644 --- a/src/vacuum.c +++ b/src/vacuum.c @@ -14,7 +14,7 @@ ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** -** $Id: vacuum.c,v 1.87 2009/04/02 20:16:59 drh Exp $ +** $Id: vacuum.c,v 1.88 2009/05/05 17:37:23 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -25,13 +25,15 @@ */ static int execSql(sqlite3 *db, const char *zSql){ sqlite3_stmt *pStmt; + VVA_ONLY( int rc; ) if( !zSql ){ return SQLITE_NOMEM; } if( SQLITE_OK!=sqlite3_prepare(db, zSql, -1, &pStmt, 0) ){ return sqlite3_errcode(db); } - while( SQLITE_ROW==sqlite3_step(pStmt) ){} + VVA_ONLY( rc = ) sqlite3_step(pStmt); + assert( rc!=SQLITE_ROW ); return sqlite3_finalize(pStmt); } @@ -142,7 +144,7 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ if( sqlite3BtreeSetPageSize(pTemp, sqlite3BtreeGetPageSize(pMain), nRes, 0) || (!isMemDb && sqlite3BtreeSetPageSize(pTemp, db->nextPagesize, nRes, 0)) - || db->mallocFailed + || NEVER(db->mallocFailed) ){ rc = SQLITE_NOMEM; goto end_of_vacuum; @@ -230,7 +232,7 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ ** opened for writing. This way, the SQL transaction used to create the ** temporary database never needs to be committed. */ - if( rc==SQLITE_OK ){ + { u32 meta; int i; @@ -252,10 +254,12 @@ int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){ /* Copy Btree meta values */ for(i=0; iflags */ diff --git a/src/vdbe.c b/src/vdbe.c index eee932a..56667f5 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.832 2009/04/10 12:55:17 danielk1977 Exp $ +** $Id: vdbe.c,v 1.842 2009/05/06 18:57:10 shane Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -428,6 +428,8 @@ static void memTracePrint(FILE *out, Mem *p){ fprintf(out, " i:%lld", p->u.i); }else if( p->flags & MEM_Real ){ fprintf(out, " r:%g", p->r); + }else if( p->flags & MEM_RowSet ){ + fprintf(out, " (rowset)"); }else{ char zBuf[200]; sqlite3VdbeMemPrettyPrint(p, zBuf); @@ -2462,7 +2464,7 @@ case OP_Savepoint: { db->isTransactionSavepoint = 1; }else{ db->nSavepoint++; - } + } /* Link the new savepoint into the database handle's list. */ pNew->pNext = db->pSavepoint; @@ -3336,103 +3338,82 @@ case OP_Found: { /* jump, in3 */ /* Opcode: IsUnique P1 P2 P3 P4 * ** -** The P3 register contains an integer record number. Call this -** record number R. The P4 register contains an index key created -** using MakeRecord. Call it K. -** -** P1 is an index. So it has no data and its key consists of a -** record generated by OP_MakeRecord where the last field is the +** Cursor P1 is open on an index. So it has no data and its key consists +** of a record generated by OP_MakeRecord where the last field is the ** rowid of the entry that the index refers to. -** -** This instruction asks if there is an entry in P1 where the -** fields matches K but the rowid is different from R. -** If there is no such entry, then there is an immediate -** jump to P2. If any entry does exist where the index string -** matches K but the record number is not R, then the record -** number for that entry is written into P3 and control -** falls through to the next instruction. +** +** The P3 register contains an integer record number. Call this record +** number R. Register P4 is the first in a set of N contiguous registers +** that make up an unpacked index key that can be used with cursor P1. +** The value of N can be inferred from the cursor. N includes the rowid +** value appended to the end of the index record. This rowid value may +** or may not be the same as R. +** +** If any of the N registers beginning with register P4 contains a NULL +** value, jump immediately to P2. +** +** Otherwise, this instruction checks if cursor P1 contains an entry +** where the first (N-1) fields match but the rowid value at the end +** of the index entry is not R. If there is no such entry, control jumps +** to instruction P2. Otherwise, the rowid of the conflicting index +** entry is copied to register P3 and control falls through to the next +** instruction. ** ** See also: NotFound, NotExists, Found */ case OP_IsUnique: { /* jump, in3 */ - int i = pOp->p1; + u16 ii; VdbeCursor *pCx; BtCursor *pCrsr; - Mem *pK; - i64 R; + u16 nField; + Mem *aMem = &p->aMem[pOp->p4.i]; - /* Pop the value R off the top of the stack - */ + /* Assert that the values of parameters P1 and P4 are in range. */ assert( pOp->p4type==P4_INT32 ); assert( pOp->p4.i>0 && pOp->p4.i<=p->nMem ); - pK = &p->aMem[pOp->p4.i]; - sqlite3VdbeMemIntegerify(pIn3); - R = pIn3->u.i; - assert( i>=0 && inCursor ); - pCx = p->apCsr[i]; - assert( pCx!=0 ); + assert( pOp->p1>=0 && pOp->p1nCursor ); + + /* Find the index cursor. */ + pCx = p->apCsr[pOp->p1]; + assert( pCx->deferredMoveto==0 ); + pCx->seekResult = 0; + pCx->cacheStatus = CACHE_STALE; pCrsr = pCx->pCursor; + + /* If any of the values are NULL, take the jump. */ + nField = pCx->pKeyInfo->nField; + for(ii=0; iip2 - 1; + pCrsr = 0; + break; + } + } + assert( (aMem[nField].flags & MEM_Null)==0 ); + if( pCrsr!=0 ){ - int res; - i64 v; /* The record number that matches K */ - UnpackedRecord *pIdxKey; /* Unpacked version of P4 */ + UnpackedRecord r; /* B-Tree index search key */ + i64 R; /* Rowid stored in register P3 */ - /* Make sure K is a string and make zKey point to K - */ - assert( pK->flags & MEM_Blob ); - pIdxKey = sqlite3VdbeRecordUnpack(pCx->pKeyInfo, pK->n, pK->z, - aTempRec, sizeof(aTempRec)); - if( pIdxKey==0 ){ - goto no_mem; - } - pIdxKey->flags |= UNPACKED_IGNORE_ROWID; + /* Populate the index search key. */ + r.pKeyInfo = pCx->pKeyInfo; + r.nField = nField + 1; + r.flags = UNPACKED_PREFIX_SEARCH; + r.aMem = aMem; - /* Search for an entry in P1 where all but the last rowid match K - ** If there is no such entry, jump immediately to P2. - */ - assert( pCx->deferredMoveto==0 ); - pCx->cacheStatus = CACHE_STALE; - rc = sqlite3BtreeMovetoUnpacked(pCrsr, pIdxKey, 0, 0, &res); - if( rc!=SQLITE_OK ){ - sqlite3VdbeDeleteUnpackedRecord(pIdxKey); - goto abort_due_to_error; - } - if( res<0 ){ - rc = sqlite3BtreeNext(pCrsr, &res); - if( res ){ - pc = pOp->p2 - 1; - sqlite3VdbeDeleteUnpackedRecord(pIdxKey); - break; - } - } - rc = sqlite3VdbeIdxKeyCompare(pCx, pIdxKey, &res); - sqlite3VdbeDeleteUnpackedRecord(pIdxKey); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - if( res>0 ){ + /* Extract the value of R from register P3. */ + sqlite3VdbeMemIntegerify(pIn3); + R = pIn3->u.i; + + /* Search the B-Tree index. If no conflicting record is found, jump + ** to P2. Otherwise, copy the rowid of the conflicting record to + ** register P3 and fall through to the next instruction. */ + rc = sqlite3BtreeMovetoUnpacked(pCrsr, &r, 0, 0, &pCx->seekResult); + if( (r.flags & UNPACKED_PREFIX_SEARCH) || r.rowid==R ){ pc = pOp->p2 - 1; - break; + }else{ + pIn3->u.i = r.rowid; } - - /* At this point, pCrsr is pointing to an entry in P1 where all but - ** the final entry (the rowid) matches K. Check to see if the - ** final rowid column is different from R. If it equals R then jump - ** immediately to P2. - */ - rc = sqlite3VdbeIdxRowid(pCrsr, &v); - if( rc!=SQLITE_OK ){ - goto abort_due_to_error; - } - if( v==R ){ - pc = pOp->p2 - 1; - break; - } - - /* The final varint of the key is different from R. Store it back - ** into register R3. (The record number of an entry that violates - ** a UNIQUE constraint.) - */ - pIn3->u.i = v; - assert( pIn3->flags&MEM_Int ); } break; } @@ -3463,15 +3444,17 @@ case OP_NotExists: { /* jump, in3 */ assert( pIn3->flags & MEM_Int ); assert( p->apCsr[i]->isTable ); iKey = intToKey(pIn3->u.i); - rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0,&res); + rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0, &res); pC->lastRowid = pIn3->u.i; pC->rowidIsValid = res==0 ?1:0; pC->nullRow = 0; pC->cacheStatus = CACHE_STALE; + pC->deferredMoveto = 0; if( res!=0 ){ pc = pOp->p2 - 1; assert( pC->rowidIsValid==0 ); } + pC->seekResult = res; }else if( !pC->pseudoTable ){ /* This happens when an attempt to open a read cursor on the ** sqlite_master table returns SQLITE_EMPTY. @@ -3479,6 +3462,7 @@ case OP_NotExists: { /* jump, in3 */ assert( pC->isTable ); pc = pOp->p2 - 1; assert( pC->rowidIsValid==0 ); + pC->seekResult = 0; } break; } @@ -3721,6 +3705,7 @@ case OP_Insert: { pC->nullRow = 0; }else{ int nZero; + int seekResult = ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0); if( pData->flags & MEM_Zero ){ nZero = pData->u.nZero; }else{ @@ -3729,7 +3714,8 @@ case OP_Insert: { sqlite3BtreeSetCachedRowid(pC->pCursor, 0); rc = sqlite3BtreeInsert(pC->pCursor, 0, iKey, pData->z, pData->n, nZero, - pOp->p5 & OPFLAG_APPEND); + pOp->p5 & OPFLAG_APPEND, seekResult + ); } pC->rowidIsValid = 0; @@ -3893,6 +3879,10 @@ case OP_RowData: { ** ** Store in register P2 an integer which is the key of the table entry that ** P1 is currently point to. +** +** P1 can be either an ordinary table or a virtual table. There used to +** be a separate OP_VRowid opcode for use with virtual tables, but this +** one opcode now works for both table types. */ case OP_Rowid: { /* out2-prerelease */ int i = pOp->p1; @@ -3902,19 +3892,37 @@ case OP_Rowid: { /* out2-prerelease */ assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); - rc = sqlite3VdbeCursorMoveto(pC); - if( rc ) goto abort_due_to_error; - if( pC->rowidIsValid ){ - v = pC->lastRowid; + if( pC->nullRow ){ + /* Do nothing so that reg[P2] remains NULL */ + break; + }else if( pC->deferredMoveto ){ + v = pC->movetoTarget; }else if( pC->pseudoTable ){ v = keyToInt(pC->iKey); - }else if( pC->nullRow ){ - /* Leave the rowid set to a NULL */ - break; +#ifndef SQLITE_OMIT_VIRTUALTABLE + }else if( pC->pVtabCursor ){ + sqlite3_vtab *pVtab; + const sqlite3_module *pModule; + pVtab = pC->pVtabCursor->pVtab; + pModule = pVtab->pModule; + assert( pModule->xRowid ); + if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; + rc = pModule->xRowid(pC->pVtabCursor, &v); + sqlite3DbFree(db, p->zErrMsg); + p->zErrMsg = pVtab->zErrMsg; + pVtab->zErrMsg = 0; + if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; +#endif /* SQLITE_OMIT_VIRTUALTABLE */ }else{ - assert( pC->pCursor!=0 ); - sqlite3BtreeKeySize(pC->pCursor, &v); - v = keyToInt(v); + rc = sqlite3VdbeCursorMoveto(pC); + if( rc ) goto abort_due_to_error; + if( pC->rowidIsValid ){ + v = pC->lastRowid; + }else{ + assert( pC->pCursor!=0 ); + sqlite3BtreeKeySize(pC->pCursor, &v); + v = keyToInt(v); + } } pOut->u.i = v; MemSetTypeFlag(pOut, MEM_Int); @@ -4078,7 +4086,7 @@ case OP_Next: { /* jump */ break; } -/* Opcode: IdxInsert P1 P2 P3 * * +/* Opcode: IdxInsert P1 P2 P3 * P5 ** ** Register P2 holds a SQL index key made using the ** MakeRecord instructions. This opcode writes that key @@ -4103,7 +4111,9 @@ case OP_IdxInsert: { /* in2 */ if( rc==SQLITE_OK ){ int nKey = pIn2->n; const char *zKey = pIn2->z; - rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0, 0, pOp->p3); + rc = sqlite3BtreeInsert(pCrsr, zKey, nKey, "", 0, 0, pOp->p3, + ((pOp->p5 & OPFLAG_USESEEKRESULT) ? pC->seekResult : 0) + ); assert( pC->deferredMoveto==0 ); pC->cacheStatus = CACHE_STALE; } @@ -4601,6 +4611,59 @@ case OP_RowSetRead: { /* jump, out3 */ break; } +/* Opcode: RowSetTest P1 P2 P3 P4 +** +** Register P3 is assumed to hold a 64-bit integer value. If register P1 +** contains a RowSet object and that RowSet object contains +** the value held in P3, jump to register P2. Otherwise, insert the +** integer in P3 into the RowSet and continue on to the +** next opcode. +** +** The RowSet object is optimized for the case where successive sets +** of integers, where each set contains no duplicates. Each set +** of values is identified by a unique P4 value. The first set +** must have P4==0, the final set P4=-1. P4 must be either -1 or +** non-negative. For non-negative values of P4 only the lower 4 +** bits are significant. +** +** This allows optimizations: (a) when P4==0 there is no need to test +** the rowset object for P3, as it is guaranteed not to contain it, +** (b) when P4==-1 there is no need to insert the value, as it will +** never be tested for, and (c) when a value that is part of set X is +** inserted, there is no need to search to see if the same value was +** previously inserted as part of set X (only if it was previously +** inserted as part of some other set). +*/ +case OP_RowSetTest: { /* jump, in1, in3 */ + int iSet = pOp->p4.i; + assert( pIn3->flags&MEM_Int ); + + /* If there is anything other than a rowset object in memory cell P1, + ** delete it now and initialize P1 with an empty rowset + */ + if( (pIn1->flags & MEM_RowSet)==0 ){ + sqlite3VdbeMemSetRowSet(pIn1); + if( (pIn1->flags & MEM_RowSet)==0 ) goto no_mem; + } + + assert( pOp->p4type==P4_INT32 ); + assert( iSet==-1 || iSet>=0 ); + if( iSet ){ + int exists; + exists = sqlite3RowSetTest(pIn1->u.pRowSet, + (u8)(iSet>=0 ? iSet & 0xf : 0xff), + pIn3->u.i); + if( exists ){ + pc = pOp->p2 - 1; + break; + } + } + if( iSet>=0 ){ + sqlite3RowSetInsert(pIn1->u.pRowSet, pIn3->u.i); + } + break; +} + #ifndef SQLITE_OMIT_TRIGGER /* Opcode: ContextPush * * * @@ -5034,37 +5097,6 @@ case OP_VFilter: { /* jump */ } #endif /* SQLITE_OMIT_VIRTUALTABLE */ -#ifndef SQLITE_OMIT_VIRTUALTABLE -/* Opcode: VRowid P1 P2 * * * -** -** Store into register P2 the rowid of -** the virtual-table that the P1 cursor is pointing to. -*/ -case OP_VRowid: { /* out2-prerelease */ - sqlite3_vtab *pVtab; - const sqlite3_module *pModule; - sqlite_int64 iRow; - VdbeCursor *pCur = p->apCsr[pOp->p1]; - - assert( pCur->pVtabCursor ); - if( pCur->nullRow ){ - break; - } - pVtab = pCur->pVtabCursor->pVtab; - pModule = pVtab->pModule; - assert( pModule->xRowid ); - if( sqlite3SafetyOff(db) ) goto abort_due_to_misuse; - rc = pModule->xRowid(pCur->pVtabCursor, &iRow); - sqlite3DbFree(db, p->zErrMsg); - p->zErrMsg = pVtab->zErrMsg; - pVtab->zErrMsg = 0; - if( sqlite3SafetyOn(db) ) goto abort_due_to_misuse; - MemSetTypeFlag(pOut, MEM_Int); - pOut->u.i = iRow; - break; -} -#endif /* SQLITE_OMIT_VIRTUALTABLE */ - #ifndef SQLITE_OMIT_VIRTUALTABLE /* Opcode: VColumn P1 P2 P3 * * ** diff --git a/src/vdbeInt.h b/src/vdbeInt.h index d9becb1..a86ed69 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -15,7 +15,7 @@ ** 6000 lines long) it was split up into several smaller files and ** this header information was factored out. ** -** $Id: vdbeInt.h,v 1.167 2009/04/10 12:55:17 danielk1977 Exp $ +** $Id: vdbeInt.h,v 1.170 2009/05/04 11:42:30 danielk1977 Exp $ */ #ifndef _VDBEINT_H_ #define _VDBEINT_H_ @@ -80,6 +80,10 @@ struct VdbeCursor { sqlite3_vtab_cursor *pVtabCursor; /* The cursor for a virtual table */ const sqlite3_module *pModule; /* Module for cursor pVtabCursor */ + /* Result of last sqlite3BtreeMoveto() done by an OP_NotExists or + ** OP_IsUnique opcode on this cursor. */ + int seekResult; + /* Cached information about the header for the data record that the ** cursor is currently pointing to. Only valid if cacheValid is true. ** aRow might point to (ephemeral) data for the current row, or it might diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 1ef51df..a4f363f 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -13,7 +13,7 @@ ** This file contains code use to implement APIs that are part of the ** VDBE. ** -** $Id: vdbeapi.c,v 1.161 2009/04/10 23:11:31 drh Exp $ +** $Id: vdbeapi.c,v 1.164 2009/04/27 18:46:06 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -400,6 +400,10 @@ void sqlite3_result_zeroblob(sqlite3_context *pCtx, int n){ } void sqlite3_result_error_code(sqlite3_context *pCtx, int errCode){ pCtx->isError = errCode; + if( pCtx->s.flags & MEM_Null ){ + sqlite3VdbeMemSetStr(&pCtx->s, sqlite3ErrStr(errCode), -1, + SQLITE_UTF8, SQLITE_STATIC); + } } /* Force an SQLITE_TOOBIG error. */ @@ -1152,15 +1156,32 @@ int sqlite3_bind_text16( #endif /* SQLITE_OMIT_UTF16 */ int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){ int rc; - Vdbe *p = (Vdbe *)pStmt; - rc = vdbeUnbind(p, i); - if( rc==SQLITE_OK ){ - rc = sqlite3VdbeMemCopy(&p->aVar[i-1], pValue); - if( rc==SQLITE_OK ){ - rc = sqlite3VdbeChangeEncoding(&p->aVar[i-1], ENC(p->db)); + switch( pValue->type ){ + case SQLITE_INTEGER: { + rc = sqlite3_bind_int64(pStmt, i, pValue->u.i); + break; + } + case SQLITE_FLOAT: { + rc = sqlite3_bind_double(pStmt, i, pValue->r); + break; + } + case SQLITE_BLOB: { + if( pValue->flags & MEM_Zero ){ + rc = sqlite3_bind_zeroblob(pStmt, i, pValue->u.nZero); + }else{ + rc = sqlite3_bind_blob(pStmt, i, pValue->z, pValue->n,SQLITE_TRANSIENT); + } + break; + } + case SQLITE_TEXT: { + rc = bindText(pStmt,i, pValue->z, pValue->n, SQLITE_TRANSIENT, + pValue->enc); + break; + } + default: { + rc = sqlite3_bind_null(pStmt, i); + break; } - sqlite3_mutex_leave(p->db->mutex); - rc = sqlite3ApiExit(p->db, rc); } return rc; } diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 8f67eef..8d696e5 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -14,7 +14,7 @@ ** 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.451 2009/04/10 15:42:36 shane Exp $ +** $Id: vdbeaux.c,v 1.457 2009/05/06 18:57:10 shane Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -730,9 +730,9 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){ */ void sqlite3VdbeUsesBtree(Vdbe *p, int i){ int mask; - assert( i>=0 && idb->nDb ); + assert( i>=0 && idb->nDb && ibtreeMask)*8 ); - mask = 1<btreeMask & mask)==0 ){ p->btreeMask |= mask; sqlite3BtreeMutexArrayInsert(&p->aMutex, p->db->aDb[i].pBt); @@ -1940,7 +1940,7 @@ void sqlite3VdbeDeleteAuxData(VdbeFunc *pVdbeFunc, int mask){ int i; for(i=0; inAux; i++){ struct AuxData *pAux = &pVdbeFunc->apAux[i]; - if( (i>31 || !(mask&(1<pAux ){ + if( (i>31 || !(mask&(((u32)1)<pAux ){ if( pAux->xDelete ){ pAux->xDelete(pAux->pAux); } @@ -2002,8 +2002,8 @@ int sqlite3VdbeCursorMoveto(VdbeCursor *p){ rc = sqlite3BtreeMovetoUnpacked(p->pCursor, 0, p->movetoTarget, 0, &res); if( rc ) return rc; p->lastRowid = keyToInt(p->movetoTarget); - p->rowidIsValid = res==0 ?1:0; - if( res<0 ){ + p->rowidIsValid = ALWAYS(res==0) ?1:0; + if( NEVER(res<0) ){ rc = sqlite3BtreeNext(p->pCursor, &res); if( rc ) return rc; } @@ -2466,6 +2466,7 @@ int sqlite3VdbeRecordCompare( mem1.enc = pKeyInfo->enc; mem1.db = pKeyInfo->db; mem1.flags = 0; + mem1.u.i = 0; /* not needed, here to silence compiler warning */ mem1.zMalloc = 0; idx1 = getVarint32(aKey1, szHdr1); @@ -2496,6 +2497,18 @@ int sqlite3VdbeRecordCompare( } if( mem1.zMalloc ) sqlite3VdbeMemRelease(&mem1); + /* If the PREFIX_SEARCH flag is set and all fields except the final + ** rowid field were equal, then clear the PREFIX_SEARCH flag and set + ** pPKey2->rowid to the value of the rowid field in (pKey1, nKey1). + ** This is used by the OP_IsUnique opcode. + */ + if( (pPKey2->flags & UNPACKED_PREFIX_SEARCH) && i==(pPKey2->nField-1) ){ + assert( idx1==szHdr1 && rc ); + assert( mem1.flags & MEM_Int ); + pPKey2->flags &= ~UNPACKED_PREFIX_SEARCH; + pPKey2->rowid = mem1.u.i; + } + if( rc==0 ){ /* rc==0 here means that one of the keys ran out of fields and ** all the fields up to that point were equal. If the UNPACKED_INCRKEY diff --git a/src/vdbemem.c b/src/vdbemem.c index e5a8755..e946067 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -15,7 +15,7 @@ ** only within the VDBE. Interface routines refer to a Mem using the ** name sqlite_value ** -** $Id: vdbemem.c,v 1.140 2009/04/05 12:22:09 drh Exp $ +** $Id: vdbemem.c,v 1.144 2009/05/05 12:54:50 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -270,16 +270,18 @@ int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){ */ void sqlite3VdbeMemReleaseExternal(Mem *p){ assert( p->db==0 || sqlite3_mutex_held(p->db->mutex) ); - 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); + if( p->flags&(MEM_Agg|MEM_Dyn|MEM_RowSet) ){ + 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); + } } } @@ -975,12 +977,14 @@ int sqlite3ValueFromExpr( zVal = sqlite3DbStrNDup(db, (char*)pExpr->token.z, pExpr->token.n); pVal = sqlite3ValueNew(db); if( !zVal || !pVal ) goto no_mem; - sqlite3Dequote(zVal); sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC); if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){ - sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc); + sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, SQLITE_UTF8); }else{ - sqlite3ValueApplyAffinity(pVal, affinity, enc); + sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8); + } + if( enc!=SQLITE_UTF8 ){ + sqlite3VdbeChangeEncoding(pVal, enc); } }else if( op==TK_UMINUS ) { if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) ){ diff --git a/src/vtab.c b/src/vtab.c index e2103bd..10d6860 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to help implement virtual tables. ** -** $Id: vtab.c,v 1.85 2009/04/11 16:27:20 drh Exp $ +** $Id: vtab.c,v 1.86 2009/04/28 13:01:09 drh Exp $ */ #ifndef SQLITE_OMIT_VIRTUALTABLE #include "sqliteInt.h" @@ -308,7 +308,7 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ Table *pOld; Schema *pSchema = pTab->pSchema; const char *zName = pTab->zName; - int nName = sqlite3Strlen30(zName) + 1; + int nName = sqlite3Strlen30(zName); pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab); if( pOld ){ db->mallocFailed = 1; diff --git a/src/where.c b/src/where.c index 877ca05..1d2450e 100644 --- a/src/where.c +++ b/src/where.c @@ -16,7 +16,7 @@ ** 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.382 2009/04/07 13:48:12 drh Exp $ +** $Id: where.c,v 1.396 2009/05/06 19:03:14 drh Exp $ */ #include "sqliteInt.h" @@ -43,10 +43,8 @@ typedef struct WhereCost WhereCost; /* ** 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 AND operators, +** usually, or sometimes subexpressions separated by OR. ** ** All WhereTerms are collected into a single WhereClause structure. ** The following identity holds: @@ -228,11 +226,12 @@ struct WhereCost { */ #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_EQ 0x00010000 /* x=EXPR or x IN (...) or x IS NULL */ #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_COLUMN_NULL 0x00080000 /* x IS NULL */ +#define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */ +#define WHERE_IN_ABLE 0x000f1000 /* 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 */ @@ -375,7 +374,7 @@ static void whereSplit(WhereClause *pWC, Expr *pExpr, int op){ } /* -** Initialize an expression mask set +** Initialize an expression mask set (a WhereMaskSet object) */ #define initMaskSet(P) memset(P, 0, sizeof(*P)) @@ -385,6 +384,7 @@ static void whereSplit(WhereClause *pWC, Expr *pExpr, int op){ */ static Bitmask getMask(WhereMaskSet *pMaskSet, int iCursor){ int i; + assert( pMaskSet->n<=sizeof(Bitmask)*8 ); for(i=0; in; i++){ if( pMaskSet->ix[i]==iCursor ){ return ((Bitmask)1)<type!=SQLITE_COLL_NOCASE || !*pnoCase) ){ return 0; } - sqlite3DequoteExpr(pRight); - z = (char *)pRight->token.z; + z = (const char*)pRight->token.z; cnt = 0; if( z ){ - while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ cnt++; } + n = pRight->token.n; + while( cnttoken, &pRight->token); pStr1->token.n = nPattern; - pStr1->flags = EP_Dequoted; } pStr2 = sqlite3ExprDup(db, pStr1, 0); if( !db->mallocFailed ){ @@ -1475,7 +1477,246 @@ static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){ #define TRACE_IDX_OUTPUTS(A) #endif +/* +** Required because bestIndex() is called by bestOrClauseIndex() +*/ +static void bestIndex( + Parse*, WhereClause*, struct SrcList_item*, Bitmask, ExprList*, WhereCost*); + +/* +** This routine attempts to find an scanning strategy that can be used +** to optimize an 'OR' expression that is part of a WHERE clause. +** +** The table associated with FROM clause term pSrc may be either a +** regular B-Tree table or a virtual table. +*/ +static void bestOrClauseIndex( + 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 */ +){ +#ifndef SQLITE_OMIT_OR_OPTIMIZATION + const int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */ + const Bitmask maskSrc = getMask(pWC->pMaskSet, iCur); /* Bitmask for pSrc */ + WhereTerm * const pWCEnd = &pWC->a[pWC->nTerm]; /* End of pWC->a[] */ + WhereTerm *pTerm; /* A single term of the WHERE clause */ + + /* Search the WHERE clause terms for a usable WO_OR term. */ + for(pTerm=pWC->a; pTermeOperator==WO_OR + && ((pTerm->prereqAll & ~maskSrc) & notReady)==0 + && (pTerm->u.pOrInfo->indexable & maskSrc)!=0 + ){ + WhereClause * const pOrWC = &pTerm->u.pOrInfo->wc; + WhereTerm * const pOrWCEnd = &pOrWC->a[pOrWC->nTerm]; + WhereTerm *pOrTerm; + int flags = WHERE_MULTI_OR; + double rTotal = 0; + double nRow = 0; + + for(pOrTerm=pOrWC->a; pOrTerma), (pTerm - pWC->a) + )); + if( pOrTerm->eOperator==WO_AND ){ + WhereClause *pAndWC = &pOrTerm->u.pAndInfo->wc; + bestIndex(pParse, pAndWC, pSrc, notReady, 0, &sTermCost); + }else if( pOrTerm->leftCursor==iCur ){ + WhereClause tempWC; + tempWC.pParse = pWC->pParse; + tempWC.pMaskSet = pWC->pMaskSet; + tempWC.op = TK_AND; + 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 there is an ORDER BY clause, increase the scan cost to account + ** for the cost of the sort. */ + if( pOrderBy!=0 ){ + rTotal += nRow*estLog(nRow); + WHERETRACE(("... sorting increases OR cost to %.9g\n", rTotal)); + } + + /* If the cost of scanning using this OR term for optimization is + ** less than the current cost stored in pCost, replace the contents + ** of pCost. */ + WHERETRACE(("... multi-index OR cost=%.9g nrow=%.9g\n", rTotal, nRow)); + if( rTotalrCost ){ + pCost->rCost = rTotal; + pCost->nRow = nRow; + pCost->plan.wsFlags = flags; + pCost->plan.u.pTerm = pTerm; + } + } + } +#endif /* SQLITE_OMIT_OR_OPTIMIZATION */ +} + #ifndef SQLITE_OMIT_VIRTUALTABLE +/* +** Allocate and populate an sqlite3_index_info structure. It is the +** responsibility of the caller to eventually release the structure +** by passing the pointer returned by this function to sqlite3_free(). +*/ +static sqlite3_index_info *allocateIndexInfo( + Parse *pParse, + WhereClause *pWC, + struct SrcList_item *pSrc, + ExprList *pOrderBy +){ + int i, j; + int nTerm; + struct sqlite3_index_constraint *pIdxCons; + struct sqlite3_index_orderby *pIdxOrderBy; + struct sqlite3_index_constraint_usage *pUsage; + WhereTerm *pTerm; + int nOrderBy; + sqlite3_index_info *pIdxInfo; + + WHERETRACE(("Recomputing index info for %s...\n", pSrc->pTab->zName)); + + /* Count the number of possible WHERE clause constraints referring + ** to this virtual table */ + for(i=nTerm=0, pTerm=pWC->a; inTerm; i++, pTerm++){ + 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; + nTerm++; + } + + /* If the ORDER BY clause contains only columns in the current + ** virtual table then allocate space for the aOrderBy part of + ** the sqlite3_index_info structure. + */ + nOrderBy = 0; + if( pOrderBy ){ + for(i=0; inExpr; i++){ + Expr *pExpr = pOrderBy->a[i].pExpr; + if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break; + } + if( i==pOrderBy->nExpr ){ + nOrderBy = pOrderBy->nExpr; + } + } + + /* Allocate the sqlite3_index_info structure + */ + 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 0; + } + + /* Initialize the structure. The sqlite3_index_info structure contains + ** many fields that are declared "const" to prevent xBestIndex from + ** changing them. We have to do some funky casting in order to + ** initialize those fields. + */ + pIdxCons = (struct sqlite3_index_constraint*)&pIdxInfo[1]; + pIdxOrderBy = (struct sqlite3_index_orderby*)&pIdxCons[nTerm]; + pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy]; + *(int*)&pIdxInfo->nConstraint = nTerm; + *(int*)&pIdxInfo->nOrderBy = nOrderBy; + *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint = pIdxCons; + *(struct sqlite3_index_orderby**)&pIdxInfo->aOrderBy = pIdxOrderBy; + *(struct sqlite3_index_constraint_usage**)&pIdxInfo->aConstraintUsage = + pUsage; + + for(i=j=0, pTerm=pWC->a; inTerm; i++, pTerm++){ + 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].iTermOffset = i; + pIdxCons[j].op = (u8)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 ); + assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE ); + assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT ); + assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE ); + assert( WO_MATCH==SQLITE_INDEX_CONSTRAINT_MATCH ); + assert( pTerm->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) ); + j++; + } + for(i=0; ia[i].pExpr; + pIdxOrderBy[i].iColumn = pExpr->iColumn; + pIdxOrderBy[i].desc = pOrderBy->a[i].sortOrder; + } + + return pIdxInfo; +} + +/* +** The table object reference passed as the second argument to this function +** must represent a virtual table. This function invokes the xBestIndex() +** method of the virtual table with the sqlite3_index_info pointer passed +** as the argument. +** +** If an error occurs, pParse is populated with an error message and a +** non-zero value is returned. Otherwise, 0 is returned and the output +** part of the sqlite3_index_info structure is left populated. +** +** Whether or not an error is returned, it is the responsibility of the +** caller to eventually free p->idxStr if p->needToFreeIdxStr indicates +** that this is required. +*/ +static int vtabBestIndex(Parse *pParse, Table *pTab, sqlite3_index_info *p){ + sqlite3_vtab *pVtab = pTab->pVtab; + int i; + int rc; + + (void)sqlite3SafetyOff(pParse->db); + WHERETRACE(("xBestIndex for %s\n", pTab->zName)); + TRACE_IDX_INPUTS(p); + rc = pVtab->pModule->xBestIndex(pVtab, p); + TRACE_IDX_OUTPUTS(p); + (void)sqlite3SafetyOn(pParse->db); + + if( rc!=SQLITE_OK ){ + if( rc==SQLITE_NOMEM ){ + pParse->db->mallocFailed = 1; + }else if( !pVtab->zErrMsg ){ + sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc)); + }else{ + sqlite3ErrorMsg(pParse, "%s", pVtab->zErrMsg); + } + } + sqlite3DbFree(pParse->db, pVtab->zErrMsg); + pVtab->zErrMsg = 0; + + for(i=0; inConstraint; i++){ + if( !p->aConstraint[i].usable && p->aConstraintUsage[i].argvIndex>0 ){ + sqlite3ErrorMsg(pParse, + "table %s: xBestIndex returned an invalid plan", pTab->zName); + } + } + + return pParse->nErr; +} + + /* ** Compute the best index for a virtual table. ** @@ -1492,114 +1733,39 @@ static void TRACE_IDX_OUTPUTS(sqlite3_index_info *p){ ** routine takes care of freeing the sqlite3_index_info structure after ** everybody has finished with it. */ -static double bestVirtualIndex( - 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 */ - int orderByUsable, /* True if we can potential sort */ - sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */ +static void bestVirtualIndex( + 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 */ + sqlite3_index_info **ppIdxInfo /* Index information passed to xBestIndex */ ){ Table *pTab = pSrc->pTab; - sqlite3_vtab *pVtab = pTab->pVtab; sqlite3_index_info *pIdxInfo; struct sqlite3_index_constraint *pIdxCons; - struct sqlite3_index_orderby *pIdxOrderBy; struct sqlite3_index_constraint_usage *pUsage; WhereTerm *pTerm; int i, j; int nOrderBy; - int rc; + + /* Make sure wsFlags is initialized to some sane value. Otherwise, if the + ** malloc in allocateIndexInfo() fails and this function returns leaving + ** wsFlags in an uninitialized state, the caller may behave unpredictably. + */ + memset(pCost, 0, sizeof(*pCost)); + pCost->plan.wsFlags = WHERE_VIRTUALTABLE; /* If the sqlite3_index_info structure has not been previously - ** allocated and initialized for this virtual table, then allocate - ** and initialize it now + ** allocated and initialized, then allocate and initialize it now. */ pIdxInfo = *ppIdxInfo; if( pIdxInfo==0 ){ - int nTerm; - WHERETRACE(("Recomputing index info for %s...\n", pTab->zName)); - - /* Count the number of possible WHERE clause constraints referring - ** to this virtual table */ - for(i=nTerm=0, pTerm=pWC->a; inTerm; i++, pTerm++){ - 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; - nTerm++; - } - - /* If the ORDER BY clause contains only columns in the current - ** virtual table then allocate space for the aOrderBy part of - ** the sqlite3_index_info structure. - */ - nOrderBy = 0; - if( pOrderBy ){ - for(i=0; inExpr; i++){ - Expr *pExpr = pOrderBy->a[i].pExpr; - if( pExpr->op!=TK_COLUMN || pExpr->iTable!=pSrc->iCursor ) break; - } - if( i==pOrderBy->nExpr ){ - nOrderBy = pOrderBy->nExpr; - } - } - - /* Allocate the sqlite3_index_info structure - */ - 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; - } - *ppIdxInfo = pIdxInfo; - - /* Initialize the structure. The sqlite3_index_info structure contains - ** many fields that are declared "const" to prevent xBestIndex from - ** changing them. We have to do some funky casting in order to - ** initialize those fields. - */ - pIdxCons = (struct sqlite3_index_constraint*)&pIdxInfo[1]; - pIdxOrderBy = (struct sqlite3_index_orderby*)&pIdxCons[nTerm]; - pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy]; - *(int*)&pIdxInfo->nConstraint = nTerm; - *(int*)&pIdxInfo->nOrderBy = nOrderBy; - *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint = pIdxCons; - *(struct sqlite3_index_orderby**)&pIdxInfo->aOrderBy = pIdxOrderBy; - *(struct sqlite3_index_constraint_usage**)&pIdxInfo->aConstraintUsage = - pUsage; - - for(i=j=0, pTerm=pWC->a; inTerm; i++, pTerm++){ - 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].iTermOffset = i; - pIdxCons[j].op = (u8)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 ); - assert( WO_LE==SQLITE_INDEX_CONSTRAINT_LE ); - assert( WO_GT==SQLITE_INDEX_CONSTRAINT_GT ); - assert( WO_GE==SQLITE_INDEX_CONSTRAINT_GE ); - assert( WO_MATCH==SQLITE_INDEX_CONSTRAINT_MATCH ); - assert( pTerm->eOperator & (WO_EQ|WO_LT|WO_LE|WO_GT|WO_GE|WO_MATCH) ); - j++; - } - for(i=0; ia[i].pExpr; - pIdxOrderBy[i].iColumn = pExpr->iColumn; - pIdxOrderBy[i].desc = pOrderBy->a[i].sortOrder; - } + *ppIdxInfo = pIdxInfo = allocateIndexInfo(pParse, pWC, pSrc, pOrderBy); + } + if( pIdxInfo==0 ){ + return; } /* At this point, the sqlite3_index_info structure that pIdxInfo points @@ -1614,14 +1780,7 @@ static double bestVirtualIndex( ** sqlite3ViewGetColumnNames() would have picked up the error. */ assert( pTab->azModuleArg && pTab->azModuleArg[0] ); - assert( pVtab ); -#if 0 - if( pTab->pVtab==0 ){ - sqlite3ErrorMsg(pParse, "undefined module %s for table %s", - pTab->azModuleArg[0], pTab->zName); - return 0.0; - } -#endif + assert( pTab->pVtab ); /* Set the aConstraint[].usable fields and initialize all ** output variables to zero. @@ -1661,40 +1820,37 @@ static double bestVirtualIndex( /* ((double)2) In case of SQLITE_OMIT_FLOATING_POINT... */ pIdxInfo->estimatedCost = SQLITE_BIG_DBL / ((double)2); nOrderBy = pIdxInfo->nOrderBy; - if( pIdxInfo->nOrderBy && !orderByUsable ){ - *(int*)&pIdxInfo->nOrderBy = 0; + if( !pOrderBy ){ + pIdxInfo->nOrderBy = 0; } - (void)sqlite3SafetyOff(pParse->db); - WHERETRACE(("xBestIndex for %s\n", pTab->zName)); - TRACE_IDX_INPUTS(pIdxInfo); - rc = pVtab->pModule->xBestIndex(pVtab, pIdxInfo); - TRACE_IDX_OUTPUTS(pIdxInfo); - (void)sqlite3SafetyOn(pParse->db); - - if( rc!=SQLITE_OK ){ - if( rc==SQLITE_NOMEM ){ - pParse->db->mallocFailed = 1; - }else if( !pVtab->zErrMsg ){ - sqlite3ErrorMsg(pParse, "%s", sqlite3ErrStr(rc)); - }else{ - sqlite3ErrorMsg(pParse, "%s", pVtab->zErrMsg); - } - } - sqlite3DbFree(pParse->db, pVtab->zErrMsg); - pVtab->zErrMsg = 0; - - 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; - } + if( vtabBestIndex(pParse, pTab, pIdxInfo) ){ + return; } - *(int*)&pIdxInfo->nOrderBy = nOrderBy; - return pIdxInfo->estimatedCost; + /* The cost is not allowed to be larger than SQLITE_BIG_DBL (the + ** inital value of lowestCost in this loop. If it is, then the + ** (costestimatedCost ){ + pCost->rCost = (SQLITE_BIG_DBL/((double)2)); + }else{ + pCost->rCost = pIdxInfo->estimatedCost; + } + pCost->plan.u.pVtabIdx = pIdxInfo; + if( pIdxInfo && pIdxInfo->orderByConsumed ){ + pCost->plan.wsFlags |= WHERE_ORDERBY; + } + pCost->plan.nEq = 0; + pIdxInfo->nOrderBy = nOrderBy; + + /* Try to find a more efficient access pattern by using multiple indexes + ** to optimize an OR expression within the WHERE clause. + */ + bestOrClauseIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); } #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -1726,7 +1882,7 @@ static double bestVirtualIndex( ** selected plan may still take advantage of the tables built-in rowid ** index. */ -static void bestIndex( +static void bestBtreeIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to search */ @@ -1744,7 +1900,6 @@ static void bestIndex( 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)); pProbe = pSrc->pTab->pIndex; @@ -1860,61 +2015,7 @@ static void bestIndex( } } -#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 */ + bestOrClauseIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); /* If the pSrc table is the right table of a LEFT JOIN then we may not ** use an index to satisfy IS NULL constraints on that table. This is @@ -1939,9 +2040,10 @@ static void bestIndex( 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. For a term - ** of the form x=EXPR we only have to do a single binary search. - ** But for x IN (...) we have to do a number of binary searched + ** by x=EXPR or x IS NULL constraints or x IN (...) constraints. + ** For a term of the form x=EXPR or x IS NULL we only have to do + ** a single binary search. But for x IN (...) we have to do a + ** number of binary searched ** equal to the number of entries on the RHS of the IN operator. ** The inMultipler variable with try to estimate the number of ** binary searches needed. @@ -1961,6 +2063,8 @@ static void bestIndex( }else if( pExpr->x.pList ){ inMultiplier *= pExpr->x.pList->nExpr + 1; } + }else if( pTerm->eOperator & WO_ISNULL ){ + wsFlags |= WHERE_COLUMN_NULL; } } nRow = pProbe->aiRowEst[i] * inMultiplier; @@ -1973,9 +2077,12 @@ static void bestIndex( } cost = nRow + inMultiplier*estLog(pProbe->aiRowEst[0]); nEq = i; - if( pProbe->onError!=OE_None && (wsFlags & WHERE_COLUMN_IN)==0 - && nEq==pProbe->nColumn ){ - wsFlags |= WHERE_UNIQUE; + if( pProbe->onError!=OE_None && nEq==pProbe->nColumn ){ + testcase( wsFlags & WHERE_COLUMN_IN ); + testcase( wsFlags & WHERE_COLUMN_NULL ); + if( (wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_NULL))==0 ){ + wsFlags |= WHERE_UNIQUE; + } } WHERETRACE(("...... nEq=%d inMult=%.9g nRow=%.9g cost=%.9g\n", nEq, inMultiplier, nRow, cost)); @@ -2006,8 +2113,9 @@ static void bestIndex( /* Add the additional cost of sorting if that is a factor. */ if( pOrderBy ){ - if( (wsFlags & WHERE_COLUMN_IN)==0 && - isSortingIndex(pParse,pWC->pMaskSet,pProbe,iCur,pOrderBy,nEq,&rev) ){ + if( (wsFlags & (WHERE_COLUMN_IN|WHERE_COLUMN_NULL))==0 + && isSortingIndex(pParse,pWC->pMaskSet,pProbe,iCur,pOrderBy,nEq,&rev) + ){ if( wsFlags==0 ){ wsFlags = WHERE_COLUMN_RANGE; } @@ -2068,6 +2176,31 @@ static void bestIndex( pCost->rCost, pCost->plan.wsFlags, pCost->plan.nEq)); } +/* +** Find the query plan for accessing table pSrc->pTab. Write the +** best query plan and its cost into the WhereCost object supplied +** as the last parameter. This function may calculate the cost of +** both real and virtual table scans. +*/ +static void 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 */ +){ + if( IsVirtual(pSrc->pTab) ){ + sqlite3_index_info *p = 0; + bestVirtualIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost, &p); + if( p->needToFreeIdxStr ){ + sqlite3_free(p->idxStr); + } + sqlite3DbFree(pParse->db, p); + }else{ + bestBtreeIndex(pParse, pWC, pSrc, notReady, pOrderBy, pCost); + } +} /* ** Disable a term in the WHERE clause. Except, do not disable the term @@ -2264,25 +2397,6 @@ static int codeAllEqualityTerms( 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. @@ -2290,7 +2404,7 @@ static int whereRowReadyForOutput(WhereClause *pWC){ 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 */ + u16 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */ Bitmask notReady /* Which tables are currently available */ ){ int j, k; /* Loop counters */ @@ -2306,9 +2420,8 @@ static Bitmask codeOneLoopStart( 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 */ - + int iRowidReg = 0; /* Rowid is stored in this register, if not zero */ + int iReleaseReg = 0; /* Temp register to free before returning */ pParse = pWInfo->pParse; v = pParse->pVdbe; @@ -2317,9 +2430,8 @@ static Bitmask codeOneLoopStart( 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; + omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0 + && (wctrlFlags & WHERE_FORCE_TABLE)==0; /* Create labels for the "break" and "continue" instructions ** for the current loop. Jump to addrBrk to break out of a loop. @@ -2358,20 +2470,16 @@ static Bitmask codeOneLoopStart( 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, @@ -2386,11 +2494,6 @@ static Bitmask codeOneLoopStart( 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 */ @@ -2401,22 +2504,17 @@ static Bitmask codeOneLoopStart( ** we reference multiple rows using a "rowid IN (...)" ** construct. */ - int r1; - int rtmp = sqlite3GetTempReg(pParse); + iReleaseReg = 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); + iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, iReleaseReg); 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); + sqlite3VdbeAddOp2(v, OP_MustBeInt, iRowidReg, addrNxt); + sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addrNxt, iRowidReg); + sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); VdbeComment((v, "pk")); pLevel->op = OP_Noop; }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){ @@ -2483,18 +2581,12 @@ static Bitmask codeOneLoopStart( 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); + if( testOp!=OP_Noop ){ + iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Rowid, iCur, iRowidReg); + sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); + sqlite3VdbeAddOp3(v, testOp, memEndValue, addrBrk, iRowidReg); + sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL); } }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){ /* Case 3: A scan using an index. @@ -2619,12 +2711,7 @@ static Bitmask codeOneLoopStart( /* 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 ){ @@ -2650,6 +2737,7 @@ static Bitmask codeOneLoopStart( */ nConstraint = nEq; if( pRangeEnd ){ + sqlite3ExprCacheRemove(pParse, regBase+nEq); sqlite3ExprCode(pParse, pRangeEnd->pExpr->pRight, regBase+nEq); sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt); codeApplyAffinity(pParse, regBase, nEq+1, pIdx); @@ -2681,20 +2769,17 @@ static Bitmask codeOneLoopStart( sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1); sqlite3VdbeAddOp2(v, OP_IsNull, r1, addrCont); } + sqlite3ReleaseTempReg(pParse, r1); /* 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 */ - } + if( !omitTable ){ + iRowidReg = iReleaseReg = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, iRowidReg); + sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg); + sqlite3VdbeAddOp2(v, OP_Seek, iCur, iRowidReg); /* Deferred seek */ } - sqlite3ReleaseTempReg(pParse, r1); /* Record the instruction used to terminate the loop. Disable ** WHERE clause terms made redundant by the index range scan. @@ -2717,66 +2802,106 @@ static Bitmask codeOneLoopStart( ** 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. + ** The top of the loop looks like this: ** - ** 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 + ** Null 1 # Zero the rowset in reg 1 ** - ** The bottom of the loop looks like this: + ** Then, for each indexed term, the following. The arguments to + ** RowSetTest are such that the rowid of the current row is inserted + ** into the RowSet. If it is already present, control skips the + ** Gosub opcode and jumps straight to the code generated by WhereEnd(). + ** + ** sqlite3WhereBegin() + ** RowSetTest # Insert rowid into rowset + ** Gosub 2 A + ** sqlite3WhereEnd() + ** + ** Following the above, code to terminate the loop. Label A, the target + ** of the Gosub above, jumps to the instruction right after the Goto. + ** + ** Null 1 # Zero the rowset in reg 1 + ** Goto B # The loop is finished. + ** + ** A: # Return data, whatever. + ** + ** Return 2 # Jump back to the Gosub + ** + ** B: ** - ** 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 */ + WhereTerm *pFinal; /* Final subterm within the OR-clause. */ SrcList oneTab; /* Shortened table list */ + + int regReturn = ++pParse->nMem; /* Register used with OP_Gosub */ + int regRowset; /* Register for RowSet object */ + int regRowid; /* Register holding rowid */ + int iLoopBody = sqlite3VdbeMakeLabel(v); /* Start of loop body */ + int iRetInit; /* Address of regReturn init */ + int ii; 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; + pFinal = &pOrWc->a[pOrWc->nTerm-1]; - if( codeRowSetEarly ){ - regOrRowset = regRowSet; - }else{ - regOrRowset = sqlite3GetTempReg(pParse); - sqlite3VdbeAddOp2(v, OP_Null, 0, regOrRowset); - } + /* Set up a SrcList containing just the table being scanned by this loop. */ 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); + + /* Initialize the rowset register to contain NULL. An SQL NULL is + ** equivalent to an empty rowset. + ** + ** Also initialize regReturn to contain the address of the instruction + ** immediately following the OP_Return at the bottom of the loop. This + ** is required in a few obscure LEFT JOIN cases where control jumps + ** over the top of the loop into the body of it. In this case the + ** correct response for the end-of-loop code (the OP_Return) is to + ** fall through to the next instruction, just as an OP_Next does if + ** called on an uninitialized cursor. + */ + if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ + regRowset = ++pParse->nMem; + regRowid = ++pParse->nMem; + sqlite3VdbeAddOp2(v, OP_Null, 0, regRowset); + } + iRetInit = sqlite3VdbeAddOp2(v, OP_Integer, 0, regReturn); + + for(ii=0; iinTerm; ii++){ + WhereTerm *pOrTerm = &pOrWc->a[ii]; + if( pOrTerm->leftCursor==iCur || pOrTerm->eOperator==WO_AND ){ + WhereInfo *pSubWInfo; /* Info for single OR-term scan */ + + /* Loop through table entries that match term pOrTerm. */ + pSubWInfo = sqlite3WhereBegin(pParse, &oneTab, pOrTerm->pExpr, 0, + WHERE_OMIT_OPEN | WHERE_OMIT_CLOSE | WHERE_FORCE_TABLE); + if( pSubWInfo ){ + if( (wctrlFlags & WHERE_DUPLICATES_OK)==0 ){ + int iSet = ((ii==pOrWc->nTerm-1)?-1:ii); + int r; + r = sqlite3ExprCodeGetColumn(pParse, pTabItem->pTab, -1, iCur, + regRowid, 0); + sqlite3VdbeAddOp4(v, OP_RowSetTest, regRowset, + sqlite3VdbeCurrentAddr(v)+2, + r, SQLITE_INT_TO_PTR(iSet), P4_INT32); + } + sqlite3VdbeAddOp2(v, OP_Gosub, regReturn, iLoopBody); + + /* Finish the loop through table entries that match term pOrTerm. */ + 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; - } + sqlite3VdbeChangeP1(v, iRetInit, sqlite3VdbeCurrentAddr(v)); + /* sqlite3VdbeAddOp2(v, OP_Null, 0, regRowset); */ + sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrBrk); + sqlite3VdbeResolveLabel(v, iLoopBody); + + pLevel->op = OP_Return; + pLevel->p1 = regReturn; disableTerm(pLevel, pTerm); }else #endif /* SQLITE_OMIT_OR_OPTIMIZATION */ @@ -2793,7 +2918,6 @@ static Bitmask codeOneLoopStart( pLevel->p1 = iCur; pLevel->p2 = 1 + sqlite3VdbeAddOp2(v, aStart[bRev], iCur, addrBrk); pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP; - codeRowSetEarly = 0; } notReady &= ~getMask(pWC->pMaskSet, iCur); @@ -2812,9 +2936,7 @@ static Bitmask codeOneLoopStart( 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; } @@ -2826,8 +2948,7 @@ static Bitmask codeOneLoopStart( 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); + sqlite3ExprCacheClear(pParse); for(pTerm=pWC->a, j=0; jnTerm; j++, pTerm++){ testcase( pTerm->wtFlags & TERM_VIRTUAL ); testcase( pTerm->wtFlags & TERM_CODED ); @@ -2838,24 +2959,7 @@ static Bitmask codeOneLoopStart( 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); - } + sqlite3ReleaseTempReg(pParse, iReleaseReg); return notReady; } @@ -2882,7 +2986,7 @@ static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){ for(i=0; inLevel; i++){ sqlite3_index_info *pInfo = pWInfo->a[i].pIdxInfo; if( pInfo ){ - assert( pInfo->needToFreeIdxStr==0 || db->mallocFailed ); + /* assert( pInfo->needToFreeIdxStr==0 || db->mallocFailed ); */ if( pInfo->needToFreeIdxStr ){ sqlite3_free(pInfo->idxStr); } @@ -2988,8 +3092,7 @@ WhereInfo *sqlite3WhereBegin( 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 */ + u16 wctrlFlags /* One of the WHERE_* flags defined in sqliteInt.h */ ){ int i; /* Loop counter */ int nByteWInfo; /* Num. bytes allocated for WhereInfo struct */ @@ -3003,7 +3106,6 @@ WhereInfo *sqlite3WhereBegin( int iFrom; /* First unused FROM clause element */ int andFlags; /* AND-ed combination of all pWC->a[].wtFlags */ 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 @@ -3013,10 +3115,6 @@ WhereInfo *sqlite3WhereBegin( return 0; } - if( ppOrderBy ){ - pOrderBy = *ppOrderBy; - } - /* Allocate and initialize the WhereInfo structure that will become the ** return value. A single allocation is used to store the WhereInfo ** struct, the contents of WhereInfo.a[], the WhereClause structure @@ -3038,7 +3136,6 @@ WhereInfo *sqlite3WhereBegin( pWInfo->pParse = pParse; pWInfo->pTabList = pTabList; pWInfo->iBreak = sqlite3VdbeMakeLabel(v); - pWInfo->regRowSet = (wctrlFlags & WHERE_FILL_ROWSET) ? regRowSet : -1; pWInfo->pWC = pWC = (WhereClause *)&((u8 *)pWInfo)[nByteWInfo]; pWInfo->wctrlFlags = wctrlFlags; pMaskSet = (WhereMaskSet*)&pWC[1]; @@ -3125,8 +3222,9 @@ WhereInfo *sqlite3WhereBegin( memset(&bestPlan, 0, sizeof(bestPlan)); bestPlan.rCost = 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() */ + int doNotReorder; /* True if this table should not be reordered */ + WhereCost sCost; /* Cost information from best[Virtual]Index() */ + ExprList *pOrderBy; /* ORDER BY clause for index to optimize */ doNotReorder = (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0; if( once && doNotReorder ) break; @@ -3135,34 +3233,17 @@ WhereInfo *sqlite3WhereBegin( if( j==iFrom ) iFrom++; continue; } + pOrderBy = ((i==0 && ppOrderBy )?*ppOrderBy:0); + 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))a[j].pIdxInfo; + bestVirtualIndex(pParse, pWC, pTabItem, notReady, pOrderBy, &sCost, pp); }else #endif { - bestIndex(pParse, pWC, pTabItem, notReady, - (i==0 && ppOrderBy) ? *ppOrderBy : 0, &sCost); + bestBtreeIndex(pParse, pWC, pTabItem, notReady, pOrderBy, &sCost); } if( once==0 || sCost.rCostmallocFailed ){ + if( pParse->nErr || db->mallocFailed ){ goto whereBeginError; } @@ -3390,7 +3471,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ /* Generate loop termination code. */ - sqlite3ExprClearColumnCache(pParse, -1); + sqlite3ExprCacheClear(pParse); for(i=pTabList->nSrc-1; i>=0; i--){ pLevel = &pWInfo->a[i]; sqlite3VdbeResolveLabel(v, pLevel->addrCont); @@ -3417,7 +3498,11 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){ if( pLevel->iIdxCur>=0 ){ sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); } - sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrFirst); + if( pLevel->op==OP_Return ){ + sqlite3VdbeAddOp2(v, OP_Gosub, pLevel->p1, pLevel->addrFirst); + }else{ + sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrFirst); + } sqlite3VdbeJumpHere(v, addr); } } diff --git a/test/alias.test b/test/alias.test index 69a2c24..2907989 100644 --- a/test/alias.test +++ b/test/alias.test @@ -13,11 +13,15 @@ # focus of this script is correct code generation of aliased result-set # values. See ticket #3343. # -# $Id: alias.test,v 1.2 2008/10/25 15:03:21 drh Exp $ +# $Id: alias.test,v 1.3 2009/04/23 13:22:44 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl +# Aliases are currently evaluated twice. We might try to change this +# in the future. But not now. +return + # A procedure to return a sequence of increasing integers. # namespace eval ::seq { diff --git a/test/async.test b/test/async.test index 33f8630..cdda899 100644 --- a/test/async.test +++ b/test/async.test @@ -6,12 +6,12 @@ #*********************************************************************** # This file runs all tests. # -# $Id: async.test,v 1.19 2009/04/11 10:25:04 danielk1977 Exp $ +# $Id: async.test,v 1.20 2009/04/25 08:39:15 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl -if {[catch {sqlite3async_enable}]} { +if {[info commands sqlite3async_initialize] eq ""} { # The async logic is not built into this system finish_test return @@ -41,15 +41,15 @@ set ASYNC_INCLUDE { } # Enable asynchronous IO. -sqlite3async_enable 1 +sqlite3async_initialize "" 1 rename do_test async_really_do_test proc do_test {name args} { uplevel async_really_do_test async_io-$name $args sqlite3async_start - sqlite3async_halt idle + sqlite3async_control halt idle sqlite3async_wait - sqlite3async_halt never + sqlite3async_control halt never } foreach testfile [lsort -dictionary [glob $testdir/*.test]] { @@ -62,20 +62,20 @@ foreach testfile [lsort -dictionary [glob $testdir/*.test]] { # [file delete]). If the asynchronous backend still has the file # open, it will become confused. # - sqlite3async_halt idle + sqlite3async_control halt idle sqlite3async_start sqlite3async_wait - sqlite3async_halt never + sqlite3async_control halt never } # Flush the write-queue and disable asynchronous IO. This should ensure # all allocated memory is cleaned up. set sqlite3async_trace 1 -sqlite3async_halt idle +sqlite3async_control halt idle sqlite3async_start sqlite3async_wait -sqlite3async_halt never -sqlite3async_enable 0 +sqlite3async_control halt never +sqlite3async_shutdown set sqlite3async_trace 0 rename do_test {} diff --git a/test/async2.test b/test/async2.test index cbe6991..ec4ae30 100644 --- a/test/async2.test +++ b/test/async2.test @@ -5,14 +5,14 @@ # #*********************************************************************** # -# $Id: async2.test,v 1.10 2009/03/24 17:43:57 drh Exp $ +# $Id: async2.test,v 1.12 2009/04/25 08:39:15 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if { - [info commands sqlite3async_enable]=="" || + [info commands sqlite3async_initialize]=="" || [info command sqlite3_memdebug_fail]=="" } { # The async logic is not built into this system @@ -56,7 +56,7 @@ foreach err [list ioerr malloc-transient malloc-persistent] { execsql $::setup_script db close - sqlite3async_enable 1 + sqlite3async_initialize "" 1 sqlite3 db test.db sqlite3_db_config_lookaside db 0 0 0 @@ -69,11 +69,11 @@ foreach err [list ioerr malloc-transient malloc-persistent] { catchsql $::sql_script db close - sqlite3async_halt idle + sqlite3async_control halt idle sqlite3async_start sqlite3async_wait - sqlite3async_halt never - sqlite3async_enable 0 + sqlite3async_control halt never + sqlite3async_shutdown set ::sqlite_io_error_pending 0 sqlite3_memdebug_fail -1 @@ -122,9 +122,5 @@ foreach err [list ioerr malloc-transient malloc-persistent] { } catch {db close} -sqlite3async_halt idle -sqlite3async_start -sqlite3async_wait -sqlite3async_halt never finish_test diff --git a/test/async3.test b/test/async3.test index 553088b..77c4d55 100644 --- a/test/async3.test +++ b/test/async3.test @@ -13,12 +13,12 @@ # Specifically, it tests that the xFullPathname() method of # of the asynchronous vfs works correctly. # -# $Id: async3.test,v 1.4 2009/03/28 18:56:14 drh Exp $ +# $Id: async3.test,v 1.5 2009/04/25 08:39:15 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl -if { [info commands sqlite3async_enable]=="" } { +if { [info commands sqlite3async_initialize]=="" } { # The async logic is not built into this system puts "Skipping async3 tests: not compiled with required features" finish_test @@ -26,7 +26,7 @@ if { [info commands sqlite3async_enable]=="" } { } db close -sqlite3async_enable 1 +sqlite3async_initialize "" 1 #set sqlite3async_trace 1 sqlite3async_start @@ -69,8 +69,8 @@ foreach p $paths { db close -sqlite3async_halt idle +sqlite3async_control halt idle sqlite3async_wait -sqlite3async_halt never -sqlite3async_enable 0 +sqlite3async_control halt never +sqlite3async_shutdown finish_test diff --git a/test/async4.test b/test/async4.test new file mode 100644 index 0000000..8ccab6e --- /dev/null +++ b/test/async4.test @@ -0,0 +1,149 @@ +# 2009 April 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. +# +#*********************************************************************** +# +# $Id: async4.test,v 1.1 2009/04/25 08:39:15 danielk1977 Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +if {[info commands sqlite3async_initialize] eq ""} { + # The async logic is not built into this system + finish_test + return +} +db close + +# Test layout: +# +# async4.1.*: Test the lockfiles parameter. +# async4.2.*: Test the delay parameter. + +do_test async4.1.1 { + sqlite3async_initialize {} 0 + sqlite3async_control lockfiles +} {1} +do_test async4.1.2 { + sqlite3async_control lockfiles false +} {0} +do_test async4.1.3 { + sqlite3async_control lockfiles +} {0} +do_test async4.1.4 { + sqlite3async_control lockfiles true +} {1} + +do_test async4.1.5 { + sqlite3 db test.db -vfs sqlite3async + execsql { CREATE TABLE t1(a, b, c) } +} {} +do_test async4.1.6 { + list [file exists test.db] [file size test.db] +} {1 0} +do_test async4.1.7 { + sqlite3 db2 test.db + catchsql { CREATE TABLE t2(a, b, c) } db2 +} {1 {database is locked}} +do_test async4.1.8 { + sqlite3async_control halt idle + sqlite3async_start + sqlite3async_wait +} {} +do_test async4.1.9 { + catchsql { CREATE TABLE t2(a, b, c) } db2 +} {0 {}} +do_test async4.1.10 { + list [catch {sqlite3async_control lockfiles false} msg] $msg +} {1 SQLITE_MISUSE} +do_test async4.1.11 { + db close + list [catch {sqlite3async_control lockfiles false} msg] $msg +} {1 SQLITE_MISUSE} +do_test async4.1.12 { + sqlite3async_start + sqlite3async_wait + sqlite3async_control lockfiles false +} {0} +do_test async4.1.13 { + sqlite3 db test.db -vfs sqlite3async + execsql { CREATE TABLE t3(a, b, c) } db +} {} +do_test async4.1.14 { + execsql { + CREATE INDEX i1 ON t2(a); + CREATE INDEX i2 ON t1(a); + } db2 +} {} +do_test async4.1.15 { + sqlite3async_start + sqlite3async_wait + execsql { pragma integrity_check } db2 +} {{*** in database main *** +Page 5 is never used}} +do_test async4.1.16 { + db close + db2 close + sqlite3async_start + sqlite3async_wait +} {} + +do_test async4.2.1 { + sqlite3async_control delay +} {0} +do_test async4.2.2 { + sqlite3async_control delay 23 +} {23} +do_test async4.2.3 { + sqlite3async_control delay +} {23} +do_test async4.2.4 { + sqlite3async_control delay 0 +} {0} +do_test async4.2.5 { + sqlite3 db test.db -vfs sqlite3async + + execsql { CREATE TABLE t4(a, b) } + set T1 [lindex [time { + sqlite3async_start + sqlite3async_wait + }] 0] + + sqlite3async_control delay 100 + execsql { CREATE TABLE t5(a, b) } + set T2 [lindex [time { + sqlite3async_start + sqlite3async_wait + }] 0] + + expr {($T1+1000000) < $T2} +} {1} + +do_test async4.2.6 { + sqlite3async_control delay 0 + execsql { CREATE TABLE t6(a, b) } + set T1 [lindex [time { + sqlite3async_start + sqlite3async_wait + }] 0] + + expr {($T1+1000000) < $T2} +} {1} + +do_test async4.2.7 { + list [catch { sqlite3async_control delay -1 } msg] $msg +} {1 SQLITE_MISUSE} + +do_test async4.2.8 { + db close + sqlite3async_start + sqlite3async_wait +} {} + +finish_test + diff --git a/test/auth.test b/test/auth.test index 1cb2e32..6942e0d 100644 --- a/test/auth.test +++ b/test/auth.test @@ -12,7 +12,7 @@ # 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.45 2009/05/04 01:58:31 drh Exp $ # set testdir [file dirname $argv0] @@ -2141,7 +2141,7 @@ do_test auth-2.9.1 { return SQLITE_OK } catchsql {SELECT ROWID,b,c FROM t2} -} {1 {illegal return value (999) from the authorization function - should be SQLITE_OK, SQLITE_IGNORE, or SQLITE_DENY}} +} {1 {authorizer malfunction}} do_test auth-2.9.2 { db errorcode } {1} @@ -2153,7 +2153,7 @@ do_test auth-2.10 { return SQLITE_OK } catchsql {SELECT ROWID,b,c FROM t2} -} {1 {illegal return value (1) from the authorization function - should be SQLITE_OK, SQLITE_IGNORE, or SQLITE_DENY}} +} {1 {authorizer malfunction}} do_test auth-2.11.1 { proc auth {code arg1 arg2 arg3 arg4} { if {$code=="SQLITE_READ" && $arg2=="a"} { diff --git a/test/auth3.test b/test/auth3.test index 0d99cac..21e2b3b 100644 --- a/test/auth3.test +++ b/test/auth3.test @@ -12,7 +12,7 @@ # 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 $ +# $Id: auth3.test,v 1.2 2009/05/04 01:58:31 drh Exp $ # set testdir [file dirname $argv0] @@ -57,7 +57,7 @@ do_test auth3.1.2 { 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}} +} {1 {authorizer malfunction}} do_test auth3.1.4 { execsql { SELECT * FROM t1 } } {1 2 3 4 5 6} diff --git a/test/bindxfer.test b/test/bindxfer.test index b8e71d9..393aab9 100644 --- a/test/bindxfer.test +++ b/test/bindxfer.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script testing the sqlite_transfer_bindings() API. # -# $Id: bindxfer.test,v 1.7 2009/04/09 14:02:44 drh Exp $ +# $Id: bindxfer.test,v 1.9 2009/04/17 11:56:28 drh Exp $ # set testdir [file dirname $argv0] @@ -68,13 +68,6 @@ ifcapable deprecated { do_test bindxfer-1.8 { set VALUES } {one two {}} - catch {sqlite3_finalize $VM1} - catch {sqlite3_finalize $VM2} - do_test bindxfer-1.10 { - set VM1 [sqlite3_prepare $DB {SELECT ?, ?, ?} -1 TAIL] - set VM2 [sqlite3_prepare $DB {SELECT ?, ?, ?, ?} -1 TAIL] - sqlite3_transfer_bindings $VM1 $VM2 - } 1 ;# SQLITE_ERROR } catch {sqlite3_finalize $VM1} catch {sqlite3_finalize $VM2} diff --git a/test/blob.test b/test/blob.test index 0021ddb..b1aae38 100644 --- a/test/blob.test +++ b/test/blob.test @@ -10,7 +10,7 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # -# $Id: blob.test,v 1.7 2008/04/04 15:12:22 drh Exp $ +# $Id: blob.test,v 1.8 2009/04/28 18:00:27 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -137,7 +137,7 @@ do_test blob-3.1 { sqlite3_finalize $STMT db2 close } {} -do_test blob-2.3 { +do_test blob-3.2 { set blobs [execsql {SELECT * FROM t1}] set blobs2 [list] foreach b $blobs {lappend blobs2 [bin_to_hex $b]} diff --git a/test/conflict.test b/test/conflict.test index 8eb25b1..44390d2 100644 --- a/test/conflict.test +++ b/test/conflict.test @@ -13,7 +13,7 @@ # This file implements tests for the conflict resolution extension # to SQLite. # -# $Id: conflict.test,v 1.31 2008/01/21 16:22:46 drh Exp $ +# $Id: conflict.test,v 1.32 2009/04/30 09:10:38 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -308,7 +308,7 @@ foreach {i conf1 cmd t0 t1 t2 t3 t4} { } { if {$t0} {set t1 {column a is not unique}} if {[info exists TEMP_STORE] && $TEMP_STORE>=2} { - set t3 $t4 + set t3 0 } else { set t3 [expr {$t3+$t4}] } diff --git a/test/count.test b/test/count.test index d0adb53..e810e2f 100644 --- a/test/count.test +++ b/test/count.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing "SELECT count(*)" statements. # -# $Id: count.test,v 1.4 2009/04/02 20:27:28 drh Exp $ +# $Id: count.test,v 1.5 2009/05/01 21:13:37 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -155,6 +155,7 @@ ifcapable vtab { } do_test count-3.1 { +breakpoint execsql { CREATE TABLE t3(a, b); SELECT a FROM (SELECT count(*) AS a FROM t3) WHERE a==0; diff --git a/test/date.test b/test/date.test index 1036993..df522c2 100644 --- a/test/date.test +++ b/test/date.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing date and time functions. # -# $Id: date.test,v 1.33 2009/04/01 20:44:14 drh Exp $ +# $Id: date.test,v 1.34 2009/04/16 12:58:03 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -71,6 +71,11 @@ datetest 2.1c datetime(0,'unixepochx') NULL datetest 2.1d datetime('2003-10-22','unixepoch') NULL datetest 2.2 datetime(946684800,'unixepoch') {2000-01-01 00:00:00} datetest 2.2b datetime('946684800','unixepoch') {2000-01-01 00:00:00} +for {set i 0} {$i<1000} {incr i} { + set sql [format {strftime('%%H:%%M:%%f',1237962480.%03d,'unixepoch')} $i] + set res [format {06:28:00.%03d} $i] + datetest 2.2c-$i $sql $res +} datetest 2.3 {date('2003-10-22','weekday 0')} 2003-10-26 datetest 2.4 {date('2003-10-22','weekday 1')} 2003-10-27 datetest 2.4a {date('2003-10-22','weekday 1')} 2003-10-27 diff --git a/test/exclusive.test b/test/exclusive.test index de25a08..43ef78d 100644 --- a/test/exclusive.test +++ b/test/exclusive.test @@ -12,7 +12,7 @@ # 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.14 2009/04/30 16:41:00 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -417,7 +417,7 @@ 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} +} [expr 3 - ($TEMP_STORE>=2)] do_test exclusive-5.2 { execsql { COMMIT; @@ -443,7 +443,7 @@ do_test exclusive-5.4 { # Three files are open: The db, journal and statement-journal. set sqlite_open_file_count expr $sqlite_open_file_count-$extrafds -} {3} +} [expr 3 - ($TEMP_STORE>=2)] do_test exclusive-5.5 { execsql { COMMIT; @@ -451,7 +451,7 @@ do_test exclusive-5.5 { # Three files are still open: The db, journal and statement-journal. set sqlite_open_file_count expr $sqlite_open_file_count-$extrafds -} {3} +} [expr 3 - ($TEMP_STORE>=2)] do_test exclusive-5.6 { execsql { PRAGMA locking_mode = normal; diff --git a/test/func.test b/test/func.test index ae0f017..6664d27 100644 --- a/test/func.test +++ b/test/func.test @@ -11,7 +11,7 @@ # 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.92 2009/04/15 15:16:53 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -1056,6 +1056,20 @@ for {set i 1} {$i<[sqlite3_limit db SQLITE_LIMIT_FUNCTION_ARG -1]} {incr i} { } $result } +# Ticket #3806. If the initial string in a group_concat is an empty +# string, the separate that follows should still be present. +# +do_test func-24.8 { + execsql { + SELECT group_concat(CASE t1 WHEN 'this' THEN '' ELSE t1 END) FROM tbl1 + } +} {,program,is,free,software} +do_test func-24.9 { + execsql { + SELECT group_concat(CASE WHEN t1!='software' THEN '' ELSE t1 END) FROM tbl1 + } +} {,,,,software} + # Use the test_isolation function to make sure that type conversions # on function arguments do not effect subsequent arguments. # diff --git a/test/fuzz.test b/test/fuzz.test index f9b8c22..5111107 100644 --- a/test/fuzz.test +++ b/test/fuzz.test @@ -19,7 +19,7 @@ # # 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.19 2009/04/28 11:10:39 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -287,6 +287,20 @@ do_test fuzz-1.18 { } } {0 -4294967298} +# At one point the following INSERT statement caused an assert() to fail. +# +do_test fuzz-1.19 { + execsql { CREATE TABLE t1(a) } + catchsql { + INSERT INTO t1 VALUES( + CASE WHEN NULL THEN NULL ELSE ( SELECT 0 ORDER BY 456 ) END + ) + } +} {1 {1st ORDER BY term out of range - should be between 1 and 1}} +do_test fuzz-1.20 { + execsql { DROP TABLE t1 } +} {} + #---------------------------------------------------------------- # Test some fuzzily generated expressions. # diff --git a/test/insert3.test b/test/insert3.test index c3b6069..6b253e0 100644 --- a/test/insert3.test +++ b/test/insert3.test @@ -11,7 +11,7 @@ # 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.9 2009/04/23 14:58:40 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -166,9 +166,11 @@ ifcapable bloblit { } } {{} 4.3 hi} } -db close -file delete -force test.db +foreach tab [db eval {SELECT name FROM sqlite_master WHERE type = 'table'}] { + db eval "DROP TABLE $tab" +} +db close sqlite3 db test.db #------------------------------------------------------------------------- diff --git a/test/jrnlmode.test b/test/jrnlmode.test index 900a77f..114b255 100644 --- a/test/jrnlmode.test +++ b/test/jrnlmode.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The focus # of these tests is the journal mode pragma. # -# $Id: jrnlmode.test,v 1.14 2009/04/10 15:02:44 danielk1977 Exp $ +# $Id: jrnlmode.test,v 1.15 2009/04/20 17:43:03 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -282,6 +282,7 @@ ifcapable autovacuum&&pragma { } {3} do_test jrnlmode-4.2 { +breakpoint execsql { PRAGMA journal_mode = off } } {off} @@ -464,7 +465,7 @@ ifcapable pragma { INSERT INTO t4 VALUES(1, 2); PRAGMA journal_mode = memory; } - } {truncate memory} + } {truncate truncate} do_test jrnlmode-6.2 { file exists test.db-journal } {1} @@ -476,14 +477,15 @@ ifcapable pragma { } {1 2} do_test jrnlmode-6.4 { file exists test.db-journal - } {0} + } {1} do_test jrnlmode-6.5 { execsql { + PRAGMA journal_mode = MEMORY; BEGIN; INSERT INTO t4 VALUES(3, 4); } file exists test.db-journal - } {0} + } {1} do_test jrnlmode-6.7 { execsql { COMMIT; @@ -492,6 +494,13 @@ ifcapable pragma { } {1 2 3 4} do_test jrnlmode-6.8 { file exists test.db-journal + } {1} + do_test jrnlmode-6.9 { + execsql { + PRAGMA journal_mode = DELETE; + BEGIN IMMEDIATE; COMMIT; + } + file exists test.db-journal } {0} } } diff --git a/test/jrnlmode3.test b/test/jrnlmode3.test new file mode 100644 index 0000000..7a6f4c3 --- /dev/null +++ b/test/jrnlmode3.test @@ -0,0 +1,150 @@ +# 2009 April 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. +# +#*********************************************************************** +# +# Test cases inspired by ticket #3811. Tests to make sure that +# the journal_mode can only be changed at appropriate times and that +# all reported changes are effective. +# +# $Id: jrnlmode3.test,v 1.5 2009/04/20 17:43:03 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +ifcapable {!pager_pragmas} { + finish_test + return +} + +# +# Verify that journal_mode=OFF works as long as it occurs before the first +# transaction, even if locking_mode=EXCLUSIVE is enabled. The behavior if +# journal_mode is changed after the first transaction is undefined and hence +# untested. +# +do_test jrnlmode3-1.1 { + db eval { + PRAGMA journal_mode=OFF; + PRAGMA locking_mode=EXCLUSIVE; + CREATE TABLE t1(x); + INSERT INTO t1 VALUES(1); + SELECT * FROM t1; + } +} {off exclusive 1} +do_test jrnlmode3-1.2 { + db eval { + BEGIN; + INSERT INTO t1 VALUES(2); + ROLLBACK; + SELECT * FROM t1; + } +} {1 2} + +db close +file delete -force test.db test.db-journal +sqlite3 db test.db + +do_test jrnlmode3-2.1 { + db eval { + PRAGMA locking_mode=EXCLUSIVE; + PRAGMA journal_mode=OFF; + CREATE TABLE t1(x); + INSERT INTO t1 VALUES(1); + SELECT * FROM t1; + } +} {exclusive off 1} +do_test jrnlmode3-2.2 { + db eval { + BEGIN; + INSERT INTO t1 VALUES(2); + ROLLBACK; + SELECT * FROM t1; + } +} {1 2} + +# Test cases to verify that we can move from any journal_mode +# to any other, as long as we are not in a transaction. Verify +# that we cannot change journal_mode while a transaction is active. +# +set all_journal_modes {delete persist truncate memory off} +set cnt 0 +foreach fromjmode $all_journal_modes { + foreach tojmode $all_journal_modes { + + # Skip the no-change cases + if {$fromjmode==$tojmode} continue + incr cnt + + # Start with a fresh database connection an empty database file. + # + db close + file delete -force test.db test.db-journal + sqlite3 db test.db + + # Initialize the journal mode. + # + do_test jrnlmode3-3.$cnt.1-($fromjmode-to-$tojmode) { + db eval "PRAGMA journal_mode = $fromjmode;" + } $fromjmode + + # Verify that the initial journal mode takes. + # + do_test jrnlmode3-3.$cnt.2 { + db eval {PRAGMA main.journal_mode} + } $fromjmode + + # Start a transaction and try to change the journal mode within + # the transaction. This should fail. + # + do_test jrnlmode3-3.$cnt.3 { + db eval { + CREATE TABLE t1(x); + BEGIN; + INSERT INTO t1 VALUES($cnt); + } + db eval "PRAGMA journal_mode=$tojmode" + } $fromjmode + + # Rollback the transaction. Verify that the rollback occurred + # if journal_mode!=OFF. + # + do_test jrnlmode3-3.$cnt.4 { + db eval { + ROLLBACK; + SELECT * FROM t1; + } + } [expr {$fromjmode=="off"?$cnt:""}] + + # Now change the journal mode again. This time the new mode + # should take. + # + do_test jrnlmode3-3.$cnt.5 { + db eval "PRAGMA journal_mode=$tojmode" + } $tojmode + + # Do a the transaction. Verify that the rollback occurred + # if journal_mode!=OFF. + # + do_test jrnlmode3-3.$cnt.6 { + db eval { + DROP TABLE IF EXISTS t1; + CREATE TABLE t1(x); + BEGIN; + INSERT INTO t1 VALUES(1); + } + db eval ROLLBACK + db eval { + SELECT * FROM t1; + } + } [expr {$tojmode=="off"?"1":""}] + } +} + +finish_test diff --git a/test/lock2.test b/test/lock2.test index e6c46d3..a2b75ca 100644 --- a/test/lock2.test +++ b/test/lock2.test @@ -11,7 +11,7 @@ # 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.11 2009/05/01 10:55:34 danielk1977 Exp $ set testdir [file dirname $argv0] @@ -42,6 +42,9 @@ proc testfixture {chan cmd} { if { $line == "OVER" } { return $r } + if {[eof $chan]} { + return "ERROR: Child process hung up" + } append r $line } } diff --git a/test/lock4.test b/test/lock4.test index 77de346..a8cacb1 100644 --- a/test/lock4.test +++ b/test/lock4.test @@ -11,7 +11,7 @@ # 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.10 2009/05/06 00:52:41 drh Exp $ set testdir [file dirname $argv0] @@ -102,6 +102,7 @@ do_test lock4-1.3 { # deleting the journal file. But it might retain the lock for a # fraction longer # + after 25 db2 eval { SELECT * FROM t2 } diff --git a/test/main.test b/test/main.test index 9945cf2..12262c1 100644 --- a/test/main.test +++ b/test/main.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is exercising the code in main.c. # -# $Id: main.test,v 1.30 2008/09/18 18:18:29 drh Exp $ +# $Id: main.test,v 1.32 2009/04/28 04:51:29 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -85,6 +85,16 @@ ifcapable {trigger} { CREATE TRIGGER xyz AFTER DELETE abc BEGIN UPDATE pqr; } } {0} + do_test main-1.17.2 { + db complete { + EXPLAIN CREATE TRIGGER xyz AFTER DELETE abc BEGIN UPDATE pqr; + } + } {0} + do_test main-1.17.3 { + db complete { + EXPLAIN QUERY PLAN CREATE TRIGGER xyz AFTER DELETE abc BEGIN UPDATE pqr; + } + } {0} do_test main-1.18 { db complete { CREATE TRIGGER xyz AFTER DELETE abc BEGIN UPDATE pqr; END; @@ -444,33 +454,33 @@ do_test main-3.6 { # The following test-case tests the linked list code used to manage # sqlite3_vfs structures. if {$::tcl_platform(platform)=="unix" - && [info command sqlite3async_enable]!=""} { + && [info command sqlite3async_initialize]!=""} { ifcapable threadsafe { do_test main-4.1 { sqlite3_crash_enable 1 sqlite3_crash_enable 0 - sqlite3async_enable 1 - sqlite3async_enable 0 + sqlite3async_initialize "" 1 + sqlite3async_shutdown sqlite3_crash_enable 1 - sqlite3async_enable 1 + sqlite3async_initialize "" 1 sqlite3_crash_enable 0 - sqlite3async_enable 0 + sqlite3async_shutdown sqlite3_crash_enable 1 - sqlite3async_enable 1 - sqlite3async_enable 0 + sqlite3async_initialize "" 1 + sqlite3async_shutdown sqlite3_crash_enable 0 - sqlite3async_enable 1 + sqlite3async_initialize "" 1 sqlite3_crash_enable 1 sqlite3_crash_enable 0 - sqlite3async_enable 0 + sqlite3async_shutdown - sqlite3async_enable 1 + sqlite3async_initialize "" 1 sqlite3_crash_enable 1 - sqlite3async_enable 0 + sqlite3async_shutdown sqlite3_crash_enable 0 } {} do_test main-4.2 { diff --git a/test/make-where7.tcl b/test/make-where7.tcl index 74cbd83..706f184 100644 --- a/test/make-where7.tcl +++ b/test/make-where7.tcl @@ -103,19 +103,17 @@ for {set i 2} {$i<=$NT+1} {incr i} { set seen($w) 1 set result [lsort -int [array names r]] puts "do_test where7-2.$i.1 \173" - puts " count_steps \173" + puts " count_steps_sort \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 " count_steps_sort \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}" } diff --git a/test/misc3.test b/test/misc3.test index 1534aaf..94a43c4 100644 --- a/test/misc3.test +++ b/test/misc3.test @@ -13,7 +13,7 @@ # This file implements tests for miscellanous features that were # left out of other test files. # -# $Id: misc3.test,v 1.19 2008/06/25 02:47:57 drh Exp $ +# $Id: misc3.test,v 1.20 2009/05/06 00:49:01 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -272,16 +272,26 @@ ifcapable {explain} { }] regexp { IsUnique \d+ \d+ \d+ \d+ } $x } {1} - do_test misc3-6.11 { - set x [execsql { - EXPLAIN SELECT a+123456789012, b*4.5678, c FROM ex1 ORDER BY +a, b DESC - }] - set y [regexp { 123456789012 } $x] - lappend y [regexp { 4.5678 } $x] - lappend y [regexp { hello } $x] - lappend y [regexp {,-BINARY} $x] - } {1 1 1 1} - + if {[regexp {16} [db one {PRAGMA encoding}]]} { + do_test misc3-6.11-utf16 { + set x [execsql { + EXPLAIN SELECT a+123456789012, b*4.5678, c FROM ex1 ORDER BY +a, b DESC + }] + set y [regexp { 123456789012 } $x] + lappend y [regexp { 4.5678 } $x] + lappend y [regexp {,-BINARY} $x] + } {1 1 1} + } else { + do_test misc3-6.11-utf8 { + set x [execsql { + EXPLAIN SELECT a+123456789012, b*4.5678, c FROM ex1 ORDER BY +a, b DESC + }] + set y [regexp { 123456789012 } $x] + lappend y [regexp { 4.5678 } $x] + lappend y [regexp { hello } $x] + lappend y [regexp {,-BINARY} $x] + } {1 1 1 1} + } } ifcapable {trigger} { diff --git a/test/mutex1.test b/test/mutex1.test index 75580f3..ad6bd14 100644 --- a/test/mutex1.test +++ b/test/mutex1.test @@ -9,7 +9,7 @@ # #*********************************************************************** # -# $Id: mutex1.test,v 1.19 2009/03/24 15:08:10 drh Exp $ +# $Id: mutex1.test,v 1.20 2009/04/23 14:58:40 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -97,8 +97,8 @@ do_test mutex1-1.9 { # * Multi-threaded mode, # * Single-threaded mode. # -set enable_shared_cache [sqlite3_enable_shared_cache 1] -ifcapable threadsafe { +ifcapable threadsafe&&shared_cache { + set enable_shared_cache [sqlite3_enable_shared_cache 1] foreach {mode mutexes} { singlethread {} multithread {fast static_lru static_master static_mem static_open static_prng } @@ -133,12 +133,10 @@ ifcapable threadsafe { lsort $res } [lsort $mutexes] } -} -sqlite3_enable_shared_cache $enable_shared_cache + sqlite3_enable_shared_cache $enable_shared_cache -# Open and use a connection in "nomutex" mode. Test that no recursive -# mutexes are obtained. -ifcapable threadsafe { + # Open and use a connection in "nomutex" mode. Test that no recursive + # mutexes are obtained. do_test mutex1.3.1 { catch {db close} clear_mutex_counters diff --git a/test/rowhash.test b/test/rowhash.test new file mode 100644 index 0000000..0d260e9 --- /dev/null +++ b/test/rowhash.test @@ -0,0 +1,56 @@ +# 2009 April 17 +# +# 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 the code in rowhash.c. +# +# $Id: rowhash.test,v 1.5 2009/05/02 12:02:02 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +do_test rowhash-1.1 { + execsql { + CREATE TABLE t1(id INTEGER PRIMARY KEY, a, b, c); + CREATE INDEX i1 ON t1(a); + CREATE INDEX i2 ON t1(b); + CREATE INDEX i3 ON t1(c); + } +} {} + +proc do_keyset_test {name lKey} { + db transaction { + execsql { DELETE FROM t1 } + foreach key $lKey { + execsql { INSERT OR IGNORE INTO t1 VALUES($key, 'a', 'b', 'c') } + } + } + do_test $name { + lsort -integer [execsql { + SELECT id FROM t1 WHERE a = 'a' OR b = 'b' OR c = 'c'; + }] + } [lsort -integer -unique $lKey] +} + +do_keyset_test rowhash-2.1 {1 2 3} +do_keyset_test rowhash-2.2 {0 1 2 3} +do_keyset_test rowhash-2.3 {62 125 188} +if {[working_64bit_int]} { + expr srand(1) + for {set i 4} {$i < 10} {incr i} { + for {set j 0} {$j < 5000} {incr j} { + lappend L [expr int(rand()*1000000000)] + } + do_keyset_test rowhash-2.$i $L + } +} + +finish_test diff --git a/test/savepoint4.test b/test/savepoint4.test index 5b5c18e..c44e050 100644 --- a/test/savepoint4.test +++ b/test/savepoint4.test @@ -9,11 +9,15 @@ # #*********************************************************************** # -# $Id: savepoint4.test,v 1.4 2009/02/10 14:45:13 danielk1977 Exp $ +# $Id: savepoint4.test,v 1.5 2009/04/23 18:42:05 shane Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl +ifcapable !crashtest { + finish_test + return +} proc signature {} { return [db eval {SELECT count(*), md5sum(x) FROM t1}] diff --git a/test/select1.test b/test/select1.test index 2fa7bb4..bdd91e7 100644 --- a/test/select1.test +++ b/test/select1.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the SELECT statement. # -# $Id: select1.test,v 1.67 2009/04/10 15:38:43 drh Exp $ +# $Id: select1.test,v 1.68 2009/04/23 14:58:40 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -1022,9 +1022,12 @@ ifcapable subquery { } {0} } +foreach tab [db eval {SELECT name FROM sqlite_master WHERE type = 'table'}] { + db eval "DROP TABLE $tab" +} db close -file delete -force test.db sqlite3 db test.db + do_test select1-14.1 { execsql { SELECT * FROM sqlite_master WHERE rowid>10; diff --git a/test/select4.test b/test/select4.test index f369389..dff0b90 100644 --- a/test/select4.test +++ b/test/select4.test @@ -12,7 +12,7 @@ # focus of this file is testing UNION, INTERSECT and EXCEPT operators # in SELECT statements. # -# $Id: select4.test,v 1.29 2008/08/04 03:51:24 danielk1977 Exp $ +# $Id: select4.test,v 1.30 2009/04/16 00:24:24 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -374,6 +374,11 @@ do_test select4-5.3 { }} msg] lappend v $msg } {1 {SELECTs to the left and right of UNION ALL do not have the same number of result columns}} +do_test select4-5.3-3807-1 { + catchsql { + SELECT 1 UNION SELECT 2, 3 UNION SELECT 4, 5 ORDER BY 1; + } +} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}} do_test select4-5.4 { set v [catch {execsql { SELECT log FROM t1 WHERE n=2 @@ -791,6 +796,13 @@ do_test select4-11.15 { } } {1 {SELECTs to the left and right of UNION do not have the same number of result columns}} +do_test select4-12.1 { + sqlite3 db2 :memory: + catchsql { + SELECT 1 UNION SELECT 2,3 UNION SELECT 4,5 ORDER BY 1; + } db2 +} {1 {SELECTs to the left and right of UNION do not have the same number of result columns}} + } ;# ifcapable compound finish_test diff --git a/test/shared7.test b/test/shared7.test new file mode 100644 index 0000000..d003f0a --- /dev/null +++ b/test/shared7.test @@ -0,0 +1,55 @@ +# 2009 April 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. +# +#*********************************************************************** +# +# Make sure that attaching the same database multiple times in +# shared cache mode fails. +# +# $Id: shared7.test,v 1.1 2009/04/30 13:30:33 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl +ifcapable !shared_cache { finish_test ; return } + +do_test shared7-1.1 { + set ::enable_shared_cache [sqlite3_enable_shared_cache 1] + sqlite3_enable_shared_cache +} {1} + +do_test shared7-1.2 { + db close + sqlite3 db test.db + db eval { + CREATE TABLE t1(x); + } + catchsql { + ATTACH 'test.db' AS err1; + } +} {1 {database is already attached}} + +do_test shared7-1.3 { + file delete -force test2.db test2.db-journal + db eval { + ATTACH 'test2.db' AS test2; + CREATE TABLE test2.t2(y); + } + catchsql { + ATTACH 'test2.db' AS err2; + } +} {1 {database is already attached}} +do_test shared7-1.4 { + catchsql { + ATTACH 'test.db' AS err1; + } +} {1 {database is already attached}} + + +sqlite3_enable_shared_cache $::enable_shared_cache +finish_test diff --git a/test/table.test b/test/table.test index 55508e9..9d12296 100644 --- a/test/table.test +++ b/test/table.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE TABLE statement. # -# $Id: table.test,v 1.50 2009/03/14 08:37:24 danielk1977 Exp $ +# $Id: table.test,v 1.51 2009/04/28 15:43:45 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -112,15 +112,16 @@ do_test table-2.1e { catchsql {CREATE TABLE IF NOT EXISTS test2(x UNIQUE, y TEXT PRIMARY KEY)} } {0 {}} do_test table-2.1f { +breakpoint execsql {DROP TABLE test2; SELECT name FROM sqlite_master WHERE type!='meta'} } {} # Verify that we cannot make a table with the same name as an index # do_test table-2.2a { - execsql {CREATE TABLE test2(one text); CREATE INDEX test3 ON test2(one)} - set v [catch {execsql {CREATE TABLE test3(two text)}} msg] - lappend v $msg + execsql {CREATE TABLE test2(one text)} + execsql {CREATE INDEX test3 ON test2(one)} + catchsql {CREATE TABLE test3(two text)} } {1 {there is already an index named test3}} do_test table-2.2b { db close diff --git a/test/tempdb.test b/test/tempdb.test index 5e4663f..00fd586 100644 --- a/test/tempdb.test +++ b/test/tempdb.test @@ -12,7 +12,7 @@ # The focus of this file is in making sure that rolling back # a statement journal works correctly. # -# $Id: tempdb.test,v 1.1 2008/04/15 00:02:00 drh Exp $ +# $Id: tempdb.test,v 1.3 2009/05/01 05:23:18 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -52,4 +52,45 @@ do_test tempdb-1.2 { } } {} +do_test tempdb-2.1 { + # Set $::jrnl_in_memory if the journal file is expected to be in-memory. + # Similarly, set $::subj_in_memory if the sub-journal file is expected + # to be in memory. These variables are used to calculate the expected + # number of open files in the test cases below. + # + set jrnl_in_memory [expr { + [info exists ::permutations_test_prefix] && + $::permutations_test_prefix eq "inmemory_journal" + }] + set subj_in_memory [expr {$jrnl_in_memory || $TEMP_STORE == 3}] + + db close + sqlite3 db test.db +} {} +do_test tempdb-2.2 { + execsql { + CREATE TABLE t1 (a PRIMARY KEY, b, c); + CREATE TABLE t2 (a, b, c); + BEGIN; + INSERT INTO t1 VALUES(1, 2, 3); + INSERT INTO t1 VALUES(4, 5, 6); + INSERT INTO t2 SELECT * FROM t1; + } + catchsql { INSERT INTO t1 SELECT * FROM t2 } + set sqlite_open_file_count +} [expr 1 + (0==$jrnl_in_memory) + (0==$subj_in_memory)] +do_test tempdb-2.3 { + execsql { + PRAGMA temp_store = 'memory'; + ROLLBACK; + BEGIN; + INSERT INTO t1 VALUES(1, 2, 3); + INSERT INTO t1 VALUES(4, 5, 6); + INSERT INTO t2 SELECT * FROM t1; + } + catchsql { INSERT INTO t1 SELECT * FROM t2 } + set sqlite_open_file_count +} [expr 1 + (0==$jrnl_in_memory)] + finish_test + diff --git a/test/temptrigger.test b/test/temptrigger.test index a8d4e0c..ececc4a 100644 --- a/test/temptrigger.test +++ b/test/temptrigger.test @@ -9,12 +9,12 @@ # #*********************************************************************** # -# $Id: temptrigger.test,v 1.2 2009/04/07 14:14:23 danielk1977 Exp $ +# $Id: temptrigger.test,v 1.3 2009/04/15 13:07:19 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl -ifcapable !trigger { finish_test ; return } +ifcapable {!trigger || !shared_cache} { finish_test ; return } # Test cases: # diff --git a/test/tkt3461.test b/test/tkt3461.test index 7aef30a..8eec5c2 100644 --- a/test/tkt3461.test +++ b/test/tkt3461.test @@ -13,7 +13,7 @@ # 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 $ +# $Id: tkt3461.test,v 1.3 2009/04/23 13:22:44 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -57,6 +57,7 @@ do_test tkt3461-3.1 { INSERT INTO t2 VALUES(3, 4); } # execsql { PRAGMA vdbe_trace = 1; PRAGMA vdbe_listing=1 } +breakpoint execsql { SELECT a, b+1 AS b_plus_one, c, d FROM t1 LEFT JOIN t2 diff --git a/test/tkt3824.test b/test/tkt3824.test new file mode 100644 index 0000000..5b447bf --- /dev/null +++ b/test/tkt3824.test @@ -0,0 +1,99 @@ +# 2009 April 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. +# +#*********************************************************************** +# +# Ticket #3824 +# +# When you use an "IS NULL" constraint on a UNIQUE index, the result +# is not necessarily UNIQUE. Make sure the optimizer does not assume +# uniqueness. +# +# $Id: tkt3824.test,v 1.2 2009/04/24 20:32:31 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +proc execsql_status {sql {db db}} { + set result [uplevel $db eval [list $sql]] + if {[db status sort]} { + concat $result sort + } else { + concat $result nosort + } +} + +do_test tkt3824-1.1 { + db eval { + CREATE TABLE t1(a,b); + INSERT INTO t1 VALUES(1,NULL); + INSERT INTO t1 VALUES(9,NULL); + INSERT INTO t1 VALUES(5,NULL); + INSERT INTO t1 VALUES(123,NULL); + INSERT INTO t1 VALUES(-10,NULL); + CREATE UNIQUE INDEX t1b ON t1(b); + } + execsql_status { + SELECT a FROM t1 WHERE b IS NULL ORDER BY a; + } +} {-10 1 5 9 123 sort} +do_test tkt3824-1.2 { + execsql_status { + SELECT a FROM t1 WHERE b IS NULL ORDER BY b, a; + } +} {-10 1 5 9 123 sort} + +do_test tkt3824-2.1 { + db eval { + CREATE TABLE t2(a,b,c); + INSERT INTO t2 VALUES(1,1,NULL); + INSERT INTO t2 VALUES(9,2,NULL); + INSERT INTO t2 VALUES(5,2,NULL); + INSERT INTO t2 VALUES(123,3,NULL); + INSERT INTO t2 VALUES(-10,3,NULL); + CREATE UNIQUE INDEX t2bc ON t2(b,c); + } + execsql_status { + SELECT a FROM t2 WHERE b=2 AND c IS NULL ORDER BY a; + } +} {5 9 sort} +do_test tkt3824-2.2 { + execsql_status { + SELECT a FROM t2 WHERE b=2 AND c IS NULL ORDER BY b, a; + } +} {5 9 sort} +do_test tkt3824-2.3 { + lsort [execsql_status { + SELECT a FROM t2 WHERE b=2 AND c IS NULL ORDER BY b; + }] +} {5 9 sort} + +do_test tkt3824-3.1 { + db eval { + CREATE TABLE t3(x,y); + INSERT INTO t3 SELECT a, b FROM t1; + INSERT INTO t3 VALUES(234,567); + CREATE UNIQUE INDEX t3y ON t3(y); + DELETE FROM t3 WHERE y IS NULL; + SELECT * FROM t3; + } +} {234 567} + +do_test tkt3824-4.1 { + db eval { + CREATE TABLE t4(x,y); + INSERT INTO t4 SELECT a, b FROM t1; + INSERT INTO t4 VALUES(234,567); + CREATE UNIQUE INDEX t4y ON t4(y); + UPDATE t4 SET rowid=rowid+100 WHERE y IS NULL; + SELECT rowid, x FROM t4 ORDER BY rowid; + } +} {6 234 101 1 102 9 103 5 104 123 105 -10} + +finish_test diff --git a/test/tkt3832.test b/test/tkt3832.test new file mode 100644 index 0000000..9c73307 --- /dev/null +++ b/test/tkt3832.test @@ -0,0 +1,37 @@ +# 2009 April 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. +# +#*********************************************************************** +# +# Ticket #3832 +# +# A segfault when using a BEFORE trigger on an INSERT and inserting +# a NULL into the INTEGER PRIMARY KEY. +# +# $Id: tkt3832.test,v 1.1 2009/05/01 02:08:04 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + + +do_test tkt3832-1.1 { + db eval { + CREATE TABLE t1(a INT, b INTEGER PRIMARY KEY); + CREATE TABLE log(x); + CREATE TRIGGER t1r1 BEFORE INSERT ON t1 BEGIN + INSERT INTO log VALUES(new.b); + END; + INSERT INTO t1 VALUES(NULL,5); + INSERT INTO t1 SELECT b, a FROM t1 ORDER BY b; + SELECT rowid, * FROM t1; + SELECT rowid, * FROM log; + } +} {5 {} 5 6 5 6 1 5 2 -1} + +finish_test diff --git a/test/tkt3838.test b/test/tkt3838.test new file mode 100644 index 0000000..f56b705 --- /dev/null +++ b/test/tkt3838.test @@ -0,0 +1,37 @@ +# 2009 May 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. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# Ticket #3838 +# +# The ticket reports that the encoding is UTF8 on the DEFAULT VALUE of +# a column added using ALTER TABLE even when the database is UTF16. +# Verify that this has been fixed. +# +# $Id: tkt3838.test,v 1.1 2009/05/05 12:54:50 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + + +do_test tkt3838-1.1 { + db eval { + PRAGMA encoding=UTF16; + CREATE TABLE t1(x); + INSERT INTO t1 VALUES(1); + ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT '999'; + ALTER TABLE t1 ADD COLUMN c REAL DEFAULT '9e99'; + ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'xyzzy'; + UPDATE t1 SET x=x+1; + SELECT * FROM t1; + } +} {2 999 9e+99 xyzzy} + +finish_test diff --git a/test/trans.test b/test/trans.test index 3048b4d..1965941 100644 --- a/test/trans.test +++ b/test/trans.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: trans.test,v 1.40 2009/03/27 09:10:12 danielk1977 Exp $ +# $Id: trans.test,v 1.41 2009/04/28 16:37:59 danielk1977 Exp $ set testdir [file dirname $argv0] @@ -871,7 +871,14 @@ proc signature {} { # t3 a little larger, and thus takes a little longer, so doing 40 tests # is more than 2.0 times slower than doing 20 tests. Considerably more. # -if {[info exists ISQUICK]} { +# Also, if temporary tables are stored in memory and the test pcache +# is in use, only 20 iterations. Otherwise the test pcache runs out +# of page slots and SQLite reports "out of memory". +# +if {[info exists ISQUICK] || ( + $TEMP_STORE==3 && [catch {set ::permutations_test_prefix} val]==0 && + [regexp {^pcache[[:digit:]]*$} $val] +) } { set limit 20 } elseif {[info exists SOAKTEST]} { set limit 100 diff --git a/test/unique.test b/test/unique.test index 7bdc363..56c49ee 100644 --- a/test/unique.test +++ b/test/unique.test @@ -12,7 +12,7 @@ # focus of this file is testing the CREATE UNIQUE INDEX statement, # and primary keys, and the UNIQUE constraint on table columns # -# $Id: unique.test,v 1.8 2005/06/24 03:53:06 drh Exp $ +# $Id: unique.test,v 1.9 2009/05/02 15:46:47 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -248,6 +248,6 @@ do_test unique-5.2 { catchsql { INSERT INTO t5 VALUES(1,2,3,4,5,6); } -} {1 {columns first_column_with_long_name, second_column_with_long_name, third_column_with_long_name, fourth_column_with_long_name, fifth_column_with_long_name, ... are not unique}} +} {1 {columns first_column_with_long_name, second_column_with_long_name, third_column_with_long_name, fourth_column_with_long_name, fifth_column_with_long_name, sixth_column_with_long_name are not unique}} finish_test diff --git a/test/vtabD.test b/test/vtabD.test new file mode 100644 index 0000000..f7fd65b --- /dev/null +++ b/test/vtabD.test @@ -0,0 +1,72 @@ +# 2009 April 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 implements regression tests for SQLite library. The +# focus of this file is creating and dropping virtual tables. +# +# $Id: vtabD.test,v 1.2 2009/04/23 18:42:05 shane Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +ifcapable !vtab||!schema_pragmas { finish_test ; return } + +# Register the echo module +register_echo_module [sqlite3_connection_pointer db] + +do_test vtabD-1.1 { + execsql { + CREATE TABLE t1(a, b); + CREATE INDEX i1 ON t1(a); + CREATE INDEX i2 ON t1(b); + CREATE VIRTUAL TABLE tv1 USING echo(t1); + } +} {} +do_test vtabD-1.2 { + execsql BEGIN + for {set i 0} {$i < 100000} {incr i} { + execsql { INSERT INTO t1 VALUES($i, $i*$i) } + } + execsql COMMIT +} {} +do_test vtabD-1.3 { + execsql { SELECT * FROM tv1 WHERE a = 1 OR b = 4 } +} {1 1 2 4} +do_test vtabD-1.4 { + execsql { SELECT * FROM tv1 WHERE a = 1 OR b = 1 } +} {1 1} +do_test vtabD-1.5 { + execsql { SELECT * FROM tv1 WHERE (a > 0 AND a < 5) OR (b > 15 AND b < 65) } +} {1 1 2 4 3 9 4 16 5 25 6 36 7 49 8 64} + +do_test vtabD-1.6 { + execsql { SELECT * FROM tv1 WHERE a < 500 OR b = 810000 } +} [execsql { + SELECT * FROM t1 WHERE a < 500 + UNION ALL + SELECT * FROM t1 WHERE b = 810000 AND NOT (a < 500) +}] + +do_test vtabD-1.7 { + execsql { SELECT * FROM tv1 WHERE a < 90000 OR b = 8100000000 } +} [execsql { + SELECT * FROM t1 WHERE a < 90000 + UNION ALL + SELECT * FROM t1 WHERE b = 8100000000 AND NOT (a < 90000) +}] + +if {[working_64bit_int]} { +do_test vtabD-1.8 { + execsql { SELECT * FROM tv1 WHERE a = 90001 OR b = 810000 } +} {90001 8100180001 900 810000} +} + +finish_test + diff --git a/test/where7.test b/test/where7.test index 2a1dd2f..d9c64a7 100644 --- a/test/where7.test +++ b/test/where7.test @@ -11,7 +11,7 @@ # 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 $ +# $Id: where7.test,v 1.8 2009/04/21 09:02:47 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -29,6 +29,11 @@ proc count_steps {sql} { lappend r scan [db status step] sort [db status sort] } +proc count_steps_sort {sql} { + set r [lsort -integer [db eval $sql]] + return "$r scan [db status step] sort [db status sort]" +} + # Build some test data # do_test where7-1.1 { @@ -48,7 +53,7 @@ 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} +} {2 3 scan 0 sort 1} do_test where7-1.3 { count_steps { SELECT a FROM t1 WHERE b=3 OR +c=6 ORDER BY a @@ -63,42 +68,42 @@ 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} +} {2 3 scan 0 sort 1} 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} +} {2 3 scan 0 sort 1} do_test where7-1.7 { count_steps { - SELECT a FROM t1 WHERE (b=3 OR c>10) ORDER BY a + SELECT a FROM t1 WHERE (b=3 OR c>10) } } {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 + SELECT a FROM t1 WHERE (b=3 OR c>=10) } } {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 + SELECT a FROM t1 WHERE (b=3 OR c>=10 OR c=4) } } {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 + SELECT a FROM t1 WHERE (b=3 OR c>=10 OR c=4 OR b>10) } } {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} +} {2 5 scan 0 sort 1} 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} +} {1 2 3 5 scan 0 sort 1} do_test where7-1.13.1 { count_steps { SELECT a FROM t1 WHERE (b BETWEEN 0 AND 2) OR (c BETWEEN 9 AND 999) @@ -130,7 +135,7 @@ do_test where7-1.20 { } append sql " ORDER BY a" count_steps $sql -} {scan 0 sort 0} +} {scan 0 sort 1} 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} { @@ -138,7 +143,7 @@ do_test where7-1.21 { } append sql " ORDER BY a" count_steps $sql -} {5 scan 0 sort 0} +} {5 scan 0 sort 1} 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} { @@ -146,7 +151,7 @@ do_test where7-1.22 { } append sql ") AND d>=0 AND d<9999 ORDER BY a" count_steps $sql -} {5 scan 0 sort 0} +} {5 scan 0 sort 1} 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} { @@ -154,7 +159,7 @@ do_test where7-1.23 { } append sql ") AND d>=0 AND d<9999 ORDER BY a" count_steps $sql -} {5 scan 0 sort 0} +} {5 scan 0 sort 1} do_test where7-1.31 { set sql "SELECT a FROM t1 WHERE (a=11 AND b=11)" @@ -163,7 +168,7 @@ do_test where7-1.31 { } append sql " ORDER BY a" count_steps $sql -} {scan 0 sort 0} +} {scan 0 sort 1} 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} { @@ -171,113 +176,112 @@ do_test where7-1.32 { } append sql " ORDER BY a" count_steps $sql -} {scan 0 sort 0} +} {scan 0 sort 1} + -# 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(3,33,1001,3.0029999999999997,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(5,55,2002,5.004999999999999,200.2,'fghijklmn','xwvutsr'); + INSERT INTO t2 VALUES(6,66,2002,6.005999999999999,200.2,'ghijklmno','xwvutsr'); + INSERT INTO t2 VALUES(7,77,3003,7.007,300.29999999999995,'hijklmnop','xwvutsr'); + INSERT INTO t2 VALUES(8,88,3003,8.008,300.29999999999995,'ijklmnopq','wvutsrq'); + INSERT INTO t2 VALUES(9,99,3003,9.008999999999999,300.29999999999995,'jklmnopqr','wvutsrq'); + INSERT INTO t2 VALUES(10,110,4004,10.009999999999998,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(12,132,4004,12.011999999999999,400.4,'mnopqrstu','wvutsrq'); + INSERT INTO t2 VALUES(13,143,5005,13.012999999999998,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(15,165,5005,15.014999999999999,500.5,'pqrstuvwx','vutsrqp'); + INSERT INTO t2 VALUES(16,176,6006,16.016,600.5999999999999,'qrstuvwxy','vutsrqp'); + INSERT INTO t2 VALUES(17,187,6006,17.017,600.5999999999999,'rstuvwxyz','vutsrqp'); + INSERT INTO t2 VALUES(18,198,6006,18.017999999999997,600.5999999999999,'stuvwxyza','utsrqpo'); + INSERT INTO t2 VALUES(19,209,7007,19.019,700.6999999999999,'tuvwxyzab','utsrqpo'); + INSERT INTO t2 VALUES(20,220,7007,20.019999999999996,700.6999999999999,'uvwxyzabc','utsrqpo'); + INSERT INTO t2 VALUES(21,231,7007,21.020999999999997,700.6999999999999,'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(23,253,8008,23.022999999999996,800.8,'xyzabcdef','tsrqpon'); + INSERT INTO t2 VALUES(24,264,8008,24.023999999999997,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(26,286,9009,26.025999999999996,900.9,'abcdefghi','tsrqpon'); + INSERT INTO t2 VALUES(27,297,9009,27.026999999999997,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(29,319,10010,29.028999999999996,1001.0,'defghijkl','srqponm'); + INSERT INTO t2 VALUES(30,330,10010,30.029999999999998,1001.0,'efghijklm','srqponm'); + INSERT INTO t2 VALUES(31,341,11011,31.030999999999995,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(33,363,11011,33.032999999999994,1101.1,'hijklmnop','rqponml'); + INSERT INTO t2 VALUES(34,374,12012,34.034,1201.1999999999998,'ijklmnopq','rqponml'); + INSERT INTO t2 VALUES(35,385,12012,35.035,1201.1999999999998,'jklmnopqr','rqponml'); + INSERT INTO t2 VALUES(36,396,12012,36.035999999999994,1201.1999999999998,'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(39,429,13013,39.038999999999994,1301.3,'nopqrstuv','qponmlk'); + INSERT INTO t2 VALUES(40,440,14014,40.03999999999999,1401.3999999999999,'opqrstuvw','qponmlk'); + INSERT INTO t2 VALUES(41,451,14014,41.041,1401.3999999999999,'pqrstuvwx','qponmlk'); + INSERT INTO t2 VALUES(42,462,14014,42.041999999999994,1401.3999999999999,'qrstuvwxy','qponmlk'); + INSERT INTO t2 VALUES(43,473,15015,43.04299999999999,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(45,495,15015,45.044999999999995,1501.5,'tuvwxyzab','ponmlkj'); + INSERT INTO t2 VALUES(46,506,16016,46.04599999999999,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(48,528,16016,48.047999999999995,1601.6,'wxyzabcde','onmlkji'); + INSERT INTO t2 VALUES(49,539,17017,49.04899999999999,1701.6999999999998,'xyzabcdef','onmlkji'); + INSERT INTO t2 VALUES(50,550,17017,50.05,1701.6999999999998,'yzabcdefg','onmlkji'); + INSERT INTO t2 VALUES(51,561,17017,51.050999999999995,1701.6999999999998,'zabcdefgh','onmlkji'); + INSERT INTO t2 VALUES(52,572,18018,52.05199999999999,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(54,594,18018,54.053999999999995,1801.8,'cdefghijk','nmlkjih'); + INSERT INTO t2 VALUES(55,605,19019,55.05499999999999,1901.8999999999999,'defghijkl','nmlkjih'); + INSERT INTO t2 VALUES(56,616,19019,56.056,1901.8999999999999,'efghijklm','nmlkjih'); + INSERT INTO t2 VALUES(57,627,19019,57.056999999999995,1901.8999999999999,'fghijklmn','nmlkjih'); + INSERT INTO t2 VALUES(58,638,20020,58.05799999999999,2002.0,'ghijklmno','mlkjihg'); + INSERT INTO t2 VALUES(59,649,20020,59.05899999999999,2002.0,'hijklmnop','mlkjihg'); + INSERT INTO t2 VALUES(60,660,20020,60.059999999999995,2002.0,'ijklmnopq','mlkjihg'); + INSERT INTO t2 VALUES(61,671,21021,61.06099999999999,2102.1,'jklmnopqr','mlkjihg'); + INSERT INTO t2 VALUES(62,682,21021,62.06199999999999,2102.1,'klmnopqrs','mlkjihg'); + INSERT INTO t2 VALUES(63,693,21021,63.062999999999995,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(66,726,22022,66.06599999999999,2202.2,'opqrstuvw','lkjihgf'); + INSERT INTO t2 VALUES(67,737,23023,67.067,2302.2999999999997,'pqrstuvwx','lkjihgf'); + INSERT INTO t2 VALUES(68,748,23023,68.068,2302.2999999999997,'qrstuvwxy','kjihgfe'); + INSERT INTO t2 VALUES(69,759,23023,69.06899999999999,2302.2999999999997,'rstuvwxyz','kjihgfe'); + INSERT INTO t2 VALUES(70,770,24024,70.07,2402.3999999999996,'stuvwxyza','kjihgfe'); + INSERT INTO t2 VALUES(71,781,24024,71.071,2402.3999999999996,'tuvwxyzab','kjihgfe'); + INSERT INTO t2 VALUES(72,792,24024,72.07199999999999,2402.3999999999996,'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(75,825,25025,75.07499999999999,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(78,858,26026,78.07799999999999,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(80,880,27027,80.07999999999998,2702.7,'cdefghijk','ihgfedc'); + INSERT INTO t2 VALUES(81,891,27027,81.08099999999999,2702.7,'defghijkl','ihgfedc'); + INSERT INTO t2 VALUES(82,902,28028,82.082,2802.7999999999997,'efghijklm','ihgfedc'); + INSERT INTO t2 VALUES(83,913,28028,83.08299999999998,2802.7999999999997,'fghijklmn','hgfedcb'); + INSERT INTO t2 VALUES(84,924,28028,84.08399999999999,2802.7999999999997,'ghijklmno','hgfedcb'); + INSERT INTO t2 VALUES(85,935,29029,85.085,2902.8999999999996,'hijklmnop','hgfedcb'); + INSERT INTO t2 VALUES(86,946,29029,86.08599999999998,2902.8999999999996,'ijklmnopq','hgfedcb'); + INSERT INTO t2 VALUES(87,957,29029,87.08699999999999,2902.8999999999996,'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(89,979,30030,89.08899999999998,3003.0,'lmnopqrst','gfedcba'); + INSERT INTO t2 VALUES(90,990,30030,90.08999999999999,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(92,1012,31031,92.09199999999998,3103.1,'opqrstuvw','gfedcba'); + INSERT INTO t2 VALUES(93,1023,31031,93.09299999999999,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'); + INSERT INTO t2 VALUES(95,1045,32032,95.09499999999998,3203.2,'rstuvwxyz','fedcbaz'); + INSERT INTO t2 VALUES(96,1056,32032,96.09599999999999,3203.2,'stuvwxyza','fedcbaz'); + INSERT INTO t2 VALUES(97,1067,33033,97.097,3303.2999999999997,'tuvwxyzab','fedcbaz'); + INSERT INTO t2 VALUES(98,1078,33033,98.09799999999998,3303.2999999999997,'uvwxyzabc','edcbazy'); + INSERT INTO t2 VALUES(99,1089,33033,99.09899999999999,3303.2999999999997,'vwxyzabcd','edcbazy'); + INSERT INTO t2 VALUES(100,1100,34034,100.1,3403.3999999999996,'wxyzabcde','edcbazy'); CREATE INDEX t2b ON t2(b); CREATE INDEX t2c ON t2(c); CREATE INDEX t2d ON t2(d); @@ -294,24704 +298,23013 @@ do_test where7-2.1 { CREATE INDEX t3g ON t3(g,f); } } {} + do_test where7-2.2.1 { - count_steps { + count_steps_sort { 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 + WHERE b=1070 + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') } -} {5 7 62 89 91 93 scan 0 sort 0} +} {6 18 20 32 39 58 84 89 96 100 scan 0 sort 0} do_test where7-2.2.2 { - count_steps { + count_steps_sort { 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 + WHERE b=1070 + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') } -} {5 7 62 89 91 93 scan 0 sort 0} +} {6 18 20 32 39 58 84 89 96 100 scan 0 sort 0} do_test where7-2.3.1 { - count_steps { + count_steps_sort { 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 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR b=220 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR (g='qponmlk' AND f GLOB 'pqrst*') } -} {2 27 47 scan 0 sort 0} +} {20 33 35 41 47 67 69 70 98 scan 0 sort 0} do_test where7-2.3.2 { - count_steps { + count_steps_sort { 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 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR b=220 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR (g='qponmlk' AND f GLOB 'pqrst*') } -} {2 27 47 scan 0 sort 0} +} {20 33 35 41 47 67 69 70 98 scan 0 sort 0} do_test where7-2.4.1 { - count_steps { + count_steps_sort { 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 + WHERE b=190 + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR (g='rqponml' AND f GLOB 'hijkl*') + OR b=407 } -} {10 12 58 59 60 75 scan 0 sort 0} +} {33 37 49 51 scan 0 sort 0} do_test where7-2.4.2 { - count_steps { + count_steps_sort { 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 + WHERE b=190 + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR (g='rqponml' AND f GLOB 'hijkl*') + OR b=407 } -} {10 12 58 59 60 75 scan 0 sort 0} +} {33 37 49 51 scan 0 sort 0} do_test where7-2.5.1 { - count_steps { + count_steps_sort { SELECT a FROM t2 - WHERE f='xyzabcdef' - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=245 - OR a=27 - ORDER BY a + WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=795 + OR b=1103 + OR b=583 } -} {23 27 49 75 96 scan 0 sort 0} +} {13 39 53 65 91 scan 0 sort 0} do_test where7-2.5.2 { - count_steps { + count_steps_sort { SELECT a FROM t3 - WHERE f='xyzabcdef' - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=245 - OR a=27 - ORDER BY a + WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=795 + OR b=1103 + OR b=583 } -} {23 27 49 75 96 scan 0 sort 0} +} {13 39 53 65 91 scan 0 sort 0} do_test where7-2.6.1 { - count_steps { + count_steps_sort { SELECT a FROM t2 - WHERE d>1e10 - OR c=28028 - OR a=40 - ORDER BY a + WHERE a=74 + OR a=50 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR c=21021 + OR ((a BETWEEN 82 AND 84) AND a!=83) } -} {40 82 83 84 scan 0 sort 0} +} {16 18 50 61 62 63 74 82 84 85 scan 0 sort 0} do_test where7-2.6.2 { - count_steps { + count_steps_sort { SELECT a FROM t3 - WHERE d>1e10 - OR c=28028 - OR a=40 - ORDER BY a + WHERE a=74 + OR a=50 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR c=21021 + OR ((a BETWEEN 82 AND 84) AND a!=83) } -} {40 82 83 84 scan 0 sort 0} +} {16 18 50 61 62 63 74 82 84 85 scan 0 sort 0} do_test where7-2.7.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 8 AND 10) AND a!=9) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR c=14014 + OR b=828 } -} {8 10 14 18 31 43 79 80 81 85 86 87 99 scan 0 sort 0} +} {8 10 34 36 40 41 42 94 scan 0 sort 0} do_test where7-2.7.2 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 8 AND 10) AND a!=9) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR c=14014 + OR b=828 } -} {8 10 14 18 31 43 79 80 81 85 86 87 99 scan 0 sort 0} +} {8 10 34 36 40 41 42 94 scan 0 sort 0} do_test where7-2.8.1 { - count_steps { + count_steps_sort { 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 + WHERE 1000000=26.0 AND d<27.0 AND d NOT NULL) - OR b=311 - ORDER BY a + WHERE 1000000=48.0 AND d<49.0 AND d NOT NULL) - ORDER BY a + WHERE b=949 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR a=63 } -} {9 29 48 70 71 72 scan 0 sort 0} +} {22 24 63 scan 0 sort 0} do_test where7-2.9.2 { - count_steps { + count_steps_sort { 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 + WHERE b=949 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR a=63 } -} {9 29 48 70 71 72 scan 0 sort 0} +} {22 24 63 scan 0 sort 0} do_test where7-2.10.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 49 AND 51) AND a!=50) + OR b=396 + OR ((a BETWEEN 68 AND 70) AND a!=69) } -} {4 49 scan 0 sort 0} +} {36 49 51 68 70 scan 0 sort 0} do_test where7-2.10.2 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 49 AND 51) AND a!=50) + OR b=396 + OR ((a BETWEEN 68 AND 70) AND a!=69) } -} {4 49 scan 0 sort 0} +} {36 49 51 68 70 scan 0 sort 0} do_test where7-2.11.1 { - count_steps { + count_steps_sort { SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR b=143 - OR b=209 - ORDER BY a + WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR c=11011 + OR c=20020 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) } -} {13 19 31 scan 0 sort 0} +} {18 31 32 33 58 59 60 72 74 scan 0 sort 0} do_test where7-2.11.2 { - count_steps { + count_steps_sort { SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR b=143 - OR b=209 - ORDER BY a + WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR c=11011 + OR c=20020 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) } -} {13 19 31 scan 0 sort 0} +} {18 31 32 33 58 59 60 72 74 scan 0 sort 0} do_test where7-2.12.1 { - count_steps { + count_steps_sort { 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 + WHERE (d>=50.0 AND d<51.0 AND d NOT NULL) + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR b=792 + OR a=97 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR b=916 + OR a=69 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR c=6006 } -} {38 69 86 scan 0 sort 0} +} {16 17 18 31 50 69 72 81 83 87 97 scan 0 sort 0} do_test where7-2.12.2 { - count_steps { + count_steps_sort { 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 + WHERE (d>=50.0 AND d<51.0 AND d NOT NULL) + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR b=792 + OR a=97 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR b=916 + OR a=69 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR c=6006 } -} {38 69 86 scan 0 sort 0} +} {16 17 18 31 50 69 72 81 83 87 97 scan 0 sort 0} do_test where7-2.13.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 50 AND 52) AND a!=51) + OR c=9009 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=539 + OR b=297 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR b=957 + OR f='xyzabcdef' + OR b=619 } -} {32 56 82 89 91 scan 0 sort 0} +} {10 15 21 23 25 26 27 49 50 52 75 87 scan 0 sort 0} do_test where7-2.13.2 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 50 AND 52) AND a!=51) + OR c=9009 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=539 + OR b=297 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR b=957 + OR f='xyzabcdef' + OR b=619 } -} {32 56 82 89 91 scan 0 sort 0} +} {10 15 21 23 25 26 27 49 50 52 75 87 scan 0 sort 0} do_test where7-2.14.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 47 AND 49) AND a!=48) + OR (d>=48.0 AND d<49.0 AND d NOT NULL) } -} {3 28 31 32 33 37 47 53 56 94 96 scan 0 sort 0} +} {47 48 49 scan 0 sort 0} do_test where7-2.14.2 { - count_steps { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 47 AND 49) AND a!=48) + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + } +} {47 48 49 scan 0 sort 0} +do_test where7-2.15.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=20 + OR a=67 + OR b=58 + OR ((a BETWEEN 19 AND 21) AND a!=20) + } +} {19 20 21 67 scan 0 sort 0} +do_test where7-2.15.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=20 + OR a=67 + OR b=58 + OR ((a BETWEEN 19 AND 21) AND a!=20) + } +} {19 20 21 67 scan 0 sort 0} +do_test where7-2.16.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=938 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {17 67 scan 0 sort 0} +do_test where7-2.16.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=938 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {17 67 scan 0 sort 0} +do_test where7-2.17.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) + OR f='zabcdefgh' + OR b=308 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR b=443 + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR f='uvwxyzabc' + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + } +} {12 14 15 16 17 20 24 25 28 29 46 50 51 68 72 76 77 98 scan 0 sort 0} +do_test where7-2.17.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) + OR f='zabcdefgh' + OR b=308 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR b=443 + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR f='uvwxyzabc' + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + } +} {12 14 15 16 17 20 24 25 28 29 46 50 51 68 72 76 77 98 scan 0 sort 0} +do_test where7-2.18.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=762 + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR a=19 + } +} {19 46 56 scan 0 sort 0} +do_test where7-2.18.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=762 + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR a=19 + } +} {19 46 56 scan 0 sort 0} +do_test where7-2.19.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR a=46 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR a=73 + OR c=20020 + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR b=267 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + } +} {2 4 20 46 58 59 60 63 68 70 73 scan 0 sort 0} +do_test where7-2.19.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR a=46 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR a=73 + OR c=20020 + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR b=267 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + } +} {2 4 20 46 58 59 60 63 68 70 73 scan 0 sort 0} +do_test where7-2.20.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 27 AND 29) AND a!=28) + OR (g='gfedcba' AND f GLOB 'nopqr*') + } +} {27 29 91 scan 0 sort 0} +do_test where7-2.20.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 27 AND 29) AND a!=28) + OR (g='gfedcba' AND f GLOB 'nopqr*') + } +} {27 29 91 scan 0 sort 0} +do_test where7-2.21.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=13013 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR f='bcdefghij' + OR b=586 + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + OR a=9 + } +} {1 6 9 27 37 38 39 53 55 58 59 61 75 79 87 89 98 scan 0 sort 0} +do_test where7-2.21.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=13013 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR f='bcdefghij' + OR b=586 + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + OR a=9 + } +} {1 6 9 27 37 38 39 53 55 58 59 61 75 79 87 89 98 scan 0 sort 0} +do_test where7-2.22.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=399 + OR c=28028 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + } +} {42 82 83 84 98 scan 0 sort 0} +do_test where7-2.22.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=399 + OR c=28028 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + } +} {42 82 83 84 98 scan 0 sort 0} +do_test where7-2.23.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR c=14014 + OR c=33033 + OR a=89 + OR b=770 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR a=35 + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR b=253 + OR c=14014 + } +} {4 19 23 30 35 40 41 42 56 70 82 89 95 96 97 98 99 scan 0 sort 0} +do_test where7-2.23.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR c=14014 + OR c=33033 + OR a=89 + OR b=770 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR a=35 + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR b=253 + OR c=14014 + } +} {4 19 23 30 35 40 41 42 56 70 82 89 95 96 97 98 99 scan 0 sort 0} +do_test where7-2.24.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=330 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR a=16 + } +} {6 16 21 30 32 34 scan 0 sort 0} +do_test where7-2.24.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=330 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR a=16 + } +} {6 16 21 30 32 34 scan 0 sort 0} +do_test where7-2.25.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=5005 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + } +} {2 13 14 15 36 38 47 scan 0 sort 0} +do_test where7-2.25.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=5005 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + } +} {2 13 14 15 36 38 47 scan 0 sort 0} +do_test where7-2.26.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=33 + } +} {30 33 58 64 66 68 scan 0 sort 0} +do_test where7-2.26.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=33 + } +} {30 33 58 64 66 68 scan 0 sort 0} +do_test where7-2.27.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1026 + OR b=410 + } +} { scan 0 sort 0} +do_test where7-2.27.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1026 + OR b=410 + } +} { scan 0 sort 0} +do_test where7-2.28.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=18018 + OR a=94 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=1012 + OR a=3 + OR d>1e10 + OR b=905 + OR b=1089 + } +} {3 15 26 41 52 53 54 67 92 93 94 99 scan 0 sort 0} +do_test where7-2.28.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=18018 + OR a=94 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=1012 + OR a=3 + OR d>1e10 + OR b=905 + OR b=1089 + } +} {3 15 26 41 52 53 54 67 92 93 94 99 scan 0 sort 0} +do_test where7-2.29.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=100 + OR c=11011 + OR b=297 + OR a=63 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR a=76 + OR b=1026 + OR a=26 + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR c=30030 + } +} {24 26 27 31 32 33 50 63 76 84 88 89 90 100 scan 0 sort 0} +do_test where7-2.29.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=100 + OR c=11011 + OR b=297 + OR a=63 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR a=76 + OR b=1026 + OR a=26 + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR c=30030 + } +} {24 26 27 31 32 33 50 63 76 84 88 89 90 100 scan 0 sort 0} +do_test where7-2.30.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=561 + OR b=1070 + OR a=59 + OR b=715 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + } +} {23 49 51 59 65 75 scan 0 sort 0} +do_test where7-2.30.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=561 + OR b=1070 + OR a=59 + OR b=715 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + } +} {23 49 51 59 65 75 scan 0 sort 0} +do_test where7-2.31.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=1056 + OR b=1012 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + } +} {19 26 52 57 59 67 69 78 92 95 96 scan 0 sort 0} +do_test where7-2.31.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=1056 + OR b=1012 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + } +} {19 26 52 57 59 67 69 78 92 95 96 scan 0 sort 0} +do_test where7-2.32.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='rstuvwxyz' + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + } +} {17 43 69 74 90 92 95 98 scan 0 sort 0} +do_test where7-2.32.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='rstuvwxyz' + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + } +} {17 43 69 74 90 92 95 98 scan 0 sort 0} +do_test where7-2.33.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR c=12012 + OR a=18 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + } +} {9 15 17 18 26 34 35 36 41 43 52 61 67 69 76 78 87 93 95 scan 0 sort 0} +do_test where7-2.33.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR c=12012 + OR a=18 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + } +} {9 15 17 18 26 34 35 36 41 43 52 61 67 69 76 78 87 93 95 scan 0 sort 0} +do_test where7-2.34.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=77 + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + } +} {58 77 scan 0 sort 0} +do_test where7-2.34.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=77 + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + } +} {58 77 scan 0 sort 0} +do_test where7-2.35.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=498 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR c=33033 + OR b=11 + OR (g='wvutsrq' AND f GLOB 'lmnop*') + OR ((a BETWEEN 7 AND 9) AND a!=8) + } +} {1 7 9 11 27 67 69 88 97 98 99 scan 0 sort 0} +do_test where7-2.35.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=498 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR c=33033 + OR b=11 + OR (g='wvutsrq' AND f GLOB 'lmnop*') + OR ((a BETWEEN 7 AND 9) AND a!=8) + } +} {1 7 9 11 27 67 69 88 97 98 99 scan 0 sort 0} +do_test where7-2.36.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=6.0 AND d<7.0 AND d NOT NULL) + OR ((a BETWEEN 58 AND 60) AND a!=59) + } +} {6 58 60 scan 0 sort 0} +do_test where7-2.36.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=6.0 AND d<7.0 AND d NOT NULL) + OR ((a BETWEEN 58 AND 60) AND a!=59) + } +} {6 58 60 scan 0 sort 0} +do_test where7-2.37.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1059 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR c=4004 + OR b=806 + } +} {10 11 12 43 scan 0 sort 0} +do_test where7-2.37.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1059 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR c=4004 + OR b=806 + } +} {10 11 12 43 scan 0 sort 0} +do_test where7-2.38.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=165 + OR b=201 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR a=32 + } +} {15 32 99 scan 0 sort 0} +do_test where7-2.38.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=165 + OR b=201 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR a=32 + } +} {15 32 99 scan 0 sort 0} +do_test where7-2.39.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + } +} {22 48 69 74 100 scan 0 sort 0} +do_test where7-2.39.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + } +} {22 48 69 74 100 scan 0 sort 0} +do_test where7-2.40.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=352 + OR b=278 + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=660 + OR a=18 + OR a=34 + OR b=132 + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR c=18018 + } +} {2 12 18 28 30 32 34 52 53 54 60 80 89 90 92 scan 0 sort 0} +do_test where7-2.40.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=352 + OR b=278 + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=660 + OR a=18 + OR a=34 + OR b=132 + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR c=18018 + } +} {2 12 18 28 30 32 34 52 53 54 60 80 89 90 92 scan 0 sort 0} +do_test where7-2.41.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=73.0 AND d<74.0 AND d NOT NULL) + OR ((a BETWEEN 5 AND 7) AND a!=6) + } +} {5 7 73 scan 0 sort 0} +do_test where7-2.41.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=73.0 AND d<74.0 AND d NOT NULL) + OR ((a BETWEEN 5 AND 7) AND a!=6) + } +} {5 7 73 scan 0 sort 0} +do_test where7-2.42.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR b=297 + OR b=113 + OR b=176 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR a=67 + OR c=26026 + } +} {3 14 16 21 27 29 55 67 75 76 77 78 81 83 scan 0 sort 0} +do_test where7-2.42.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR b=297 + OR b=113 + OR b=176 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR a=67 + OR c=26026 + } +} {3 14 16 21 27 29 55 67 75 76 77 78 81 83 scan 0 sort 0} +do_test where7-2.43.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=78.0 AND d<79.0 AND d NOT NULL) + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR a=83 + OR b=44 + OR b=1023 + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR b=1023 + OR f='ijklmnopq' + } +} {4 6 8 11 13 34 60 78 83 86 93 scan 0 sort 0} +do_test where7-2.43.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=78.0 AND d<79.0 AND d NOT NULL) + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR a=83 + OR b=44 + OR b=1023 + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR b=1023 + OR f='ijklmnopq' + } +} {4 6 8 11 13 34 60 78 83 86 93 scan 0 sort 0} +do_test where7-2.44.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) + OR b=935 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=487 + OR b=619 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {17 32 34 39 42 85 scan 0 sort 0} +do_test where7-2.44.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) + OR b=935 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=487 + OR b=619 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {17 32 34 39 42 85 scan 0 sort 0} +do_test where7-2.45.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=938 + OR b=641 + OR c=17017 + OR a=82 + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + } +} {37 39 49 50 51 56 58 65 68 82 94 scan 0 sort 0} +do_test where7-2.45.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=938 + OR b=641 + OR c=17017 + OR a=82 + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + } +} {37 39 49 50 51 56 58 65 68 82 94 scan 0 sort 0} +do_test where7-2.46.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'bcdef*') + OR c=22022 + } +} {64 65 66 79 scan 0 sort 0} +do_test where7-2.46.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'bcdef*') + OR c=22022 + } +} {64 65 66 79 scan 0 sort 0} +do_test where7-2.47.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=7007 + OR b=91 + OR b=212 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR c=28028 + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + } +} {19 20 21 65 82 83 84 scan 0 sort 0} +do_test where7-2.47.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=7007 + OR b=91 + OR b=212 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR c=28028 + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + } +} {19 20 21 65 82 83 84 scan 0 sort 0} +do_test where7-2.48.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR a=51 + OR ((a BETWEEN 28 AND 30) AND a!=29) + } +} {12 28 30 51 scan 0 sort 0} +do_test where7-2.48.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR a=51 + OR ((a BETWEEN 28 AND 30) AND a!=29) + } +} {12 28 30 51 scan 0 sort 0} +do_test where7-2.49.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'mnopq*') + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR ((a BETWEEN 0 AND 2) AND a!=1) + OR c=4004 + OR b=322 + OR c=13013 + OR a=6 + } +} {2 6 9 10 11 12 23 37 38 39 scan 0 sort 0} +do_test where7-2.49.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'mnopq*') + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR ((a BETWEEN 0 AND 2) AND a!=1) + OR c=4004 + OR b=322 + OR c=13013 + OR a=6 + } +} {2 6 9 10 11 12 23 37 38 39 scan 0 sort 0} +do_test where7-2.50.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=297 + OR b=143 + OR a=46 + OR b=660 + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR b=355 + OR a=93 + OR b=297 + } +} {13 17 23 27 41 46 49 60 75 93 scan 0 sort 0} +do_test where7-2.50.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=297 + OR b=143 + OR a=46 + OR b=660 + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR b=355 + OR a=93 + OR b=297 + } +} {13 17 23 27 41 46 49 60 75 93 scan 0 sort 0} +do_test where7-2.51.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=190 + OR a=62 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + } +} {62 99 scan 0 sort 0} +do_test where7-2.51.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=190 + OR a=62 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + } +} {62 99 scan 0 sort 0} +do_test where7-2.52.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1089 + OR b=102 + OR a=6 + OR b=608 + } +} {6 99 scan 0 sort 0} +do_test where7-2.52.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1089 + OR b=102 + OR a=6 + OR b=608 + } +} {6 99 scan 0 sort 0} +do_test where7-2.53.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=473 + OR b=1100 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR a=20 + OR b=1089 + OR b=330 + OR b=124 + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {15 20 30 43 53 56 58 99 100 scan 0 sort 0} +do_test where7-2.53.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=473 + OR b=1100 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR a=20 + OR b=1089 + OR b=330 + OR b=124 + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {15 20 30 43 53 56 58 99 100 scan 0 sort 0} +do_test where7-2.54.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 68 AND 70) AND a!=69) + OR b=223 + OR a=12 + OR b=1048 + OR b=256 + OR a=72 + OR c>=34035 + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=674 + OR a=22 + } +} {12 22 35 68 70 72 scan 0 sort 0} +do_test where7-2.54.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 68 AND 70) AND a!=69) + OR b=223 + OR a=12 + OR b=1048 + OR b=256 + OR a=72 + OR c>=34035 + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=674 + OR a=22 + } +} {12 22 35 68 70 72 scan 0 sort 0} +do_test where7-2.55.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 76 AND 78) AND a!=77) + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='yzabcdefg' + OR c=14014 + OR a=1 + OR a=9 + OR b=960 + } +} {1 9 24 40 41 42 50 76 78 scan 0 sort 0} +do_test where7-2.55.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 76 AND 78) AND a!=77) + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='yzabcdefg' + OR c=14014 + OR a=1 + OR a=9 + OR b=960 + } +} {1 9 24 40 41 42 50 76 78 scan 0 sort 0} +do_test where7-2.56.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (g='onmlkji' AND f GLOB 'xyzab*') + } +} {19 49 96 98 scan 0 sort 0} +do_test where7-2.56.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (g='onmlkji' AND f GLOB 'xyzab*') + } +} {19 49 96 98 scan 0 sort 0} +do_test where7-2.57.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=748 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR b=630 + } +} {9 20 67 68 scan 0 sort 0} +do_test where7-2.57.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=748 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR b=630 + } +} {9 20 67 68 scan 0 sort 0} +do_test where7-2.58.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=223 + OR b=267 + OR a=40 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR c<=10 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR b=528 + } +} {40 48 55 57 69 71 scan 0 sort 0} +do_test where7-2.58.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=223 + OR b=267 + OR a=40 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR c<=10 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR b=528 + } +} {40 48 55 57 69 71 scan 0 sort 0} +do_test where7-2.59.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='rstuvwxyz' + OR a=41 + OR b=462 + OR a=68 + OR a=84 + OR a=69 + } +} {17 41 42 43 68 69 84 95 scan 0 sort 0} +do_test where7-2.59.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='rstuvwxyz' + OR a=41 + OR b=462 + OR a=68 + OR a=84 + OR a=69 + } +} {17 41 42 43 68 69 84 95 scan 0 sort 0} +do_test where7-2.60.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=979 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR (g='vutsrqp' AND f GLOB 'nopqr*') + } +} {3 5 13 89 scan 0 sort 0} +do_test where7-2.60.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=979 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR (g='vutsrqp' AND f GLOB 'nopqr*') + } +} {3 5 13 89 scan 0 sort 0} +do_test where7-2.61.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=9.0 AND d<10.0 AND d NOT NULL) + OR a=8 + OR a=62 + OR b=726 + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {8 9 10 14 50 52 59 61 62 66 scan 0 sort 0} +do_test where7-2.61.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=9.0 AND d<10.0 AND d NOT NULL) + OR a=8 + OR a=62 + OR b=726 + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {8 9 10 14 50 52 59 61 62 66 scan 0 sort 0} +do_test where7-2.62.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=495 + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR b=924 + OR c=11011 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR b=231 + OR b=872 + OR (g='jihgfed' AND f GLOB 'yzabc*') + } +} {18 20 21 31 32 33 45 47 73 76 84 99 scan 0 sort 0} +do_test where7-2.62.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=495 + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR b=924 + OR c=11011 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR b=231 + OR b=872 + OR (g='jihgfed' AND f GLOB 'yzabc*') + } +} {18 20 21 31 32 33 45 47 73 76 84 99 scan 0 sort 0} +do_test where7-2.63.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=24 + OR b=473 + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR b=509 + OR b=924 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + } +} {21 24 43 84 86 96 scan 0 sort 0} +do_test where7-2.63.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=24 + OR b=473 + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR b=509 + OR b=924 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + } +} {21 24 43 84 86 96 scan 0 sort 0} +do_test where7-2.64.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR b=363 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {2 5 8 23 25 28 33 34 54 56 58 60 80 86 93 100 scan 0 sort 0} +do_test where7-2.64.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR b=363 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {2 5 8 23 25 28 33 34 54 56 58 60 80 86 93 100 scan 0 sort 0} +do_test where7-2.65.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=42 + OR e IS NULL + OR b=495 + OR 1000000=65.0 AND d<66.0 AND d NOT NULL) + } +} {20 42 45 46 65 69 72 85 98 scan 0 sort 0} +do_test where7-2.65.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=42 + OR e IS NULL + OR b=495 + OR 1000000=65.0 AND d<66.0 AND d NOT NULL) + } +} {20 42 45 46 65 69 72 85 98 scan 0 sort 0} +do_test where7-2.66.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=17017 + OR f='ijklmnopq' + OR a=39 + } +} {8 34 39 49 50 51 60 86 scan 0 sort 0} +do_test where7-2.66.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=17017 + OR f='ijklmnopq' + OR a=39 + } +} {8 34 39 49 50 51 60 86 scan 0 sort 0} +do_test where7-2.67.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c>=34035 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=91 + } +} {11 19 27 37 63 89 91 96 98 100 scan 0 sort 0} +do_test where7-2.67.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c>=34035 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=91 + } +} {11 19 27 37 63 89 91 96 98 100 scan 0 sort 0} +do_test where7-2.68.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='gfedcba' AND f GLOB 'nopqr*') + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR b=649 + OR b=231 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR b=58 + } +} {9 21 28 29 35 48 59 61 87 91 scan 0 sort 0} +do_test where7-2.68.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='gfedcba' AND f GLOB 'nopqr*') + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR b=649 + OR b=231 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR b=58 + } +} {9 21 28 29 35 48 59 61 87 91 scan 0 sort 0} +do_test where7-2.69.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=979 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + } +} {78 89 scan 0 sort 0} +do_test where7-2.69.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=979 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + } +} {78 89 scan 0 sort 0} +do_test where7-2.70.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=825 + OR b=1004 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {56 58 60 62 75 scan 0 sort 0} +do_test where7-2.70.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=825 + OR b=1004 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {56 58 60 62 75 scan 0 sort 0} +do_test where7-2.71.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=65 + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR c=22022 + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR b=671 + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR a=91 + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR b=1004 + OR b=960 + } +} {5 31 47 49 51 57 61 64 65 66 83 91 98 scan 0 sort 0} +do_test where7-2.71.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=65 + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR c=22022 + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR b=671 + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR a=91 + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR b=1004 + OR b=960 + } +} {5 31 47 49 51 57 61 64 65 66 83 91 98 scan 0 sort 0} +do_test where7-2.72.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=762 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {56 58 93 scan 0 sort 0} +do_test where7-2.72.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=762 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {56 58 93 scan 0 sort 0} +do_test where7-2.73.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=11.0 AND d<12.0 AND d NOT NULL) + OR a=14 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR b=212 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + } +} {11 14 23 54 78 85 scan 0 sort 0} +do_test where7-2.73.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=11.0 AND d<12.0 AND d NOT NULL) + OR a=14 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR b=212 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + } +} {11 14 23 54 78 85 scan 0 sort 0} +do_test where7-2.74.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'bcdef*') + OR b=168 + OR b=25 + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {66 79 89 scan 0 sort 0} +do_test where7-2.74.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'bcdef*') + OR b=168 + OR b=25 + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {66 79 89 scan 0 sort 0} +do_test where7-2.75.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=28028 + OR f='jklmnopqr' + OR b=1015 + } +} {9 35 61 82 83 84 87 scan 0 sort 0} +do_test where7-2.75.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=28028 + OR f='jklmnopqr' + OR b=1015 + } +} {9 35 61 82 83 84 87 scan 0 sort 0} +do_test where7-2.76.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=31031 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR a=49 + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'klmno*') + } +} {15 41 49 56 62 67 87 89 91 92 93 100 scan 0 sort 0} +do_test where7-2.76.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=31031 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR a=49 + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'klmno*') + } +} {15 41 49 56 62 67 87 89 91 92 93 100 scan 0 sort 0} +do_test where7-2.77.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=80 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR b=971 + OR a=60 + } +} {4 6 25 29 60 80 scan 0 sort 0} +do_test where7-2.77.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=80 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR b=971 + OR a=60 + } +} {4 6 25 29 60 80 scan 0 sort 0} +do_test where7-2.78.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=85.0 AND d<86.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR b=1089 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {30 32 43 85 89 99 scan 0 sort 0} +do_test where7-2.78.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=85.0 AND d<86.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR b=1089 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {30 32 43 85 89 99 scan 0 sort 0} +do_test where7-2.79.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=399 + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR a=10 + OR b=1026 + } +} {9 10 11 57 90 scan 0 sort 0} +do_test where7-2.79.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=399 + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR a=10 + OR b=1026 + } +} {9 10 11 57 90 scan 0 sort 0} +do_test where7-2.80.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'yzabc*') + OR b=465 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {5 43 65 76 scan 0 sort 0} +do_test where7-2.80.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'yzabc*') + OR b=465 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {5 43 65 76 scan 0 sort 0} +do_test where7-2.81.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=25 + OR b=792 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + } +} {19 25 45 71 72 97 scan 0 sort 0} +do_test where7-2.81.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=25 + OR b=792 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + } +} {19 25 45 71 72 97 scan 0 sort 0} +do_test where7-2.82.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=979 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR a=13 + OR a=15 + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR a=27 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR a=32 + OR a=39 + } +} {6 8 13 15 21 27 32 39 67 89 98 100 scan 0 sort 0} +do_test where7-2.82.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=979 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR a=13 + OR a=15 + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR a=27 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR a=32 + OR a=39 + } +} {6 8 13 15 21 27 32 39 67 89 98 100 scan 0 sort 0} +do_test where7-2.83.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='hijklmnop' + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR b=528 + OR c=30030 + OR (g='qponmlk' AND f GLOB 'qrstu*') + } +} {1 7 21 31 33 42 48 58 59 77 79 85 88 89 90 scan 0 sort 0} +do_test where7-2.83.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='hijklmnop' + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR b=528 + OR c=30030 + OR (g='qponmlk' AND f GLOB 'qrstu*') + } +} {1 7 21 31 33 42 48 58 59 77 79 85 88 89 90 scan 0 sort 0} +do_test where7-2.84.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=69 + OR e IS NULL + OR b=352 + OR 1000000=16.0 AND d<17.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR c=33033 + } +} {1 2 3 8 9 14 16 78 85 86 97 98 99 scan 0 sort 0} +do_test where7-2.87.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 14 AND 16) AND a!=15) + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR c=1001 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR c=33033 + } +} {1 2 3 8 9 14 16 78 85 86 97 98 99 scan 0 sort 0} +do_test where7-2.88.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=311 + OR b=1103 + OR b=88 + } +} {8 scan 0 sort 0} +do_test where7-2.88.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=311 + OR b=1103 + OR b=88 + } +} {8 scan 0 sort 0} +do_test where7-2.89.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 65 AND 67) AND a!=66) + OR ((a BETWEEN 26 AND 28) AND a!=27) + OR c=5005 + OR b=1045 + OR c=8008 + OR f='bcdefghij' + } +} {1 13 14 15 22 23 24 26 27 28 53 65 67 79 95 scan 0 sort 0} +do_test where7-2.89.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 65 AND 67) AND a!=66) + OR ((a BETWEEN 26 AND 28) AND a!=27) + OR c=5005 + OR b=1045 + OR c=8008 + OR f='bcdefghij' + } +} {1 13 14 15 22 23 24 26 27 28 53 65 67 79 95 scan 0 sort 0} +do_test where7-2.90.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=66 + OR b=553 + OR a=64 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR a=62 + OR b=1081 + OR b=770 + OR b=762 + OR b=803 + OR (g='srqponm' AND f GLOB 'efghi*') + } +} {6 17 30 62 64 70 73 93 scan 0 sort 0} +do_test where7-2.90.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=66 + OR b=553 + OR a=64 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR a=62 + OR b=1081 + OR b=770 + OR b=762 + OR b=803 + OR (g='srqponm' AND f GLOB 'efghi*') + } +} {6 17 30 62 64 70 73 93 scan 0 sort 0} +do_test where7-2.91.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'klmno*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR c=17017 + OR b=168 + OR ((a BETWEEN 77 AND 79) AND a!=78) + } +} {10 19 45 49 50 51 71 77 79 97 scan 0 sort 0} +do_test where7-2.91.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'klmno*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR c=17017 + OR b=168 + OR ((a BETWEEN 77 AND 79) AND a!=78) + } +} {10 19 45 49 50 51 71 77 79 97 scan 0 sort 0} +do_test where7-2.92.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=34034 + OR (d>=68.0 AND d<69.0 AND d NOT NULL) + OR a=44 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR c=31031 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR b=619 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + OR ((a BETWEEN 29 AND 31) AND a!=30) + } +} {3 12 23 29 31 44 55 68 78 81 91 92 93 100 scan 0 sort 0} +do_test where7-2.92.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=34034 + OR (d>=68.0 AND d<69.0 AND d NOT NULL) + OR a=44 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR c=31031 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR b=619 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + OR ((a BETWEEN 29 AND 31) AND a!=30) + } +} {3 12 23 29 31 44 55 68 78 81 91 92 93 100 scan 0 sort 0} +do_test where7-2.93.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=48 + OR c=15015 + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=110 + OR f='klmnopqrs' + OR (g='fedcbaz' AND f GLOB 'qrstu*') + OR (g='onmlkji' AND f GLOB 'abcde*') + OR b=674 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + } +} {10 36 43 44 45 48 52 62 65 67 88 94 96 97 99 scan 0 sort 0} +do_test where7-2.93.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=48 + OR c=15015 + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=110 + OR f='klmnopqrs' + OR (g='fedcbaz' AND f GLOB 'qrstu*') + OR (g='onmlkji' AND f GLOB 'abcde*') + OR b=674 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + } +} {10 36 43 44 45 48 52 62 65 67 88 94 96 97 99 scan 0 sort 0} +do_test where7-2.94.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=72 + OR b=913 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=121 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + } +} {2 11 28 72 83 scan 0 sort 0} +do_test where7-2.94.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=72 + OR b=913 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=121 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + } +} {2 11 28 72 83 scan 0 sort 0} +do_test where7-2.95.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=18 + OR b=286 + OR b=1015 + OR a=49 + OR b=264 + } +} {18 24 26 49 scan 0 sort 0} +do_test where7-2.95.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=18 + OR b=286 + OR b=1015 + OR a=49 + OR b=264 + } +} {18 24 26 49 scan 0 sort 0} +do_test where7-2.96.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=69 + OR a=11 + OR c=1001 + OR ((a BETWEEN 54 AND 56) AND a!=55) + OR a=57 + OR ((a BETWEEN 48 AND 50) AND a!=49) + } +} {1 2 3 11 48 50 54 56 57 scan 0 sort 0} +do_test where7-2.96.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=69 + OR a=11 + OR c=1001 + OR ((a BETWEEN 54 AND 56) AND a!=55) + OR a=57 + OR ((a BETWEEN 48 AND 50) AND a!=49) + } +} {1 2 3 11 48 50 54 56 57 scan 0 sort 0} +do_test where7-2.97.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=231 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + } +} {21 84 scan 0 sort 0} +do_test where7-2.97.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=231 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + } +} {21 84 scan 0 sort 0} +do_test where7-2.98.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=25 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR b=289 + OR ((a BETWEEN 85 AND 87) AND a!=86) + } +} {3 5 17 23 81 83 85 87 scan 0 sort 0} +do_test where7-2.98.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=25 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR b=289 + OR ((a BETWEEN 85 AND 87) AND a!=86) + } +} {3 5 17 23 81 83 85 87 scan 0 sort 0} +do_test where7-2.99.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='defghijkl' + OR b=465 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR c=9009 + OR b=990 + OR b=132 + OR a=35 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR a=81 + OR ((a BETWEEN 71 AND 73) AND a!=72) + } +} {3 12 25 26 27 29 35 46 55 71 73 78 81 90 scan 0 sort 0} +do_test where7-2.99.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='defghijkl' + OR b=465 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR c=9009 + OR b=990 + OR b=132 + OR a=35 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR a=81 + OR ((a BETWEEN 71 AND 73) AND a!=72) + } +} {3 12 25 26 27 29 35 46 55 71 73 78 81 90 scan 0 sort 0} +do_test where7-2.100.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=26026 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR f='lmnopqrst' + OR a=6 + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {6 9 11 37 59 61 63 76 77 78 89 scan 0 sort 0} +do_test where7-2.100.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=26026 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR f='lmnopqrst' + OR a=6 + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {6 9 11 37 59 61 63 76 77 78 89 scan 0 sort 0} +do_test where7-2.101.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 98 AND 100) AND a!=99) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + } +} {7 98 100 scan 0 sort 0} +do_test where7-2.101.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 98 AND 100) AND a!=99) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + } +} {7 98 100 scan 0 sort 0} +do_test where7-2.102.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=11011 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=630 + OR c=19019 + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR a=24 + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + } +} {24 31 32 33 51 53 55 56 57 89 95 scan 0 sort 0} +do_test where7-2.102.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=11011 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=630 + OR c=19019 + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR a=24 + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + } +} {24 31 32 33 51 53 55 56 57 89 95 scan 0 sort 0} +do_test where7-2.103.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 91 AND 93) AND a!=92) + OR b=993 + OR a=81 + OR b=366 + OR b=69 + } +} {81 91 93 scan 0 sort 0} +do_test where7-2.103.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 91 AND 93) AND a!=92) + OR b=993 + OR a=81 + OR b=366 + OR b=69 + } +} {81 91 93 scan 0 sort 0} +do_test where7-2.104.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='stuvwxyza' + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR ((a BETWEEN 1 AND 3) AND a!=2) + OR b=1037 + OR f='zabcdefgh' + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {1 3 18 24 25 44 50 51 70 76 77 90 96 scan 0 sort 0} +do_test where7-2.104.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='stuvwxyza' + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR ((a BETWEEN 1 AND 3) AND a!=2) + OR b=1037 + OR f='zabcdefgh' + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {1 3 18 24 25 44 50 51 70 76 77 90 96 scan 0 sort 0} +do_test where7-2.105.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR ((a BETWEEN 30 AND 32) AND a!=31) + } +} {4 6 30 32 scan 0 sort 0} +do_test where7-2.105.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR ((a BETWEEN 30 AND 32) AND a!=31) + } +} {4 6 30 32 scan 0 sort 0} +do_test where7-2.106.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=847 + OR b=190 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR ((a BETWEEN 70 AND 72) AND a!=71) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR b=704 + } +} {9 23 35 38 40 61 64 70 72 77 87 scan 0 sort 0} +do_test where7-2.106.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=847 + OR b=190 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR ((a BETWEEN 70 AND 72) AND a!=71) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR b=704 + } +} {9 23 35 38 40 61 64 70 72 77 87 scan 0 sort 0} +do_test where7-2.107.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=88 + OR f='vwxyzabcd' + OR f='fghijklmn' + OR (g='gfedcba' AND f GLOB 'lmnop*') + } +} {5 8 21 31 47 57 73 83 89 99 scan 0 sort 0} +do_test where7-2.107.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=88 + OR f='vwxyzabcd' + OR f='fghijklmn' + OR (g='gfedcba' AND f GLOB 'lmnop*') + } +} {5 8 21 31 47 57 73 83 89 99 scan 0 sort 0} +do_test where7-2.108.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=498 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR a=1 + } +} {1 69 scan 0 sort 0} +do_test where7-2.108.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=498 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR a=1 + } +} {1 69 scan 0 sort 0} +do_test where7-2.109.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 47 AND 49) AND a!=48) + OR a=5 + OR b=179 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR a=69 + } +} {5 17 43 47 49 69 95 scan 0 sort 0} +do_test where7-2.109.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 47 AND 49) AND a!=48) + OR a=5 + OR b=179 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR a=69 + } +} {5 17 43 47 49 69 95 scan 0 sort 0} +do_test where7-2.110.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=971 + OR (g='xwvutsr' AND f GLOB 'hijkl*') + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR b=828 + OR a=81 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR b=627 + OR b=355 + OR b=377 + OR a=44 + } +} {1 7 23 25 44 57 81 scan 0 sort 0} +do_test where7-2.110.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=971 + OR (g='xwvutsr' AND f GLOB 'hijkl*') + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR b=828 + OR a=81 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR b=627 + OR b=355 + OR b=377 + OR a=44 + } +} {1 7 23 25 44 57 81 scan 0 sort 0} +do_test where7-2.111.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=850 + OR ((a BETWEEN 6 AND 8) AND a!=7) + } +} {6 8 scan 0 sort 0} +do_test where7-2.111.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=850 + OR ((a BETWEEN 6 AND 8) AND a!=7) + } +} {6 8 scan 0 sort 0} +do_test where7-2.112.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='lkjihgf' AND f GLOB 'opqrs*') + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + } +} {17 43 66 69 95 scan 0 sort 0} +do_test where7-2.112.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='lkjihgf' AND f GLOB 'opqrs*') + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + } +} {17 43 66 69 95 scan 0 sort 0} +do_test where7-2.113.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=726 + OR b=740 + OR a=33 + OR c=8008 + OR f='rstuvwxyz' + OR b=168 + } +} {17 22 23 24 33 43 66 69 95 scan 0 sort 0} +do_test where7-2.113.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=726 + OR b=740 + OR a=33 + OR c=8008 + OR f='rstuvwxyz' + OR b=168 + } +} {17 22 23 24 33 43 66 69 95 scan 0 sort 0} +do_test where7-2.114.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='vutsrqp' AND f GLOB 'rstuv*') + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=396 + } +} {17 19 36 scan 0 sort 0} +do_test where7-2.114.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='vutsrqp' AND f GLOB 'rstuv*') + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=396 + } +} {17 19 36 scan 0 sort 0} +do_test where7-2.115.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=77 + OR ((a BETWEEN 48 AND 50) AND a!=49) + OR c<=10 + OR ((a BETWEEN 5 AND 7) AND a!=6) + } +} {5 7 48 50 77 scan 0 sort 0} +do_test where7-2.115.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=77 + OR ((a BETWEEN 48 AND 50) AND a!=49) + OR c<=10 + OR ((a BETWEEN 5 AND 7) AND a!=6) + } +} {5 7 48 50 77 scan 0 sort 0} +do_test where7-2.116.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 12 AND 14) AND a!=13) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=253 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=396 + OR b=630 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR c=3003 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + } +} {1 7 8 9 12 13 14 15 20 22 23 27 36 49 53 79 scan 0 sort 0} +do_test where7-2.116.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 12 AND 14) AND a!=13) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=253 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=396 + OR b=630 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR c=3003 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + } +} {1 7 8 9 12 13 14 15 20 22 23 27 36 49 53 79 scan 0 sort 0} +do_test where7-2.117.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=957 + OR b=242 + OR b=113 + OR b=957 + OR b=311 + OR b=143 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + } +} {9 10 13 22 35 48 61 87 scan 0 sort 0} +do_test where7-2.117.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=957 + OR b=242 + OR b=113 + OR b=957 + OR b=311 + OR b=143 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + } +} {9 10 13 22 35 48 61 87 scan 0 sort 0} +do_test where7-2.118.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 74 AND 76) AND a!=75) + OR ((a BETWEEN 94 AND 96) AND a!=95) + OR b=451 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {41 66 74 76 94 96 scan 0 sort 0} +do_test where7-2.118.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 74 AND 76) AND a!=75) + OR ((a BETWEEN 94 AND 96) AND a!=95) + OR b=451 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {41 66 74 76 94 96 scan 0 sort 0} +do_test where7-2.119.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) + OR b=451 + OR b=363 + OR b=330 + OR (g='srqponm' AND f GLOB 'efghi*') + OR ((a BETWEEN 52 AND 54) AND a!=53) + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR (g='gfedcba' AND f GLOB 'lmnop*') + } +} {3 30 33 41 52 54 81 83 89 scan 0 sort 0} +do_test where7-2.119.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) + OR b=451 + OR b=363 + OR b=330 + OR (g='srqponm' AND f GLOB 'efghi*') + OR ((a BETWEEN 52 AND 54) AND a!=53) + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR (g='gfedcba' AND f GLOB 'lmnop*') + } +} {3 30 33 41 52 54 81 83 89 scan 0 sort 0} +do_test where7-2.120.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR (d>=68.0 AND d<69.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR e IS NULL + OR b=759 + } +} {15 68 69 95 scan 0 sort 0} +do_test where7-2.120.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR (d>=68.0 AND d<69.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR e IS NULL + OR b=759 + } +} {15 68 69 95 scan 0 sort 0} +do_test where7-2.121.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR (g='jihgfed' AND f GLOB 'wxyza*') + } +} {19 21 45 71 74 97 scan 0 sort 0} +do_test where7-2.121.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR (g='jihgfed' AND f GLOB 'wxyza*') + } +} {19 21 45 71 74 97 scan 0 sort 0} +do_test where7-2.122.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1037 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR ((a BETWEEN 43 AND 45) AND a!=44) + 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 ((a BETWEEN 75 AND 77) AND a!=76) + } +} {27 43 45 47 75 77 82 scan 0 sort 0} +do_test where7-2.122.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1037 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR ((a BETWEEN 43 AND 45) AND a!=44) + 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 ((a BETWEEN 75 AND 77) AND a!=76) + } +} {27 43 45 47 75 77 82 scan 0 sort 0} +do_test where7-2.123.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1045 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR c=12012 + } +} {34 35 36 37 38 39 95 scan 0 sort 0} +do_test where7-2.123.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1045 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR c=12012 + } +} {34 35 36 37 38 39 95 scan 0 sort 0} +do_test where7-2.124.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') + OR b=421 + OR b=429 + OR b=498 + OR b=33 + OR b=198 + OR c=14014 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + } +} {3 18 23 39 40 41 42 49 75 97 scan 0 sort 0} +do_test where7-2.124.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') + OR b=421 + OR b=429 + OR b=498 + OR b=33 + OR b=198 + OR c=14014 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + } +} {3 18 23 39 40 41 42 49 75 97 scan 0 sort 0} +do_test where7-2.125.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=47 + OR c=31031 + OR a=38 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (g='srqponm' AND f GLOB 'fghij*') + OR b=242 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR b=352 + OR a=49 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {8 22 31 32 34 38 49 57 60 70 86 91 92 93 scan 0 sort 0} +do_test where7-2.125.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=47 + OR c=31031 + OR a=38 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (g='srqponm' AND f GLOB 'fghij*') + OR b=242 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR b=352 + OR a=49 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {8 22 31 32 34 38 49 57 60 70 86 91 92 93 scan 0 sort 0} +do_test where7-2.126.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=704 + OR a=7 + OR a=8 + OR a=46 + OR b=740 + OR b=993 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + } +} {7 8 38 46 64 87 scan 0 sort 0} +do_test where7-2.126.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=704 + OR a=7 + OR a=8 + OR a=46 + OR b=740 + OR b=993 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + } +} {7 8 38 46 64 87 scan 0 sort 0} +do_test where7-2.127.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 62 AND 64) AND a!=63) + OR c=32032 + OR a=76 + } +} {62 64 76 94 95 96 scan 0 sort 0} +do_test where7-2.127.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 62 AND 64) AND a!=63) + OR c=32032 + OR a=76 + } +} {62 64 76 94 95 96 scan 0 sort 0} +do_test where7-2.128.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=528 + OR (g='gfedcba' AND f GLOB 'nopqr*') + } +} {19 48 91 scan 0 sort 0} +do_test where7-2.128.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=528 + OR (g='gfedcba' AND f GLOB 'nopqr*') + } +} {19 48 91 scan 0 sort 0} +do_test where7-2.129.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR a=65 + } +} {26 65 97 scan 0 sort 0} +do_test where7-2.129.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR a=65 + } +} {26 65 97 scan 0 sort 0} +do_test where7-2.130.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=71.0 AND d<72.0 AND d NOT NULL) + OR 1000000=50.0 AND d<51.0 AND d NOT NULL) + OR a=24 + } +} {2 24 50 71 scan 0 sort 0} +do_test where7-2.130.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=71.0 AND d<72.0 AND d NOT NULL) + OR 1000000=50.0 AND d<51.0 AND d NOT NULL) + OR a=24 + } +} {2 24 50 71 scan 0 sort 0} +do_test where7-2.131.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=60 + OR a=39 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=36 + OR b=814 + OR a=14 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR b=440 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + } +} {5 14 25 39 40 51 60 61 74 77 93 95 scan 0 sort 0} +do_test where7-2.131.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=60 + OR a=39 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=36 + OR b=814 + OR a=14 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR b=440 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + } +} {5 14 25 39 40 51 60 61 74 77 93 95 scan 0 sort 0} +do_test where7-2.132.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f IS NULL + OR ((a BETWEEN 39 AND 41) AND a!=40) + } +} {39 41 scan 0 sort 0} +do_test where7-2.132.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f IS NULL + OR ((a BETWEEN 39 AND 41) AND a!=40) + } +} {39 41 scan 0 sort 0} +do_test where7-2.133.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=44 + OR ((a BETWEEN 17 AND 19) AND a!=18) + } +} {4 17 19 scan 0 sort 0} +do_test where7-2.133.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=44 + OR ((a BETWEEN 17 AND 19) AND a!=18) + } +} {4 17 19 scan 0 sort 0} +do_test where7-2.134.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) + OR a=82 + } +} {80 82 scan 0 sort 0} +do_test where7-2.134.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) + OR a=82 + } +} {80 82 scan 0 sort 0} +do_test where7-2.135.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR c=24024 + OR b=946 + OR a=19 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + } +} {19 47 70 71 72 84 86 scan 0 sort 0} +do_test where7-2.135.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR c=24024 + OR b=946 + OR a=19 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + } +} {19 47 70 71 72 84 86 scan 0 sort 0} +do_test where7-2.136.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=27 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=1045 + OR a=84 + OR f='qrstuvwxy' + } +} {16 19 27 42 45 68 71 82 84 89 91 94 95 97 scan 0 sort 0} +do_test where7-2.136.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=27 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=1045 + OR a=84 + OR f='qrstuvwxy' + } +} {16 19 27 42 45 68 71 82 84 89 91 94 95 97 scan 0 sort 0} +do_test where7-2.137.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=704 + OR b=949 + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR c=24024 + OR b=553 + OR a=18 + OR a=92 + } +} {18 22 64 70 71 72 92 scan 0 sort 0} +do_test where7-2.137.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=704 + OR b=949 + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR c=24024 + OR b=553 + OR a=18 + OR a=92 + } +} {18 22 64 70 71 72 92 scan 0 sort 0} +do_test where7-2.138.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=902 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR b=25 + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR f='zabcdefgh' + OR b=385 + } +} {1 16 18 25 27 35 51 53 61 77 79 82 scan 0 sort 0} +do_test where7-2.138.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=902 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR b=25 + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR f='zabcdefgh' + OR b=385 + } +} {1 16 18 25 27 35 51 53 61 77 79 82 scan 0 sort 0} +do_test where7-2.139.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=22 + OR b=36 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR ((a BETWEEN 81 AND 83) AND a!=82) + } +} {22 31 57 59 81 83 scan 0 sort 0} +do_test where7-2.139.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=22 + OR b=36 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR ((a BETWEEN 81 AND 83) AND a!=82) + } +} {22 31 57 59 81 83 scan 0 sort 0} +do_test where7-2.140.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=253 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + } +} {23 60 scan 0 sort 0} +do_test where7-2.140.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=253 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + } +} {23 60 scan 0 sort 0} +do_test where7-2.141.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=641 + OR ((a BETWEEN 36 AND 38) AND a!=37) + } +} {1 15 27 36 38 41 53 67 79 93 scan 0 sort 0} +do_test where7-2.141.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=641 + OR ((a BETWEEN 36 AND 38) AND a!=37) + } +} {1 15 27 36 38 41 53 67 79 93 scan 0 sort 0} +do_test where7-2.142.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=30030 + OR a=18 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=11 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR a=52 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR a=13 + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + } +} {1 13 18 22 40 44 46 52 65 88 89 90 scan 0 sort 0} +do_test where7-2.142.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=30030 + OR a=18 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=11 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR a=52 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR a=13 + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + } +} {1 13 18 22 40 44 46 52 65 88 89 90 scan 0 sort 0} +do_test where7-2.143.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=23023 + OR f='efghijklm' + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=1045 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='uvwxyzabc' + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + } +} {4 20 24 30 39 41 46 50 56 67 68 69 72 76 82 95 98 scan 0 sort 0} +do_test where7-2.143.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=23023 + OR f='efghijklm' + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=1045 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='uvwxyzabc' + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + } +} {4 20 24 30 39 41 46 50 56 67 68 69 72 76 82 95 98 scan 0 sort 0} +do_test where7-2.144.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=476 + OR a=11 + OR a=52 + OR b=858 + OR b=264 + OR f='wxyzabcde' + OR c=18018 + OR b=597 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + } +} {11 22 24 48 52 53 54 69 74 78 100 scan 0 sort 0} +do_test where7-2.144.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=476 + OR a=11 + OR a=52 + OR b=858 + OR b=264 + OR f='wxyzabcde' + OR c=18018 + OR b=597 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + } +} {11 22 24 48 52 53 54 69 74 78 100 scan 0 sort 0} +do_test where7-2.145.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=91 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR b=102 + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR b=784 + } +} {12 21 22 36 59 61 85 89 91 scan 0 sort 0} +do_test where7-2.145.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=91 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR b=102 + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR b=784 + } +} {12 21 22 36 59 61 85 89 91 scan 0 sort 0} +do_test where7-2.146.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='vutsrqp' AND f GLOB 'opqrs*') + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR b=990 + OR a=52 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + } +} {14 38 52 90 91 scan 0 sort 0} +do_test where7-2.146.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='vutsrqp' AND f GLOB 'opqrs*') + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR b=990 + OR a=52 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + } +} {14 38 52 90 91 scan 0 sort 0} +do_test where7-2.147.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=22022 + OR b=960 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR a=48 + OR b=729 + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR a=44 + OR b=773 + } +} {41 43 44 45 48 64 65 66 scan 0 sort 0} +do_test where7-2.147.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=22022 + OR b=960 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR a=48 + OR b=729 + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR a=44 + OR b=773 + } +} {41 43 44 45 48 64 65 66 scan 0 sort 0} +do_test where7-2.148.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 68 AND 70) AND a!=69) + OR b=421 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR c=22022 + OR b=825 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + } +} {2 6 17 19 22 24 29 32 58 64 65 66 68 70 75 84 89 scan 0 sort 0} +do_test where7-2.148.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 68 AND 70) AND a!=69) + OR b=421 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR c=22022 + OR b=825 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + } +} {2 6 17 19 22 24 29 32 58 64 65 66 68 70 75 84 89 scan 0 sort 0} +do_test where7-2.149.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=484 + OR b=1026 + OR a=90 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=608 + OR a=32 + } +} {32 44 74 90 scan 0 sort 0} +do_test where7-2.149.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=484 + OR b=1026 + OR a=90 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=608 + OR a=32 + } +} {32 44 74 90 scan 0 sort 0} +do_test where7-2.150.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c<=10 + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR b=154 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=880 + OR a=55 + OR b=773 + OR b=319 + OR (g='hgfedcb' AND f GLOB 'fghij*') + } +} {14 29 55 76 77 80 83 scan 0 sort 0} +do_test where7-2.150.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c<=10 + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR b=154 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=880 + OR a=55 + OR b=773 + OR b=319 + OR (g='hgfedcb' AND f GLOB 'fghij*') + } +} {14 29 55 76 77 80 83 scan 0 sort 0} +do_test where7-2.151.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'ijklm*') + OR f='mnopqrstu' + OR a=62 + } +} {8 12 38 62 64 90 scan 0 sort 0} +do_test where7-2.151.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'ijklm*') + OR f='mnopqrstu' + OR a=62 + } +} {8 12 38 62 64 90 scan 0 sort 0} +do_test where7-2.152.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=33 + OR b=1045 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR c=13013 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR b=124 + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {33 37 38 39 40 88 90 95 scan 0 sort 0} +do_test where7-2.152.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=33 + OR b=1045 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR c=13013 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR b=124 + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {33 37 38 39 40 88 90 95 scan 0 sort 0} +do_test where7-2.153.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=883 + OR c=32032 + OR f='fghijklmn' + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=421 + OR b=803 + OR c=4004 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + } +} {2 5 10 11 12 28 31 49 51 54 57 73 80 83 94 95 96 scan 0 sort 0} +do_test where7-2.153.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=883 + OR c=32032 + OR f='fghijklmn' + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=421 + OR b=803 + OR c=4004 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + } +} {2 5 10 11 12 28 31 49 51 54 57 73 80 83 94 95 96 scan 0 sort 0} +do_test where7-2.154.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR b=99 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {9 16 42 68 72 94 scan 0 sort 0} +do_test where7-2.154.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR b=99 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {9 16 42 68 72 94 scan 0 sort 0} +do_test where7-2.155.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='defghijkl' + OR b=308 + } +} {3 28 29 55 81 scan 0 sort 0} +do_test where7-2.155.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='defghijkl' + OR b=308 + } +} {3 28 29 55 81 scan 0 sort 0} +do_test where7-2.156.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=795 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR f='jklmnopqr' + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=1056 + } +} {2 9 28 35 51 54 61 80 87 96 scan 0 sort 0} +do_test where7-2.156.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=795 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR f='jklmnopqr' + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=1056 + } +} {2 9 28 35 51 54 61 80 87 96 scan 0 sort 0} +do_test where7-2.157.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=47 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=410 + OR b=682 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR f='hijklmnop' + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=168 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR a=32 + OR a=72 + } +} {7 32 33 40 47 51 59 62 72 85 94 98 100 scan 0 sort 0} +do_test where7-2.157.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=47 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=410 + OR b=682 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR f='hijklmnop' + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=168 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR a=32 + OR a=72 + } +} {7 32 33 40 47 51 59 62 72 85 94 98 100 scan 0 sort 0} +do_test where7-2.158.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=616 + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR a=96 + } +} {25 27 38 56 96 scan 0 sort 0} +do_test where7-2.158.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=616 + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR a=96 + } +} {25 27 38 56 96 scan 0 sort 0} +do_test where7-2.159.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=352 + } +} {32 66 scan 0 sort 0} +do_test where7-2.159.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=352 + } +} {32 66 scan 0 sort 0} +do_test where7-2.160.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=795 + OR c=13013 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=597 + } +} {28 37 38 39 scan 0 sort 0} +do_test where7-2.160.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=795 + OR c=13013 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=597 + } +} {28 37 38 39 scan 0 sort 0} +do_test where7-2.161.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=23 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b=641 + OR b=352 + OR b=179 + OR b=806 + OR b=839 + OR b=33 + } +} {3 23 32 68 scan 0 sort 0} +do_test where7-2.161.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=23 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b=641 + OR b=352 + OR b=179 + OR b=806 + OR b=839 + OR b=33 + } +} {3 23 32 68 scan 0 sort 0} +do_test where7-2.162.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1070 + OR b=1078 + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR c=12012 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR b=319 + OR c=5005 + OR 1000000=59.0 AND d<60.0 AND d NOT NULL) + } +} {2 17 28 43 54 59 69 80 81 95 scan 0 sort 0} +do_test where7-2.163.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='cdefghijk' + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + } +} {2 17 28 43 54 59 69 80 81 95 scan 0 sort 0} +do_test where7-2.164.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=65 + OR c=14014 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=47 + OR b=220 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + } +} {20 37 40 41 42 47 65 88 scan 0 sort 0} +do_test where7-2.164.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=65 + OR c=14014 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=47 + OR b=220 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + } +} {20 37 40 41 42 47 65 88 scan 0 sort 0} +do_test where7-2.165.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'ijklm*') + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=891 + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR b=484 + OR a=62 + OR (g='ihgfedc' AND f GLOB 'defgh*') + } +} {35 44 57 62 81 86 scan 0 sort 0} +do_test where7-2.165.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'ijklm*') + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=891 + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR b=484 + OR a=62 + OR (g='ihgfedc' AND f GLOB 'defgh*') + } +} {35 44 57 62 81 86 scan 0 sort 0} +do_test where7-2.166.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=363 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR a=39 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + } +} {2 10 25 33 39 46 54 58 60 scan 0 sort 0} +do_test where7-2.166.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=363 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR a=39 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + } +} {2 10 25 33 39 46 54 58 60 scan 0 sort 0} +do_test where7-2.167.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=30030 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR b=850 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + } +} {20 46 52 72 88 89 90 98 scan 0 sort 0} +do_test where7-2.167.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=30030 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR b=850 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + } +} {20 46 52 72 88 89 90 98 scan 0 sort 0} +do_test where7-2.168.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR b=80 + } +} {23 91 scan 0 sort 0} +do_test where7-2.168.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR b=80 + } +} {23 91 scan 0 sort 0} +do_test where7-2.169.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 59 AND 61) AND a!=60) + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=462 + OR a=51 + OR b=344 + OR b=333 + OR ((a BETWEEN 61 AND 63) AND a!=62) + } +} {42 51 59 61 63 77 scan 0 sort 0} +do_test where7-2.169.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 59 AND 61) AND a!=60) + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=462 + OR a=51 + OR b=344 + OR b=333 + OR ((a BETWEEN 61 AND 63) AND a!=62) + } +} {42 51 59 61 63 77 scan 0 sort 0} +do_test where7-2.170.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=586 + OR a=21 + OR b=638 + } +} {21 58 scan 0 sort 0} +do_test where7-2.170.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=586 + OR a=21 + OR b=638 + } +} {21 58 scan 0 sort 0} +do_test where7-2.171.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=179 + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR ((a BETWEEN 72 AND 74) AND a!=73) + } +} {2 4 13 40 42 72 74 scan 0 sort 0} +do_test where7-2.171.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=179 + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR ((a BETWEEN 72 AND 74) AND a!=73) + } +} {2 4 13 40 42 72 74 scan 0 sort 0} +do_test where7-2.172.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=333 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=407 + OR a=5 + OR b=817 + OR b=891 + } +} {5 37 53 62 81 scan 0 sort 0} +do_test where7-2.172.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=333 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=407 + OR a=5 + OR b=817 + OR b=891 + } +} {5 37 53 62 81 scan 0 sort 0} +do_test where7-2.173.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b<0 + OR b=352 + OR b=517 + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR b=1012 + OR ((a BETWEEN 11 AND 13) AND a!=12) + } +} {11 12 13 14 32 47 92 97 scan 0 sort 0} +do_test where7-2.173.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b<0 + OR b=352 + OR b=517 + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR b=1012 + OR ((a BETWEEN 11 AND 13) AND a!=12) + } +} {11 12 13 14 32 47 92 97 scan 0 sort 0} +do_test where7-2.174.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR c<=10 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR a=32 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR d<0.0 + } +} {12 14 32 41 scan 0 sort 0} +do_test where7-2.174.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR c<=10 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR a=32 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR d<0.0 + } +} {12 14 32 41 scan 0 sort 0} +do_test where7-2.175.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 20 AND 22) AND a!=21) + OR b=1045 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR a=26 + OR (g='gfedcba' AND f GLOB 'opqrs*') + } +} {20 22 26 78 92 95 scan 0 sort 0} +do_test where7-2.175.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 20 AND 22) AND a!=21) + OR b=1045 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR a=26 + OR (g='gfedcba' AND f GLOB 'opqrs*') + } +} {20 22 26 78 92 95 scan 0 sort 0} +do_test where7-2.176.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=49 + OR b=58 + } +} {49 scan 0 sort 0} +do_test where7-2.176.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=49 + OR b=58 + } +} {49 scan 0 sort 0} +do_test where7-2.177.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR c=32032 + OR b=289 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {3 14 16 17 19 75 94 95 96 scan 0 sort 0} +do_test where7-2.177.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR c=32032 + OR b=289 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {3 14 16 17 19 75 94 95 96 scan 0 sort 0} +do_test where7-2.178.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 15 AND 17) AND a!=16) + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR b=33 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + } +} {3 15 17 43 57 59 69 95 scan 0 sort 0} +do_test where7-2.178.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 15 AND 17) AND a!=16) + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR b=33 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + } +} {3 15 17 43 57 59 69 95 scan 0 sort 0} +do_test where7-2.179.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=828 + OR b=341 + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR b=902 + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=242 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR (g='qponmlk' AND f GLOB 'qrstu*') + } +} {1 2 16 22 31 42 64 66 68 82 91 94 95 scan 0 sort 0} +do_test where7-2.179.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=828 + OR b=341 + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR b=902 + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=242 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR (g='qponmlk' AND f GLOB 'qrstu*') + } +} {1 2 16 22 31 42 64 66 68 82 91 94 95 scan 0 sort 0} +do_test where7-2.180.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='nmlkjih' AND f GLOB 'efghi*') + OR b=982 + OR b=781 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR d>1e10 + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + } +} {56 66 68 71 scan 0 sort 0} +do_test where7-2.180.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'efghi*') + OR b=982 + OR b=781 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR d>1e10 + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + } +} {56 66 68 71 scan 0 sort 0} +do_test where7-2.181.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR a=31 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR a=76 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=176 + } +} {8 16 23 31 34 57 59 60 69 74 76 86 scan 0 sort 0} +do_test where7-2.181.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR a=31 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR a=76 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=176 + } +} {8 16 23 31 34 57 59 60 69 74 76 86 scan 0 sort 0} +do_test where7-2.182.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ponmlkj' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=14 + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR f='zabcdefgh' + } +} {12 25 47 51 55 59 60 61 77 88 90 scan 0 sort 0} +do_test where7-2.182.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ponmlkj' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=14 + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR f='zabcdefgh' + } +} {12 25 47 51 55 59 60 61 77 88 90 scan 0 sort 0} +do_test where7-2.183.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR b=286 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=91 + OR ((a BETWEEN 43 AND 45) AND a!=44) + } +} {25 26 31 43 45 scan 0 sort 0} +do_test where7-2.183.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR b=286 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=91 + OR ((a BETWEEN 43 AND 45) AND a!=44) + } +} {25 26 31 43 45 scan 0 sort 0} +do_test where7-2.184.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='lkjihgf' AND f GLOB 'nopqr*') + OR c=19019 + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR b=374 + } +} {22 34 48 55 56 57 65 74 100 scan 0 sort 0} +do_test where7-2.184.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='lkjihgf' AND f GLOB 'nopqr*') + OR c=19019 + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR b=374 + } +} {22 34 48 55 56 57 65 74 100 scan 0 sort 0} +do_test where7-2.185.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE g IS NULL + OR (g='onmlkji' AND f GLOB 'wxyza*') + } +} {48 scan 0 sort 0} +do_test where7-2.185.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE g IS NULL + OR (g='onmlkji' AND f GLOB 'wxyza*') + } +} {48 scan 0 sort 0} +do_test where7-2.186.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=4 + OR b=407 + } +} {4 37 scan 0 sort 0} +do_test where7-2.186.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=4 + OR b=407 + } +} {4 37 scan 0 sort 0} +do_test where7-2.187.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 66 AND 68) AND a!=67) + OR b=564 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=234 + OR b=641 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR a=98 + } +} {1 5 12 13 27 39 53 65 66 68 79 91 98 scan 0 sort 0} +do_test where7-2.187.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 66 AND 68) AND a!=67) + OR b=564 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=234 + OR b=641 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR a=98 + } +} {1 5 12 13 27 39 53 65 66 68 79 91 98 scan 0 sort 0} +do_test where7-2.188.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=73 + OR b=44 + OR b=539 + OR c=11011 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=69 + OR b=1001 + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR ((a BETWEEN 32 AND 34) AND a!=33) + } +} {4 23 26 31 32 33 34 49 73 81 91 95 scan 0 sort 0} +do_test where7-2.188.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=73 + OR b=44 + OR b=539 + OR c=11011 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=69 + OR b=1001 + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR ((a BETWEEN 32 AND 34) AND a!=33) + } +} {4 23 26 31 32 33 34 49 73 81 91 95 scan 0 sort 0} +do_test where7-2.189.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=264 + OR b=143 + OR a=48 + } +} {13 24 48 scan 0 sort 0} +do_test where7-2.189.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=264 + OR b=143 + OR a=48 + } +} {13 24 48 scan 0 sort 0} +do_test where7-2.190.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1001 + OR b=1070 + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR b=14 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR a=66 + } +} {18 56 58 66 72 74 91 scan 0 sort 0} +do_test where7-2.190.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1001 + OR b=1070 + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR b=14 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR a=66 + } +} {18 56 58 66 72 74 91 scan 0 sort 0} +do_test where7-2.191.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=23023 + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + OR a=66 + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR a=51 + OR a=23 + OR c=4004 + } +} {10 11 12 23 51 66 67 68 69 83 scan 0 sort 0} +do_test where7-2.191.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=23023 + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + OR a=66 + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR a=51 + OR a=23 + OR c=4004 + } +} {10 11 12 23 51 66 67 68 69 83 scan 0 sort 0} +do_test where7-2.192.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=36 + OR (g='rqponml' AND f GLOB 'lmnop*') + OR a=80 + } +} {37 80 scan 0 sort 0} +do_test where7-2.192.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=36 + OR (g='rqponml' AND f GLOB 'lmnop*') + OR a=80 + } +} {37 80 scan 0 sort 0} +do_test where7-2.193.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR a=55 + OR f='efghijklm' + OR a=8 + OR a=80 + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR b=256 + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + } +} {4 8 30 34 37 39 55 56 60 72 80 82 86 scan 0 sort 0} +do_test where7-2.193.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR a=55 + OR f='efghijklm' + OR a=8 + OR a=80 + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR b=256 + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + } +} {4 8 30 34 37 39 55 56 60 72 80 82 86 scan 0 sort 0} +do_test where7-2.194.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=836 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=91 + OR b=594 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + } +} {2 8 28 47 54 76 80 87 91 scan 0 sort 0} +do_test where7-2.194.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=836 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=91 + OR b=594 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + } +} {2 8 28 47 54 76 80 87 91 scan 0 sort 0} +do_test where7-2.195.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'yzabc*') + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 62 AND 64) AND a!=63) + OR c=6006 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {12 16 17 18 24 43 50 52 62 64 88 90 scan 0 sort 0} +do_test where7-2.195.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'yzabc*') + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 62 AND 64) AND a!=63) + OR c=6006 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {12 16 17 18 24 43 50 52 62 64 88 90 scan 0 sort 0} +do_test where7-2.196.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 83 AND 85) AND a!=84) + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR a=13 + OR b=121 + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR b=660 + OR b=792 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + } +} {6 11 12 13 14 16 18 44 60 72 83 85 scan 0 sort 0} +do_test where7-2.196.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 83 AND 85) AND a!=84) + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR a=13 + OR b=121 + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR b=660 + OR b=792 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + } +} {6 11 12 13 14 16 18 44 60 72 83 85 scan 0 sort 0} +do_test where7-2.197.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1089 + OR b=495 + OR b=157 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR (g='xwvutsr' AND f GLOB 'hijkl*') + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR f='wxyzabcde' + } +} {1 7 20 22 45 46 48 59 72 74 98 99 100 scan 0 sort 0} +do_test where7-2.197.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1089 + OR b=495 + OR b=157 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR (g='xwvutsr' AND f GLOB 'hijkl*') + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR f='wxyzabcde' + } +} {1 7 20 22 45 46 48 59 72 74 98 99 100 scan 0 sort 0} +do_test where7-2.198.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='bcdefghij' + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (g='srqponm' AND f GLOB 'ghijk*') + OR b=157 + OR b=267 + OR c=34034 + } +} {1 27 32 40 42 53 79 100 scan 0 sort 0} +do_test where7-2.198.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='bcdefghij' + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (g='srqponm' AND f GLOB 'ghijk*') + OR b=157 + OR b=267 + OR c=34034 + } +} {1 27 32 40 42 53 79 100 scan 0 sort 0} +do_test where7-2.199.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=19 + OR a=23 + OR c<=10 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {19 23 66 scan 0 sort 0} +do_test where7-2.199.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=19 + OR a=23 + OR c<=10 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {19 23 66 scan 0 sort 0} +do_test where7-2.200.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 1 AND 3) AND a!=2) + OR b=792 + OR b=803 + OR b=36 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + } +} {1 3 27 53 72 73 79 scan 0 sort 0} +do_test where7-2.200.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 1 AND 3) AND a!=2) + OR b=792 + OR b=803 + OR b=36 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + } +} {1 3 27 53 72 73 79 scan 0 sort 0} +do_test where7-2.201.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR f='jklmnopqr' + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR b=891 + OR a=40 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + } +} {9 20 35 40 50 61 67 71 73 76 78 81 87 scan 0 sort 0} +do_test where7-2.201.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR f='jklmnopqr' + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR b=891 + OR a=40 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + } +} {9 20 35 40 50 61 67 71 73 76 78 81 87 scan 0 sort 0} +do_test where7-2.202.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR a=32 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=95 + OR d>1e10 + OR b=429 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR c=10010 + OR ((a BETWEEN 83 AND 85) AND a!=84) + } +} {15 28 29 30 32 39 54 76 83 85 88 95 scan 0 sort 0} +do_test where7-2.202.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR a=32 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=95 + OR d>1e10 + OR b=429 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR c=10010 + OR ((a BETWEEN 83 AND 85) AND a!=84) + } +} {15 28 29 30 32 39 54 76 83 85 88 95 scan 0 sort 0} +do_test where7-2.203.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'defgh*') + OR a=22 + OR a=26 + OR a=81 + OR a=53 + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR c=30030 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=82 + OR b=594 + } +} {3 8 22 26 53 54 81 82 88 89 90 92 94 scan 0 sort 0} +do_test where7-2.203.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'defgh*') + OR a=22 + OR a=26 + OR a=81 + OR a=53 + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR c=30030 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=82 + OR b=594 + } +} {3 8 22 26 53 54 81 82 88 89 90 92 94 scan 0 sort 0} +do_test where7-2.204.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 34 AND 36) AND a!=35) + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'efghi*') + OR a=83 + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=1092 + OR (g='srqponm' AND f GLOB 'efghi*') + OR b=25 + } +} {12 30 34 36 57 68 83 86 99 scan 0 sort 0} +do_test where7-2.204.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 34 AND 36) AND a!=35) + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'efghi*') + OR a=83 + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=1092 + OR (g='srqponm' AND f GLOB 'efghi*') + OR b=25 + } +} {12 30 34 36 57 68 83 86 99 scan 0 sort 0} +do_test where7-2.205.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=20 + OR b=421 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR a=50 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {5 20 40 50 53 scan 0 sort 0} +do_test where7-2.205.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=20 + OR b=421 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR a=50 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {5 20 40 50 53 scan 0 sort 0} +do_test where7-2.206.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=960 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + } +} {13 39 65 91 scan 0 sort 0} +do_test where7-2.206.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=960 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + } +} {13 39 65 91 scan 0 sort 0} +do_test where7-2.207.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=891 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR f='nopqrstuv' + } +} {13 31 39 65 81 91 scan 0 sort 0} +do_test where7-2.207.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=891 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR f='nopqrstuv' + } +} {13 31 39 65 81 91 scan 0 sort 0} +do_test where7-2.208.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=157 + OR b=289 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=1001 + OR b=707 + } +} {32 34 91 scan 0 sort 0} +do_test where7-2.208.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=157 + OR b=289 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=1001 + OR b=707 + } +} {32 34 91 scan 0 sort 0} +do_test where7-2.209.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='edcbazy' AND f GLOB 'wxyza*') + OR b=957 + OR ((a BETWEEN 48 AND 50) AND a!=49) + } +} {48 50 87 100 scan 0 sort 0} +do_test where7-2.209.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='edcbazy' AND f GLOB 'wxyza*') + OR b=957 + OR ((a BETWEEN 48 AND 50) AND a!=49) + } +} {48 50 87 100 scan 0 sort 0} +do_test where7-2.210.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) + OR a=77 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + } +} {40 77 85 scan 0 sort 0} +do_test where7-2.210.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) + OR a=77 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + } +} {40 77 85 scan 0 sort 0} +do_test where7-2.211.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=11 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR a=99 + } +} {1 14 16 38 66 96 99 scan 0 sort 0} +do_test where7-2.211.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=11 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR a=99 + } +} {1 14 16 38 66 96 99 scan 0 sort 0} +do_test where7-2.212.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='fghijklmn' + OR a=16 + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=80 + } +} {3 5 9 11 16 31 52 57 60 62 71 83 90 92 scan 0 sort 0} +do_test where7-2.212.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='fghijklmn' + OR a=16 + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=80 + } +} {3 5 9 11 16 31 52 57 60 62 71 83 90 92 scan 0 sort 0} +do_test where7-2.213.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'mnopq*') + OR a=44 + OR a=43 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + OR b=25 + } +} {12 43 44 66 scan 0 sort 0} +do_test where7-2.213.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'mnopq*') + OR a=44 + OR a=43 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + OR b=25 + } +} {12 43 44 66 scan 0 sort 0} +do_test where7-2.214.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='vwxyzabcd' + OR a=73 + OR b=597 + } +} {21 47 73 99 scan 0 sort 0} +do_test where7-2.214.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='vwxyzabcd' + OR a=73 + OR b=597 + } +} {21 47 73 99 scan 0 sort 0} +do_test where7-2.215.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=22 + OR ((a BETWEEN 61 AND 63) AND a!=62) + OR e IS NULL + OR a=1 + } +} {1 2 61 63 scan 0 sort 0} +do_test where7-2.215.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=22 + OR ((a BETWEEN 61 AND 63) AND a!=62) + OR e IS NULL + OR a=1 + } +} {1 2 61 63 scan 0 sort 0} +do_test where7-2.216.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'opqrs*') + OR b=1015 + OR c=16016 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR f='abcdefghi' + OR b=605 + OR a=63 + } +} {3 19 26 45 46 47 48 52 55 63 71 78 92 97 scan 0 sort 0} +do_test where7-2.216.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'opqrs*') + OR b=1015 + OR c=16016 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR f='abcdefghi' + OR b=605 + OR a=63 + } +} {3 19 26 45 46 47 48 52 55 63 71 78 92 97 scan 0 sort 0} +do_test where7-2.217.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='yxwvuts' AND f GLOB 'bcdef*') + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=641 + OR b=795 + } +} {1 44 scan 0 sort 0} +do_test where7-2.217.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='yxwvuts' AND f GLOB 'bcdef*') + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=641 + OR b=795 + } +} {1 44 scan 0 sort 0} +do_test where7-2.218.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='fghijklmn' + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + } +} {5 15 31 44 57 83 scan 0 sort 0} +do_test where7-2.218.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='fghijklmn' + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + } +} {5 15 31 44 57 83 scan 0 sort 0} +do_test where7-2.219.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 99 AND 101) AND a!=100) + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR a=92 + OR b=1100 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR ((a BETWEEN 30 AND 32) AND a!=31) + } +} {30 32 72 74 85 87 92 98 99 100 scan 0 sort 0} +do_test where7-2.219.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 99 AND 101) AND a!=100) + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR a=92 + OR b=1100 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR ((a BETWEEN 30 AND 32) AND a!=31) + } +} {30 32 72 74 85 87 92 98 99 100 scan 0 sort 0} +do_test where7-2.220.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=880 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=1089 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR f IS NULL + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + } +} {5 12 16 31 57 69 71 80 83 86 97 99 scan 0 sort 0} +do_test where7-2.220.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=880 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=1089 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR f IS NULL + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + } +} {5 12 16 31 57 69 71 80 83 86 97 99 scan 0 sort 0} +do_test where7-2.221.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1026 + OR b=407 + OR (g='srqponm' AND f GLOB 'fghij*') + OR b=564 + OR c=23023 + OR b=891 + OR c=22022 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (g='rqponml' AND f GLOB 'ijklm*') + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + } +} {9 11 21 22 24 31 34 37 64 65 66 67 68 69 81 scan 0 sort 0} +do_test where7-2.221.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1026 + OR b=407 + OR (g='srqponm' AND f GLOB 'fghij*') + OR b=564 + OR c=23023 + OR b=891 + OR c=22022 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (g='rqponml' AND f GLOB 'ijklm*') + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + } +} {9 11 21 22 24 31 34 37 64 65 66 67 68 69 81 scan 0 sort 0} +do_test where7-2.222.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR a=72 + OR a=43 + } +} {43 71 72 73 scan 0 sort 0} +do_test where7-2.222.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR a=72 + OR a=43 + } +} {43 71 72 73 scan 0 sort 0} +do_test where7-2.223.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 67 AND 69) AND a!=68) + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR c=18018 + OR b=792 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR f='uvwxyzabc' + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + } +} {8 20 46 52 53 54 61 67 69 72 74 77 79 81 91 98 scan 0 sort 0} +do_test where7-2.223.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 67 AND 69) AND a!=68) + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR c=18018 + OR b=792 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR f='uvwxyzabc' + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + } +} {8 20 46 52 53 54 61 67 69 72 74 77 79 81 91 98 scan 0 sort 0} +do_test where7-2.224.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=429 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR b=1070 + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {4 17 30 33 39 40 56 82 scan 0 sort 0} +do_test where7-2.224.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=429 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR b=1070 + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {4 17 30 33 39 40 56 82 scan 0 sort 0} +do_test where7-2.225.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=572 + } +} {52 61 scan 0 sort 0} +do_test where7-2.225.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=572 + } +} {52 61 scan 0 sort 0} +do_test where7-2.226.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 62 AND 64) AND a!=63) + OR f='abcdefghi' + OR (g='wvutsrq' AND f GLOB 'ijklm*') + } +} {8 26 52 62 64 78 scan 0 sort 0} +do_test where7-2.226.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 62 AND 64) AND a!=63) + OR f='abcdefghi' + OR (g='wvutsrq' AND f GLOB 'ijklm*') + } +} {8 26 52 62 64 78 scan 0 sort 0} +do_test where7-2.227.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=40 + OR ((a BETWEEN 85 AND 87) AND a!=86) + } +} {40 85 87 scan 0 sort 0} +do_test where7-2.227.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=40 + OR ((a BETWEEN 85 AND 87) AND a!=86) + } +} {40 85 87 scan 0 sort 0} +do_test where7-2.228.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=43 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR a=1 + OR ((a BETWEEN 75 AND 77) AND a!=76) + OR a=75 + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {1 43 44 46 59 61 75 77 83 scan 0 sort 0} +do_test where7-2.228.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=43 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR a=1 + OR ((a BETWEEN 75 AND 77) AND a!=76) + OR a=75 + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {1 43 44 46 59 61 75 77 83 scan 0 sort 0} +do_test where7-2.229.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='gfedcba' AND f GLOB 'nopqr*') + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR b=231 + OR a=87 + } +} {8 21 34 60 86 87 91 scan 0 sort 0} +do_test where7-2.229.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='gfedcba' AND f GLOB 'nopqr*') + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR b=231 + OR a=87 + } +} {8 21 34 60 86 87 91 scan 0 sort 0} +do_test where7-2.230.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=77 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (g='rqponml' AND f GLOB 'hijkl*') + OR c=24024 + OR c=5005 + } +} {13 14 15 33 65 70 71 72 77 scan 0 sort 0} +do_test where7-2.230.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=77 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (g='rqponml' AND f GLOB 'hijkl*') + OR c=24024 + OR c=5005 + } +} {13 14 15 33 65 70 71 72 77 scan 0 sort 0} +do_test where7-2.231.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='mlkjihg' AND f GLOB 'ijklm*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='srqponm' AND f GLOB 'defgh*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR b=682 + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + } +} {22 29 34 60 62 64 65 66 89 91 scan 0 sort 0} +do_test where7-2.231.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='mlkjihg' AND f GLOB 'ijklm*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='srqponm' AND f GLOB 'defgh*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR b=682 + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + } +} {22 29 34 60 62 64 65 66 89 91 scan 0 sort 0} +do_test where7-2.232.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=212 + OR b=121 + OR c=2002 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (g='jihgfed' AND f GLOB 'xyzab*') + } +} {4 5 6 11 75 84 86 scan 0 sort 0} +do_test where7-2.232.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=212 + OR b=121 + OR c=2002 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (g='jihgfed' AND f GLOB 'xyzab*') + } +} {4 5 6 11 75 84 86 scan 0 sort 0} +do_test where7-2.233.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=55.0 AND d<56.0 AND d NOT NULL) + OR f='abcdefghi' + OR b=267 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR a=82 + OR a=54 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=1078 + } +} {16 20 26 52 54 55 78 82 98 scan 0 sort 0} +do_test where7-2.233.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=55.0 AND d<56.0 AND d NOT NULL) + OR f='abcdefghi' + OR b=267 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR a=82 + OR a=54 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=1078 + } +} {16 20 26 52 54 55 78 82 98 scan 0 sort 0} +do_test where7-2.234.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) + OR f='hijklmnop' + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + } +} {7 33 34 59 85 93 scan 0 sort 0} +do_test where7-2.234.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) + OR f='hijklmnop' + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + } +} {7 33 34 59 85 93 scan 0 sort 0} +do_test where7-2.235.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 98 AND 100) AND a!=99) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR a=18 + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR 1000000=94.0 AND d<95.0 AND d NOT NULL) + OR 1000000=89.0 AND d<90.0 AND d NOT NULL) + } +} {7 33 59 85 89 91 scan 0 sort 0} +do_test where7-2.236.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1001 + OR b=168 + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + } +} {7 33 59 85 89 91 scan 0 sort 0} +do_test where7-2.237.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=51 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR b=330 + } +} {30 51 96 98 scan 0 sort 0} +do_test where7-2.237.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=51 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR b=330 + } +} {30 51 96 98 scan 0 sort 0} +do_test where7-2.238.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=704 + OR a=62 + OR f='pqrstuvwx' + OR b=495 + OR c=26026 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b<0 + OR b=597 + } +} {15 41 45 62 64 67 68 71 76 77 78 93 scan 0 sort 0} +do_test where7-2.238.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=704 + OR a=62 + OR f='pqrstuvwx' + OR b=495 + OR c=26026 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b<0 + OR b=597 + } +} {15 41 45 62 64 67 68 71 76 77 78 93 scan 0 sort 0} +do_test where7-2.239.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR b=520 + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR f IS NULL + } +} {2 47 49 87 89 scan 0 sort 0} +do_test where7-2.239.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR b=520 + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR f IS NULL + } +} {2 47 49 87 89 scan 0 sort 0} +do_test where7-2.240.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=14014 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=572 + OR c=15015 + } +} {40 41 42 43 44 45 52 95 scan 0 sort 0} +do_test where7-2.240.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=14014 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=572 + OR c=15015 + } +} {40 41 42 43 44 45 52 95 scan 0 sort 0} +do_test where7-2.241.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR b=850 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR b=88 + OR f='hijklmnop' + OR b=806 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=88 + } +} {3 7 8 15 17 29 33 46 55 59 65 81 85 scan 0 sort 0} +do_test where7-2.241.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR b=850 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR b=88 + OR f='hijklmnop' + OR b=806 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=88 + } +} {3 7 8 15 17 29 33 46 55 59 65 81 85 scan 0 sort 0} +do_test where7-2.242.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=817 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR a=36 + OR b=960 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR b=374 + OR b=938 + OR b=773 + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + } +} {34 36 55 58 63 77 scan 0 sort 0} +do_test where7-2.242.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=817 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR a=36 + OR b=960 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR b=374 + OR b=938 + OR b=773 + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + } +} {34 36 55 58 63 77 scan 0 sort 0} +do_test where7-2.243.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=146 + } +} {69 scan 0 sort 0} +do_test where7-2.243.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=146 + } +} {69 scan 0 sort 0} +do_test where7-2.244.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='pqrstuvwx' + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR b=704 + OR a=18 + } +} {6 8 15 18 41 64 67 76 78 93 scan 0 sort 0} +do_test where7-2.244.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='pqrstuvwx' + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR b=704 + OR a=18 + } +} {6 8 15 18 41 64 67 76 78 93 scan 0 sort 0} +do_test where7-2.245.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR b=399 + OR b=1004 + OR c=16016 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=671 + OR a=25 + OR a=30 + OR a=8 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + } +} {5 8 19 25 30 31 45 46 47 48 61 71 97 scan 0 sort 0} +do_test where7-2.245.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR b=399 + OR b=1004 + OR c=16016 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=671 + OR a=25 + OR a=30 + OR a=8 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + } +} {5 8 19 25 30 31 45 46 47 48 61 71 97 scan 0 sort 0} +do_test where7-2.246.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=561 + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=594 + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=861 + OR (d>=90.0 AND d<91.0 AND d NOT NULL) + OR b=949 + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + } +} {18 28 30 39 41 51 54 90 scan 0 sort 0} +do_test where7-2.246.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=561 + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=594 + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=861 + OR (d>=90.0 AND d<91.0 AND d NOT NULL) + OR b=949 + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + } +} {18 28 30 39 41 51 54 90 scan 0 sort 0} +do_test where7-2.247.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'hijkl*') + OR a=83 + OR c=26026 + OR a=49 + OR a=57 + OR c=23023 + OR f='uvwxyzabc' + } +} {7 20 46 49 57 67 68 69 72 76 77 78 83 98 scan 0 sort 0} +do_test where7-2.247.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'hijkl*') + OR a=83 + OR c=26026 + OR a=49 + OR a=57 + OR c=23023 + OR f='uvwxyzabc' + } +} {7 20 46 49 57 67 68 69 72 76 77 78 83 98 scan 0 sort 0} +do_test where7-2.248.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE d>1e10 + OR b=355 + OR f='stuvwxyza' + OR b=22 + } +} {2 18 44 70 96 scan 0 sort 0} +do_test where7-2.248.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE d>1e10 + OR b=355 + OR f='stuvwxyza' + OR b=22 + } +} {2 18 44 70 96 scan 0 sort 0} +do_test where7-2.249.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=451 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + } +} {8 34 41 60 86 scan 0 sort 0} +do_test where7-2.249.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=451 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + } +} {8 34 41 60 86 scan 0 sort 0} +do_test where7-2.250.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=47 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + } +} {1 27 53 79 scan 0 sort 0} +do_test where7-2.250.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=47 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + } +} {1 27 53 79 scan 0 sort 0} +do_test where7-2.251.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1037 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=344 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {12 66 68 86 scan 0 sort 0} +do_test where7-2.251.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1037 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=344 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {12 66 68 86 scan 0 sort 0} +do_test where7-2.252.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=506 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR b=429 + OR b=275 + } +} {20 22 25 39 46 86 scan 0 sort 0} +do_test where7-2.252.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=506 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR b=429 + OR b=275 + } +} {20 22 25 39 46 86 scan 0 sort 0} +do_test where7-2.253.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR a=28 + OR b=443 + OR b=363 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR a=60 + OR b=80 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR b=616 + } +} {28 33 47 56 60 62 scan 0 sort 0} +do_test where7-2.253.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR a=28 + OR b=443 + OR b=363 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR a=60 + OR b=80 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR b=616 + } +} {28 33 47 56 60 62 scan 0 sort 0} +do_test where7-2.254.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=660 + } +} {33 60 scan 0 sort 0} +do_test where7-2.254.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=660 + } +} {33 60 scan 0 sort 0} +do_test where7-2.255.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'hijkl*') + OR a=43 + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR b=586 + OR c=17017 + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR a=87 + OR b=968 + } +} {7 21 43 47 49 50 51 64 66 73 87 88 99 scan 0 sort 0} +do_test where7-2.255.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'hijkl*') + OR a=43 + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR b=586 + OR c=17017 + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR a=87 + OR b=968 + } +} {7 21 43 47 49 50 51 64 66 73 87 88 99 scan 0 sort 0} +do_test where7-2.256.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='klmnopqrs' + OR b=982 + OR b=575 + OR b=110 + OR b=99 + } +} {9 10 36 62 88 scan 0 sort 0} +do_test where7-2.256.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='klmnopqrs' + OR b=982 + OR b=575 + OR b=110 + OR b=99 + } +} {9 10 36 62 88 scan 0 sort 0} +do_test where7-2.257.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='rqponml' AND f GLOB 'jklmn*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR c>=34035 + OR b=850 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=924 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=355 + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {4 32 34 35 37 56 78 84 86 scan 0 sort 0} +do_test where7-2.257.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='rqponml' AND f GLOB 'jklmn*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR c>=34035 + OR b=850 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=924 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=355 + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {4 32 34 35 37 56 78 84 86 scan 0 sort 0} +do_test where7-2.258.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=982 + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR b=374 + } +} {34 46 81 83 scan 0 sort 0} +do_test where7-2.258.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=982 + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR b=374 + } +} {34 46 81 83 scan 0 sort 0} +do_test where7-2.259.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 87 AND 89) AND a!=88) + OR b=814 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + } +} {19 74 87 89 scan 0 sort 0} +do_test where7-2.259.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 87 AND 89) AND a!=88) + OR b=814 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + } +} {19 74 87 89 scan 0 sort 0} +do_test where7-2.260.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'nopqr*') + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=993 + } +} {12 39 scan 0 sort 0} +do_test where7-2.260.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'nopqr*') + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=993 + } +} {12 39 scan 0 sort 0} +do_test where7-2.261.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=234 + OR a=22 + OR b=289 + OR b=795 + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR b=242 + OR a=59 + OR b=1045 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + } +} {8 22 59 91 95 scan 0 sort 0} +do_test where7-2.261.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=234 + OR a=22 + OR b=289 + OR b=795 + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR b=242 + OR a=59 + OR b=1045 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + } +} {8 22 59 91 95 scan 0 sort 0} +do_test where7-2.262.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=245 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR c=3003 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR ((a BETWEEN 71 AND 73) AND a!=72) + } +} {1 7 8 9 10 26 33 52 68 70 71 73 78 scan 0 sort 0} +do_test where7-2.262.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=245 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR c=3003 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR ((a BETWEEN 71 AND 73) AND a!=72) + } +} {1 7 8 9 10 26 33 52 68 70 71 73 78 scan 0 sort 0} +do_test where7-2.263.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'jklmn*') + OR b=220 + OR b=443 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR a=62 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR b=1023 + OR a=100 + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + } +} {18 20 44 55 62 70 87 93 96 97 100 scan 0 sort 0} +do_test where7-2.263.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'jklmn*') + OR b=220 + OR b=443 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR a=62 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR b=1023 + OR a=100 + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + } +} {18 20 44 55 62 70 87 93 96 97 100 scan 0 sort 0} +do_test where7-2.264.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=11011 + OR f='tuvwxyzab' + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR (g='hgfedcb' AND f GLOB 'ghijk*') + } +} {19 31 32 33 45 47 71 84 97 scan 0 sort 0} +do_test where7-2.264.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=11011 + OR f='tuvwxyzab' + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR (g='hgfedcb' AND f GLOB 'ghijk*') + } +} {19 31 32 33 45 47 71 84 97 scan 0 sort 0} +do_test where7-2.265.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 93 AND 95) AND a!=94) + OR a=79 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR b=462 + } +} {39 42 79 93 95 scan 0 sort 0} +do_test where7-2.265.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 93 AND 95) AND a!=94) + OR a=79 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR b=462 + } +} {39 42 79 93 95 scan 0 sort 0} +do_test where7-2.266.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=146 + OR 1000000=33.0 AND d<34.0 AND d NOT NULL) + OR b=146 + OR 1000000=20.0 AND d<21.0 AND d NOT NULL) + OR ((a BETWEEN 62 AND 64) AND a!=63) + OR a=62 + OR b=619 + OR a=82 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR c=14014 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {20 28 40 41 42 43 62 64 67 82 85 scan 0 sort 0} +do_test where7-2.267.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=935 + OR b=473 + OR a=28 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR ((a BETWEEN 62 AND 64) AND a!=63) + OR a=62 + OR b=619 + OR a=82 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR c=14014 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {20 28 40 41 42 43 62 64 67 82 85 scan 0 sort 0} +do_test where7-2.268.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=443 + OR b=33 + OR b=762 + OR b=575 + OR c=16016 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR b=1092 + } +} {3 40 41 43 46 47 48 72 scan 0 sort 0} +do_test where7-2.268.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=443 + OR b=33 + OR b=762 + OR b=575 + OR c=16016 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR b=1092 + } +} {3 40 41 43 46 47 48 72 scan 0 sort 0} +do_test where7-2.269.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=806 + OR b=872 + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR f='uvwxyzabc' + OR b=748 + OR b=586 + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR (g='gfedcba' AND f GLOB 'klmno*') + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR b=891 + } +} {15 17 20 32 34 46 68 72 80 81 88 98 scan 0 sort 0} +do_test where7-2.269.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=806 + OR b=872 + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR f='uvwxyzabc' + OR b=748 + OR b=586 + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR (g='gfedcba' AND f GLOB 'klmno*') + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR b=891 + } +} {15 17 20 32 34 46 68 72 80 81 88 98 scan 0 sort 0} +do_test where7-2.270.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=693 + OR f='fghijklmn' + OR (g='rqponml' AND f GLOB 'hijkl*') + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR a=96 + } +} {5 31 33 39 57 63 71 73 83 96 scan 0 sort 0} +do_test where7-2.270.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=693 + OR f='fghijklmn' + OR (g='rqponml' AND f GLOB 'hijkl*') + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR a=96 + } +} {5 31 33 39 57 63 71 73 83 96 scan 0 sort 0} +do_test where7-2.271.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'ijklm*') + OR b=451 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR a=84 + } +} {41 84 86 96 97 98 99 scan 0 sort 0} +do_test where7-2.271.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'ijklm*') + OR b=451 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR a=84 + } +} {41 84 86 96 97 98 99 scan 0 sort 0} +do_test where7-2.272.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='nmlkjih' AND f GLOB 'bcdef*') + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR a=75 + OR b=960 + OR (g='tsrqpon' AND f GLOB 'yzabc*') + OR b=616 + OR b=330 + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR a=26 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {16 18 24 26 30 53 56 63 72 75 scan 0 sort 0} +do_test where7-2.272.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'bcdef*') + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR a=75 + OR b=960 + OR (g='tsrqpon' AND f GLOB 'yzabc*') + OR b=616 + OR b=330 + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR a=26 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {16 18 24 26 30 53 56 63 72 75 scan 0 sort 0} +do_test where7-2.273.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=762 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + } +} {53 scan 0 sort 0} +do_test where7-2.273.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=762 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + } +} {53 scan 0 sort 0} +do_test where7-2.274.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=14 + OR a=23 + OR b=748 + OR b=407 + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=979 + OR ((a BETWEEN 15 AND 17) AND a!=16) + } +} {4 15 17 23 37 68 87 89 scan 0 sort 0} +do_test where7-2.274.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=14 + OR a=23 + OR b=748 + OR b=407 + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=979 + OR ((a BETWEEN 15 AND 17) AND a!=16) + } +} {4 15 17 23 37 68 87 89 scan 0 sort 0} +do_test where7-2.275.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 36 AND 38) AND a!=37) + OR a=92 + } +} {36 38 92 scan 0 sort 0} +do_test where7-2.275.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 36 AND 38) AND a!=37) + OR a=92 + } +} {36 38 92 scan 0 sort 0} +do_test where7-2.276.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=14014 + OR b=927 + OR b=176 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR b=220 + OR (g='tsrqpon' AND f GLOB 'yzabc*') + OR a=4 + } +} {4 16 20 24 34 36 40 41 42 scan 0 sort 0} +do_test where7-2.276.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=14014 + OR b=927 + OR b=176 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR b=220 + OR (g='tsrqpon' AND f GLOB 'yzabc*') + OR a=4 + } +} {4 16 20 24 34 36 40 41 42 scan 0 sort 0} +do_test where7-2.277.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=29 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=979 + OR b=275 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + OR b=539 + OR a=87 + } +} {19 25 29 41 49 56 58 87 89 scan 0 sort 0} +do_test where7-2.277.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=29 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=979 + OR b=275 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + OR b=539 + OR a=87 + } +} {19 25 29 41 49 56 58 87 89 scan 0 sort 0} +do_test where7-2.278.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 43 AND 45) AND a!=44) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR f='fghijklmn' + OR (g='rqponml' AND f GLOB 'klmno*') + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR a=74 + OR ((a BETWEEN 7 AND 9) AND a!=8) + } +} {4 5 6 7 9 31 36 43 45 57 59 69 74 83 scan 0 sort 0} +do_test where7-2.278.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 43 AND 45) AND a!=44) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR f='fghijklmn' + OR (g='rqponml' AND f GLOB 'klmno*') + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR a=74 + OR ((a BETWEEN 7 AND 9) AND a!=8) + } +} {4 5 6 7 9 31 36 43 45 57 59 69 74 83 scan 0 sort 0} +do_test where7-2.279.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 80 AND 82) AND a!=81) + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR (g='ihgfedc' AND f GLOB 'bcdef*') + } +} {8 34 42 49 51 60 79 80 82 86 scan 0 sort 0} +do_test where7-2.279.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 80 AND 82) AND a!=81) + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR (g='ihgfedc' AND f GLOB 'bcdef*') + } +} {8 34 42 49 51 60 79 80 82 86 scan 0 sort 0} +do_test where7-2.280.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 58 AND 60) AND a!=59) + OR b=696 + OR f='tuvwxyzab' + OR b=374 + OR b=110 + OR a=90 + } +} {10 19 34 45 58 60 71 90 97 scan 0 sort 0} +do_test where7-2.280.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 58 AND 60) AND a!=59) + OR b=696 + OR f='tuvwxyzab' + OR b=374 + OR b=110 + OR a=90 + } +} {10 19 34 45 58 60 71 90 97 scan 0 sort 0} +do_test where7-2.281.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR c=23023 + OR b=377 + OR b=858 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {6 57 67 68 69 78 scan 0 sort 0} +do_test where7-2.281.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR c=23023 + OR b=377 + OR b=858 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {6 57 67 68 69 78 scan 0 sort 0} +do_test where7-2.282.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=38.0 AND d<39.0 AND d NOT NULL) + OR b=322 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'pqrst*') + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR b=432 + OR b=55 + OR a=53 + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR b=25 + } +} {5 7 19 33 38 48 53 59 74 85 93 scan 0 sort 0} +do_test where7-2.282.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=38.0 AND d<39.0 AND d NOT NULL) + OR b=322 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'pqrst*') + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR b=432 + OR b=55 + OR a=53 + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR b=25 + } +} {5 7 19 33 38 48 53 59 74 85 93 scan 0 sort 0} +do_test where7-2.283.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=484 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=616 + OR c=5005 + OR ((a BETWEEN 27 AND 29) AND a!=28) + } +} {13 14 15 27 29 44 56 74 scan 0 sort 0} +do_test where7-2.283.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=484 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=616 + OR c=5005 + OR ((a BETWEEN 27 AND 29) AND a!=28) + } +} {13 14 15 27 29 44 56 74 scan 0 sort 0} +do_test where7-2.284.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=916 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=1048 + OR c=6006 + OR b=762 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR b=751 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + } +} {13 14 16 17 18 39 40 59 61 65 66 73 91 92 scan 0 sort 0} +do_test where7-2.284.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=916 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=1048 + OR c=6006 + OR b=762 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR b=751 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + } +} {13 14 16 17 18 39 40 59 61 65 66 73 91 92 scan 0 sort 0} +do_test where7-2.285.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) + OR b=927 + OR b=275 + OR b=396 + OR c=4004 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR b=319 + OR ((a BETWEEN 83 AND 85) AND a!=84) + OR a=3 + OR ((a BETWEEN 73 AND 75) AND a!=74) + } +} {3 10 11 12 14 25 29 32 36 73 75 83 85 scan 0 sort 0} +do_test where7-2.285.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) + OR b=927 + OR b=275 + OR b=396 + OR c=4004 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR b=319 + OR ((a BETWEEN 83 AND 85) AND a!=84) + OR a=3 + OR ((a BETWEEN 73 AND 75) AND a!=74) + } +} {3 10 11 12 14 25 29 32 36 73 75 83 85 scan 0 sort 0} +do_test where7-2.286.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'lmnop*') + OR b=718 + OR f='vwxyzabcd' + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + } +} {9 11 19 21 22 35 45 47 61 66 68 71 73 87 97 98 99 scan 0 sort 0} +do_test where7-2.286.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'lmnop*') + OR b=718 + OR f='vwxyzabcd' + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + } +} {9 11 19 21 22 35 45 47 61 66 68 71 73 87 97 98 99 scan 0 sort 0} +do_test where7-2.287.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=187 + OR b=1056 + OR b=861 + OR b=1081 + OR b=572 + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR a=11 + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR a=89 + OR b=421 + } +} {4 11 17 52 89 96 99 scan 0 sort 0} +do_test where7-2.287.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=187 + OR b=1056 + OR b=861 + OR b=1081 + OR b=572 + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR a=11 + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR a=89 + OR b=421 + } +} {4 11 17 52 89 96 99 scan 0 sort 0} +do_test where7-2.288.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=231 + OR b=388 + OR d<0.0 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR b=1045 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + } +} {12 21 39 95 scan 0 sort 0} +do_test where7-2.288.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=231 + OR b=388 + OR d<0.0 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR b=1045 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + } +} {12 21 39 95 scan 0 sort 0} +do_test where7-2.289.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=528 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=762 + } +} {48 53 scan 0 sort 0} +do_test where7-2.289.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=528 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=762 + } +} {48 53 scan 0 sort 0} +do_test where7-2.290.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='stuvwxyza' + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR b=916 + } +} {18 44 70 90 92 96 scan 0 sort 0} +do_test where7-2.290.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='stuvwxyza' + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR b=916 + } +} {18 44 70 90 92 96 scan 0 sort 0} +do_test where7-2.291.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + } +} {4 19 52 76 96 98 scan 0 sort 0} +do_test where7-2.291.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + } +} {4 19 52 76 96 98 scan 0 sort 0} +do_test where7-2.292.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=102 + OR c=6006 + OR b=231 + OR b=212 + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'klmno*') + OR c=30030 + OR (g='onmlkji' AND f GLOB 'abcde*') + } +} {16 17 18 21 36 52 88 89 90 scan 0 sort 0} +do_test where7-2.292.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=102 + OR c=6006 + OR b=231 + OR b=212 + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'klmno*') + OR c=30030 + OR (g='onmlkji' AND f GLOB 'abcde*') + } +} {16 17 18 21 36 52 88 89 90 scan 0 sort 0} +do_test where7-2.293.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=47 + OR a=82 + OR c=25025 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR f='qrstuvwxy' + OR a=5 + } +} {5 16 40 42 47 68 73 74 75 82 94 scan 0 sort 0} +do_test where7-2.293.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=47 + OR a=82 + OR c=25025 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR f='qrstuvwxy' + OR a=5 + } +} {5 16 40 42 47 68 73 74 75 82 94 scan 0 sort 0} +do_test where7-2.294.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=429 + OR a=30 + OR f='vwxyzabcd' + OR b=762 + OR a=60 + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + } +} {4 21 30 39 47 60 73 99 scan 0 sort 0} +do_test where7-2.294.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=429 + OR a=30 + OR f='vwxyzabcd' + OR b=762 + OR a=60 + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + } +} {4 21 30 39 47 60 73 99 scan 0 sort 0} +do_test where7-2.295.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='mlkjihg' AND f GLOB 'ghijk*') + OR a=3 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=498 + OR a=100 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR a=69 + } +} {3 13 31 39 58 63 65 69 91 100 scan 0 sort 0} +do_test where7-2.295.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='mlkjihg' AND f GLOB 'ghijk*') + OR a=3 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=498 + OR a=100 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR a=69 + } +} {3 13 31 39 58 63 65 69 91 100 scan 0 sort 0} +do_test where7-2.296.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'efghi*') + OR b=300 + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR b=58 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR b=286 + OR b=234 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR f='ghijklmno' + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + } +} {6 7 26 32 43 45 55 57 58 82 84 scan 0 sort 0} +do_test where7-2.296.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'efghi*') + OR b=300 + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR b=58 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR b=286 + OR b=234 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR f='ghijklmno' + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + } +} {6 7 26 32 43 45 55 57 58 82 84 scan 0 sort 0} +do_test where7-2.297.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=95 + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR b=594 + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + } +} {5 7 18 20 23 25 31 33 37 39 45 53 54 55 56 57 58 59 72 74 83 85 95 scan 99 sort 0} +do_test where7-2.297.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=95 + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR b=594 + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + } +} {5 7 18 20 23 25 31 33 37 39 45 53 54 55 56 57 58 59 72 74 83 85 95 scan 0 sort 0} +do_test where7-2.298.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=949 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR (g='vutsrqp' AND f GLOB 'opqrs*') + } +} {5 14 scan 0 sort 0} +do_test where7-2.298.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=949 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR (g='vutsrqp' AND f GLOB 'opqrs*') + } +} {5 14 scan 0 sort 0} +do_test where7-2.299.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=960 + OR a=44 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR a=39 + OR b=828 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR d<0.0 + OR b=770 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR b=594 + OR ((a BETWEEN 89 AND 91) AND a!=90) + } +} {3 5 6 18 39 44 54 70 89 91 96 scan 0 sort 0} +do_test where7-2.299.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=960 + OR a=44 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR a=39 + OR b=828 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR d<0.0 + OR b=770 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR b=594 + OR ((a BETWEEN 89 AND 91) AND a!=90) + } +} {3 5 6 18 39 44 54 70 89 91 96 scan 0 sort 0} +do_test where7-2.300.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 40 AND 42) AND a!=41) + OR b=198 + OR a=51 + OR b=1056 + OR b=748 + OR ((a BETWEEN 9 AND 11) AND a!=10) + } +} {9 11 18 40 42 51 68 96 scan 0 sort 0} +do_test where7-2.300.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 40 AND 42) AND a!=41) + OR b=198 + OR a=51 + OR b=1056 + OR b=748 + OR ((a BETWEEN 9 AND 11) AND a!=10) + } +} {9 11 18 40 42 51 68 96 scan 0 sort 0} +do_test where7-2.301.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1081 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=1004 + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR ((a BETWEEN 29 AND 31) AND a!=30) + OR b=660 + OR b=957 + OR b=869 + } +} {29 31 60 66 68 79 87 91 scan 0 sort 0} +do_test where7-2.301.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1081 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=1004 + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR ((a BETWEEN 29 AND 31) AND a!=30) + OR b=660 + OR b=957 + OR b=869 + } +} {29 31 60 66 68 79 87 91 scan 0 sort 0} +do_test where7-2.302.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=927 + OR c=12012 + OR f='yzabcdefg' + OR b=880 + OR a=63 + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR (g='hgfedcb' AND f GLOB 'ijklm*') + } +} {24 34 35 36 44 50 58 63 76 80 86 scan 0 sort 0} +do_test where7-2.302.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=927 + OR c=12012 + OR f='yzabcdefg' + OR b=880 + OR a=63 + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR (g='hgfedcb' AND f GLOB 'ijklm*') + } +} {24 34 35 36 44 50 58 63 76 80 86 scan 0 sort 0} +do_test where7-2.303.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=69 + OR b=1103 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR f='wxyzabcde' + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR (g='gfedcba' AND f GLOB 'klmno*') + OR f='pqrstuvwx' + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR a=59 + OR b=946 + } +} {15 18 22 26 41 44 48 52 59 67 69 70 73 74 78 86 88 93 96 100 scan 0 sort 0} +do_test where7-2.303.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=69 + OR b=1103 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR f='wxyzabcde' + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR (g='gfedcba' AND f GLOB 'klmno*') + OR f='pqrstuvwx' + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR a=59 + OR b=946 + } +} {15 18 22 26 41 44 48 52 59 67 69 70 73 74 78 86 88 93 96 100 scan 0 sort 0} +do_test where7-2.304.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR a=68 + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 47 68 75 scan 0 sort 0} +do_test where7-2.304.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR a=68 + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 47 68 75 scan 0 sort 0} +do_test where7-2.305.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=10.0 AND d<11.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'lmnop*') + } +} {10 63 scan 0 sort 0} +do_test where7-2.305.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=10.0 AND d<11.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'lmnop*') + } +} {10 63 scan 0 sort 0} +do_test where7-2.306.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=32 + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR c=7007 + OR b=968 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + } +} {15 17 18 19 20 21 32 86 88 92 94 scan 0 sort 0} +do_test where7-2.306.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=32 + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR c=7007 + OR b=968 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + } +} {15 17 18 19 20 21 32 86 88 92 94 scan 0 sort 0} +do_test where7-2.307.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='cdefghijk' + OR b=1103 + } +} {2 28 54 80 scan 0 sort 0} +do_test where7-2.307.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='cdefghijk' + OR b=1103 + } +} {2 28 54 80 scan 0 sort 0} +do_test where7-2.308.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR c=14014 + OR b=990 + OR (g='nmlkjih' AND f GLOB 'efghi*') + OR c=14014 + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR b=740 + OR c=3003 + } +} {7 8 9 13 14 21 23 40 41 42 56 90 scan 0 sort 0} +do_test where7-2.308.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR c=14014 + OR b=990 + OR (g='nmlkjih' AND f GLOB 'efghi*') + OR c=14014 + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR b=740 + OR c=3003 + } +} {7 8 9 13 14 21 23 40 41 42 56 90 scan 0 sort 0} +do_test where7-2.309.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR a=67 + OR b=135 + OR f='bcdefghij' + OR b=924 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + } +} {1 22 27 53 60 67 79 84 scan 0 sort 0} +do_test where7-2.309.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR a=67 + OR b=135 + OR f='bcdefghij' + OR b=924 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + } +} {1 22 27 53 60 67 79 84 scan 0 sort 0} +do_test where7-2.310.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=96 + OR a=13 + } +} {13 96 scan 0 sort 0} +do_test where7-2.310.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=96 + OR a=13 + } +} {13 96 scan 0 sort 0} +do_test where7-2.311.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 34 AND 36) AND a!=35) + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR ((a BETWEEN 35 AND 37) AND a!=36) + OR a=49 + OR a=38 + OR b=157 + OR a=4 + OR b=311 + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR b=396 + } +} {4 27 34 35 36 37 38 49 50 97 99 scan 0 sort 0} +do_test where7-2.311.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 34 AND 36) AND a!=35) + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR ((a BETWEEN 35 AND 37) AND a!=36) + OR a=49 + OR a=38 + OR b=157 + OR a=4 + OR b=311 + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR b=396 + } +} {4 27 34 35 36 37 38 49 50 97 99 scan 0 sort 0} +do_test where7-2.312.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=82 + OR b=333 + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR b=99 + OR a=63 + OR a=35 + OR b=176 + } +} {9 16 22 35 48 63 74 82 100 scan 0 sort 0} +do_test where7-2.312.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=82 + OR b=333 + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR b=99 + OR a=63 + OR a=35 + OR b=176 + } +} {9 16 22 35 48 63 74 82 100 scan 0 sort 0} +do_test where7-2.313.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=90 + OR a=81 + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR f='mnopqrstu' + OR b=927 + OR b=311 + OR a=34 + OR b=715 + OR f='rstuvwxyz' + } +} {12 17 34 38 43 51 53 64 65 69 81 90 95 scan 0 sort 0} +do_test where7-2.313.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=90 + OR a=81 + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR f='mnopqrstu' + OR b=927 + OR b=311 + OR a=34 + OR b=715 + OR f='rstuvwxyz' + } +} {12 17 34 38 43 51 53 64 65 69 81 90 95 scan 0 sort 0} +do_test where7-2.314.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=484 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR f='lmnopqrst' + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR b<0 + OR b=231 + OR a=14 + } +} {7 10 11 12 14 21 37 39 44 63 64 89 scan 0 sort 0} +do_test where7-2.314.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=484 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR f='lmnopqrst' + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR b<0 + OR b=231 + OR a=14 + } +} {7 10 11 12 14 21 37 39 44 63 64 89 scan 0 sort 0} +do_test where7-2.315.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=905 + OR f='hijklmnop' + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR b=817 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + } +} {7 11 20 22 26 33 37 45 59 63 80 85 89 scan 0 sort 0} +do_test where7-2.315.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=905 + OR f='hijklmnop' + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR b=817 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + } +} {7 11 20 22 26 33 37 45 59 63 80 85 89 scan 0 sort 0} +do_test where7-2.316.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR b=311 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR a=48 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR c=32032 + OR f='opqrstuvw' + OR b=300 + OR b=1001 + OR ((a BETWEEN 94 AND 96) AND a!=95) + } +} {14 40 43 47 48 61 66 85 91 92 94 95 96 scan 0 sort 0} +do_test where7-2.316.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR b=311 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR a=48 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR c=32032 + OR f='opqrstuvw' + OR b=300 + OR b=1001 + OR ((a BETWEEN 94 AND 96) AND a!=95) + } +} {14 40 43 47 48 61 66 85 91 92 94 95 96 scan 0 sort 0} +do_test where7-2.317.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=95.0 AND d<96.0 AND d NOT NULL) + OR b=1070 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR a=22 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR f='tuvwxyzab' + OR a=72 + OR ((a BETWEEN 53 AND 55) AND a!=54) + } +} {11 19 22 45 53 55 61 71 72 95 97 99 scan 0 sort 0} +do_test where7-2.317.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=95.0 AND d<96.0 AND d NOT NULL) + OR b=1070 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR a=22 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR f='tuvwxyzab' + OR a=72 + OR ((a BETWEEN 53 AND 55) AND a!=54) + } +} {11 19 22 45 53 55 61 71 72 95 97 99 scan 0 sort 0} +do_test where7-2.318.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR a=21 + OR b=1026 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR b=473 + } +} {8 16 21 34 36 43 scan 0 sort 0} +do_test where7-2.318.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR a=21 + OR b=1026 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR b=473 + } +} {8 16 21 34 36 43 scan 0 sort 0} +do_test where7-2.319.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR a=100 + OR a=29 + OR c=15015 + OR a=87 + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {29 43 44 45 71 73 87 88 100 scan 0 sort 0} +do_test where7-2.319.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR a=100 + OR a=29 + OR c=15015 + OR a=87 + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {29 43 44 45 71 73 87 88 100 scan 0 sort 0} +do_test where7-2.320.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=1.0 AND d<2.0 AND d NOT NULL) + OR b=542 + OR b=638 + } +} {1 58 scan 0 sort 0} +do_test where7-2.320.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=1.0 AND d<2.0 AND d NOT NULL) + OR b=542 + OR b=638 + } +} {1 58 scan 0 sort 0} +do_test where7-2.321.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 5 AND 7) AND a!=6) + OR b=1070 + OR a=91 + OR b=1015 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR ((a BETWEEN 91 AND 93) AND a!=92) + } +} {5 7 12 80 91 93 scan 0 sort 0} +do_test where7-2.321.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 5 AND 7) AND a!=6) + OR b=1070 + OR a=91 + OR b=1015 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR ((a BETWEEN 91 AND 93) AND a!=92) + } +} {5 7 12 80 91 93 scan 0 sort 0} +do_test where7-2.322.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=7 + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR b=1015 + OR b=839 + OR (g='rqponml' AND f GLOB 'klmno*') + OR b=410 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR a=71 + } +} {1 2 7 28 36 54 71 80 scan 0 sort 0} +do_test where7-2.322.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=7 + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR b=1015 + OR b=839 + OR (g='rqponml' AND f GLOB 'klmno*') + OR b=410 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR a=71 + } +} {1 2 7 28 36 54 71 80 scan 0 sort 0} +do_test where7-2.323.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=880 + OR b=982 + OR a=52 + OR (g='onmlkji' AND f GLOB 'abcde*') + OR a=24 + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + } +} {24 47 49 50 52 60 76 80 scan 0 sort 0} +do_test where7-2.323.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=880 + OR b=982 + OR a=52 + OR (g='onmlkji' AND f GLOB 'abcde*') + OR a=24 + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + } +} {24 47 49 50 52 60 76 80 scan 0 sort 0} +do_test where7-2.324.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 67 AND 69) AND a!=68) + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + } +} {5 22 31 57 67 69 83 scan 0 sort 0} +do_test where7-2.324.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 67 AND 69) AND a!=68) + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + } +} {5 22 31 57 67 69 83 scan 0 sort 0} +do_test where7-2.325.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='abcdefghi' + OR a=5 + OR b=124 + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=432 + OR 1000000=45.0 AND d<46.0 AND d NOT NULL) + OR b=77 + OR b=605 + } +} {5 7 26 45 52 55 58 69 78 scan 0 sort 0} +do_test where7-2.325.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='abcdefghi' + OR a=5 + OR b=124 + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=432 + OR 1000000=45.0 AND d<46.0 AND d NOT NULL) + OR b=77 + OR b=605 + } +} {5 7 26 45 52 55 58 69 78 scan 0 sort 0} +do_test where7-2.326.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=583 + OR a=62 + } +} {53 62 89 scan 0 sort 0} +do_test where7-2.326.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=583 + OR a=62 + } +} {53 62 89 scan 0 sort 0} +do_test where7-2.327.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR f='pqrstuvwx' + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR b=278 + OR a=10 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR f='uvwxyzabc' + } +} {5 10 15 20 28 41 46 54 63 65 67 68 72 84 86 93 98 scan 0 sort 0} +do_test where7-2.327.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR f='pqrstuvwx' + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR b=278 + OR a=10 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR f='uvwxyzabc' + } +} {5 10 15 20 28 41 46 54 63 65 67 68 72 84 86 93 98 scan 0 sort 0} +do_test where7-2.328.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 57 AND 59) AND a!=58) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=564 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR b=77 + OR (g='nmlkjih' AND f GLOB 'efghi*') + OR b=968 + OR b=847 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {7 14 40 56 57 58 59 66 77 85 88 90 92 scan 0 sort 0} +do_test where7-2.328.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 57 AND 59) AND a!=58) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=564 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR b=77 + OR (g='nmlkjih' AND f GLOB 'efghi*') + OR b=968 + OR b=847 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (g='lkjihgf' AND f GLOB 'opqrs*') + } +} {7 14 40 56 57 58 59 66 77 85 88 90 92 scan 0 sort 0} +do_test where7-2.329.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=539 + OR b=594 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR f='abcdefghi' + OR a=6 + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR b=762 + } +} {6 17 26 49 52 54 63 65 78 scan 0 sort 0} +do_test where7-2.329.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=539 + OR b=594 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR f='abcdefghi' + OR a=6 + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR b=762 + } +} {6 17 26 49 52 54 63 65 78 scan 0 sort 0} +do_test where7-2.330.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=869 + OR b=630 + } +} {79 scan 0 sort 0} +do_test where7-2.330.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=869 + OR b=630 + } +} {79 scan 0 sort 0} +do_test where7-2.331.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) + OR b=693 + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR b=968 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR b=132 + OR f='nopqrstuv' + OR ((a BETWEEN 28 AND 30) AND a!=29) + } +} {12 13 28 30 39 63 65 72 86 88 91 scan 0 sort 0} +do_test where7-2.331.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) + OR b=693 + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR b=968 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR b=132 + OR f='nopqrstuv' + OR ((a BETWEEN 28 AND 30) AND a!=29) + } +} {12 13 28 30 39 63 65 72 86 88 91 scan 0 sort 0} +do_test where7-2.332.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=32032 + OR b=814 + OR (d>=90.0 AND d<91.0 AND d NOT NULL) + OR b=814 + OR a=78 + OR a=37 + } +} {37 74 78 90 94 95 96 scan 0 sort 0} +do_test where7-2.332.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=32032 + OR b=814 + OR (d>=90.0 AND d<91.0 AND d NOT NULL) + OR b=814 + OR a=78 + OR a=37 + } +} {37 74 78 90 94 95 96 scan 0 sort 0} +do_test where7-2.333.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=190 + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR b=924 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=759 + OR (g='yxwvuts' AND f GLOB 'bcdef*') + } +} {1 40 59 69 84 scan 0 sort 0} +do_test where7-2.333.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=190 + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR b=924 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=759 + OR (g='yxwvuts' AND f GLOB 'bcdef*') + } +} {1 40 59 69 84 scan 0 sort 0} +do_test where7-2.334.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=97 + OR b=201 + OR b=597 + OR a=6 + OR f='cdefghijk' + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=300 + OR b=693 + OR b=333 + OR b=740 + } +} {2 6 28 54 63 74 76 80 97 scan 0 sort 0} +do_test where7-2.334.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=97 + OR b=201 + OR b=597 + OR a=6 + OR f='cdefghijk' + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=300 + OR b=693 + OR b=333 + OR b=740 + } +} {2 6 28 54 63 74 76 80 97 scan 0 sort 0} +do_test where7-2.335.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=26026 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR c=17017 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {2 4 32 43 49 50 51 60 72 74 76 77 78 scan 0 sort 0} +do_test where7-2.335.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=26026 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR c=17017 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + } +} {2 4 32 43 49 50 51 60 72 74 76 77 78 scan 0 sort 0} +do_test where7-2.336.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=70.0 AND d<71.0 AND d NOT NULL) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=638 + OR b=495 + OR a=44 + OR b=374 + OR a=22 + OR c=12012 + } +} {13 15 22 34 35 36 44 45 58 70 scan 0 sort 0} +do_test where7-2.336.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=70.0 AND d<71.0 AND d NOT NULL) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=638 + OR b=495 + OR a=44 + OR b=374 + OR a=22 + OR c=12012 + } +} {13 15 22 34 35 36 44 45 58 70 scan 0 sort 0} +do_test where7-2.337.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=8008 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR b=300 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR a=41 + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR b=135 + OR b=605 + } +} {1 2 22 23 24 39 41 49 55 100 scan 0 sort 0} +do_test where7-2.337.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=8008 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR b=300 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR a=41 + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR b=135 + OR b=605 + } +} {1 2 22 23 24 39 41 49 55 100 scan 0 sort 0} +do_test where7-2.338.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR b=762 + OR b=484 + OR b=190 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=1023 + } +} {4 17 30 41 43 44 56 61 69 74 82 93 95 97 scan 0 sort 0} +do_test where7-2.338.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR b=762 + OR b=484 + OR b=190 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=1023 + } +} {4 17 30 41 43 44 56 61 69 74 82 93 95 97 scan 0 sort 0} +do_test where7-2.339.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'efghi*') + OR a=34 + OR f='rstuvwxyz' + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=729 + } +} {10 17 34 43 69 82 95 scan 0 sort 0} +do_test where7-2.339.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'efghi*') + OR a=34 + OR f='rstuvwxyz' + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=729 + } +} {10 17 34 43 69 82 95 scan 0 sort 0} +do_test where7-2.340.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=1004 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR g IS NULL + } +} {37 41 scan 0 sort 0} +do_test where7-2.340.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=1004 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR g IS NULL + } +} {37 41 scan 0 sort 0} +do_test where7-2.341.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=73 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR a=9 + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR a=44 + OR a=23 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR (g='rqponml' AND f GLOB 'lmnop*') + } +} {1 9 23 36 37 38 44 51 53 55 63 73 78 scan 0 sort 0} +do_test where7-2.341.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=73 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR a=9 + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR a=44 + OR a=23 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR (g='rqponml' AND f GLOB 'lmnop*') + } +} {1 9 23 36 37 38 44 51 53 55 63 73 78 scan 0 sort 0} +do_test where7-2.342.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=487 + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR a=11 + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR a=13 + OR a=15 + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR a=36 + } +} {11 12 13 14 15 29 36 69 71 77 78 79 scan 0 sort 0} +do_test where7-2.342.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=487 + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR a=11 + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR a=13 + OR a=15 + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR a=36 + } +} {11 12 13 14 15 29 36 69 71 77 78 79 scan 0 sort 0} +do_test where7-2.343.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=938 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=32.0 AND d<33.0 AND d NOT NULL) + OR b=245 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + } +} {32 35 54 57 59 scan 0 sort 0} +do_test where7-2.343.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=938 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=32.0 AND d<33.0 AND d NOT NULL) + OR b=245 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + } +} {32 35 54 57 59 scan 0 sort 0} +do_test where7-2.344.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1078 + OR c=19019 + OR a=38 + OR a=59 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR c=25025 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + } +} {30 32 38 51 55 56 57 59 73 74 75 76 79 95 97 98 scan 0 sort 0} +do_test where7-2.344.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1078 + OR c=19019 + OR a=38 + OR a=59 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR c=25025 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + } +} {30 32 38 51 55 56 57 59 73 74 75 76 79 95 97 98 scan 0 sort 0} +do_test where7-2.345.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='cdefghijk' + OR b=168 + OR b=561 + OR a=81 + OR a=87 + } +} {2 28 51 54 80 81 87 scan 0 sort 0} +do_test where7-2.345.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='cdefghijk' + OR b=168 + OR b=561 + OR a=81 + OR a=87 + } +} {2 28 51 54 80 81 87 scan 0 sort 0} +do_test where7-2.346.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='gfedcba' AND f GLOB 'klmno*') + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (g='rqponml' AND f GLOB 'hijkl*') + OR a=48 + OR b=113 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=880 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + } +} {9 11 20 22 33 48 53 73 80 85 87 88 scan 0 sort 0} +do_test where7-2.346.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='gfedcba' AND f GLOB 'klmno*') + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR (g='rqponml' AND f GLOB 'hijkl*') + OR a=48 + OR b=113 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=880 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + } +} {9 11 20 22 33 48 53 73 80 85 87 88 scan 0 sort 0} +do_test where7-2.347.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=517 + OR b=187 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR b=1092 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + } +} {6 17 47 84 86 scan 0 sort 0} +do_test where7-2.347.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=517 + OR b=187 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR b=1092 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + } +} {6 17 47 84 86 scan 0 sort 0} +do_test where7-2.348.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=982 + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=234 + OR c=15015 + OR a=47 + OR f='qrstuvwxy' + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR b=814 + OR b=440 + OR b=454 + } +} {16 40 42 43 44 45 47 65 68 74 94 scan 0 sort 0} +do_test where7-2.348.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=982 + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=234 + OR c=15015 + OR a=47 + OR f='qrstuvwxy' + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR b=814 + OR b=440 + OR b=454 + } +} {16 40 42 43 44 45 47 65 68 74 94 scan 0 sort 0} +do_test where7-2.349.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR c=7007 + OR b=429 + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR b=231 + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR c=22022 + OR f='bcdefghij' + } +} {1 19 20 21 25 26 27 39 47 53 64 65 66 79 scan 0 sort 0} +do_test where7-2.349.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR c=7007 + OR b=429 + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR b=231 + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR c=22022 + OR f='bcdefghij' + } +} {1 19 20 21 25 26 27 39 47 53 64 65 66 79 scan 0 sort 0} +do_test where7-2.350.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=17017 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR b=784 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR ((a BETWEEN 54 AND 56) AND a!=55) + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR f='zabcdefgh' + } +} {16 18 22 24 25 49 50 51 54 56 62 77 88 90 scan 0 sort 0} +do_test where7-2.350.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=17017 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR b=784 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR ((a BETWEEN 54 AND 56) AND a!=55) + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR f='zabcdefgh' + } +} {16 18 22 24 25 49 50 51 54 56 62 77 88 90 scan 0 sort 0} +do_test where7-2.351.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=344 + OR b=275 + OR c<=10 + } +} {25 scan 0 sort 0} +do_test where7-2.351.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=344 + OR b=275 + OR c<=10 + } +} {25 scan 0 sort 0} +do_test where7-2.352.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 44 AND 46) AND a!=45) + OR a=76 + OR b=154 + OR a=30 + OR c=3003 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR b=564 + OR b=55 + OR a=38 + } +} {5 7 8 9 14 23 30 38 44 46 49 75 76 88 scan 0 sort 0} +do_test where7-2.352.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 44 AND 46) AND a!=45) + OR a=76 + OR b=154 + OR a=30 + OR c=3003 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR b=564 + OR b=55 + OR a=38 + } +} {5 7 8 9 14 23 30 38 44 46 49 75 76 88 scan 0 sort 0} +do_test where7-2.353.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=52 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + } +} {52 54 66 68 scan 0 sort 0} +do_test where7-2.353.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=52 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + } +} {52 54 66 68 scan 0 sort 0} +do_test where7-2.354.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=792 + OR (g='wvutsrq' AND f GLOB 'jklmn*') + } +} {9 72 scan 0 sort 0} +do_test where7-2.354.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=792 + OR (g='wvutsrq' AND f GLOB 'jklmn*') + } +} {9 72 scan 0 sort 0} +do_test where7-2.355.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=73.0 AND d<74.0 AND d NOT NULL) + OR c=21021 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR f='zabcdefgh' + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR b=781 + OR a=64 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + } +} {1 11 25 51 61 62 63 64 65 71 73 77 scan 0 sort 0} +do_test where7-2.355.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=73.0 AND d<74.0 AND d NOT NULL) + OR c=21021 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR f='zabcdefgh' + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR b=781 + OR a=64 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + } +} {1 11 25 51 61 62 63 64 65 71 73 77 scan 0 sort 0} +do_test where7-2.356.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='lkjihgf' AND f GLOB 'pqrst*') + OR (d>=90.0 AND d<91.0 AND d NOT NULL) + OR a=34 + OR (g='rqponml' AND f GLOB 'ijklm*') + OR (g='rqponml' AND f GLOB 'klmno*') + OR (g='srqponm' AND f GLOB 'defgh*') + OR b=319 + OR b=330 + OR ((a BETWEEN 28 AND 30) AND a!=29) + } +} {28 29 30 34 36 67 90 scan 0 sort 0} +do_test where7-2.356.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='lkjihgf' AND f GLOB 'pqrst*') + OR (d>=90.0 AND d<91.0 AND d NOT NULL) + OR a=34 + OR (g='rqponml' AND f GLOB 'ijklm*') + OR (g='rqponml' AND f GLOB 'klmno*') + OR (g='srqponm' AND f GLOB 'defgh*') + OR b=319 + OR b=330 + OR ((a BETWEEN 28 AND 30) AND a!=29) + } +} {28 29 30 34 36 67 90 scan 0 sort 0} +do_test where7-2.357.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR a=45 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + } +} {15 41 45 67 81 93 scan 0 sort 0} +do_test where7-2.357.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR a=45 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + } +} {15 41 45 67 81 93 scan 0 sort 0} +do_test where7-2.358.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=165 + OR b=836 + } +} {15 53 54 76 scan 0 sort 0} +do_test where7-2.358.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=165 + OR b=836 + } +} {15 53 54 76 scan 0 sort 0} +do_test where7-2.359.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1034 + OR f='vwxyzabcd' + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + } +} {21 47 57 59 73 91 94 99 scan 0 sort 0} +do_test where7-2.359.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1034 + OR f='vwxyzabcd' + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + } +} {21 47 57 59 73 91 94 99 scan 0 sort 0} +do_test where7-2.360.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=440 + OR a=19 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR c=22022 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR a=92 + OR b=1026 + OR b=608 + } +} {19 40 47 64 65 66 92 scan 0 sort 0} +do_test where7-2.360.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=440 + OR a=19 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR c=22022 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR a=92 + OR b=1026 + OR b=608 + } +} {19 40 47 64 65 66 92 scan 0 sort 0} +do_test where7-2.361.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=37 + OR b=88 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR c=23023 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR a=56 + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR f='ijklmnopq' + OR ((a BETWEEN 85 AND 87) AND a!=86) + } +} {8 13 15 16 22 34 37 42 56 60 67 68 69 85 86 87 94 scan 0 sort 0} +do_test where7-2.361.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=37 + OR b=88 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR c=23023 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR a=56 + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR f='ijklmnopq' + OR ((a BETWEEN 85 AND 87) AND a!=86) + } +} {8 13 15 16 22 34 37 42 56 60 67 68 69 85 86 87 94 scan 0 sort 0} +do_test where7-2.362.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR a=74 + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 42 AND 44) AND a!=43) + } +} {20 22 24 42 44 74 97 scan 0 sort 0} +do_test where7-2.362.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR a=74 + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 42 AND 44) AND a!=43) + } +} {20 22 24 42 44 74 97 scan 0 sort 0} +do_test where7-2.363.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='uvwxyzabc' + OR b=869 + OR ((a BETWEEN 49 AND 51) AND a!=50) + } +} {20 46 49 51 72 79 98 scan 0 sort 0} +do_test where7-2.363.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='uvwxyzabc' + OR b=869 + OR ((a BETWEEN 49 AND 51) AND a!=50) + } +} {20 46 49 51 72 79 98 scan 0 sort 0} +do_test where7-2.364.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=682 + OR b=583 + OR b=685 + OR b=817 + OR ((a BETWEEN 34 AND 36) AND a!=35) + } +} {34 36 53 62 scan 0 sort 0} +do_test where7-2.364.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=682 + OR b=583 + OR b=685 + OR b=817 + OR ((a BETWEEN 34 AND 36) AND a!=35) + } +} {34 36 53 62 scan 0 sort 0} +do_test where7-2.365.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=583 + OR a=39 + OR b=627 + OR ((a BETWEEN 72 AND 74) AND a!=73) + } +} {39 53 57 72 74 scan 0 sort 0} +do_test where7-2.365.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=583 + OR a=39 + OR b=627 + OR ((a BETWEEN 72 AND 74) AND a!=73) + } +} {39 53 57 72 74 scan 0 sort 0} +do_test where7-2.366.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR b=212 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR a=20 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b=627 + } +} {2 4 20 24 26 53 57 68 73 scan 0 sort 0} +do_test where7-2.366.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR b=212 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR a=20 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b=627 + } +} {2 4 20 24 26 53 57 68 73 scan 0 sort 0} +do_test where7-2.367.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=157 + OR b=1026 + } +} {8 34 60 77 86 scan 0 sort 0} +do_test where7-2.367.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=157 + OR b=1026 + } +} {8 34 60 77 86 scan 0 sort 0} +do_test where7-2.368.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=553 + OR a=16 + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='wvutsrq' AND f GLOB 'lmnop*') + OR f='zabcdefgh' + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {5 11 16 25 31 33 51 67 77 80 82 scan 0 sort 0} +do_test where7-2.368.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=553 + OR a=16 + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='wvutsrq' AND f GLOB 'lmnop*') + OR f='zabcdefgh' + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {5 11 16 25 31 33 51 67 77 80 82 scan 0 sort 0} +do_test where7-2.369.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=858 + OR c=9009 + OR b=792 + OR b=88 + OR b=154 + } +} {8 14 25 26 27 72 78 scan 0 sort 0} +do_test where7-2.369.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=858 + OR c=9009 + OR b=792 + OR b=88 + OR b=154 + } +} {8 14 25 26 27 72 78 scan 0 sort 0} +do_test where7-2.370.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f IS NULL + OR a=37 + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR b=168 + OR b=22 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=506 + } +} {2 21 37 46 48 55 57 scan 0 sort 0} +do_test where7-2.370.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f IS NULL + OR a=37 + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR b=168 + OR b=22 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=506 + } +} {2 21 37 46 48 55 57 scan 0 sort 0} +do_test where7-2.371.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=29 + OR ((a BETWEEN 26 AND 28) AND a!=27) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR b=209 + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR b=146 + } +} {19 25 26 28 29 42 45 51 69 71 77 97 scan 0 sort 0} +do_test where7-2.371.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=29 + OR ((a BETWEEN 26 AND 28) AND a!=27) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR b=209 + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR b=146 + } +} {19 25 26 28 29 42 45 51 69 71 77 97 scan 0 sort 0} +do_test where7-2.372.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=63 + OR a=69 + OR b=333 + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + OR b=135 + OR b=25 + OR b=1037 + OR b=682 + OR c=27027 + OR a=46 + } +} {6 46 62 63 69 79 80 81 scan 0 sort 0} +do_test where7-2.372.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=63 + OR a=69 + OR b=333 + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + OR b=135 + OR b=25 + OR b=1037 + OR b=682 + OR c=27027 + OR a=46 + } +} {6 46 62 63 69 79 80 81 scan 0 sort 0} +do_test where7-2.373.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='edcbazy' AND f GLOB 'wxyza*') + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR b=113 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {40 42 52 53 55 59 61 100 scan 0 sort 0} +do_test where7-2.373.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='edcbazy' AND f GLOB 'wxyza*') + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR b=113 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {40 42 52 53 55 59 61 100 scan 0 sort 0} +do_test where7-2.374.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1026 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + } +} {48 scan 0 sort 0} +do_test where7-2.374.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1026 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + } +} {48 scan 0 sort 0} +do_test where7-2.375.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='rqponml' AND f GLOB 'ijklm*') + OR a=99 + OR a=100 + OR b=429 + OR b=682 + OR b=495 + OR f='efghijklm' + OR a=10 + OR f='mnopqrstu' + OR b=946 + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + } +} {4 10 12 30 34 38 39 45 56 62 64 82 86 90 95 99 100 scan 0 sort 0} +do_test where7-2.375.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='rqponml' AND f GLOB 'ijklm*') + OR a=99 + OR a=100 + OR b=429 + OR b=682 + OR b=495 + OR f='efghijklm' + OR a=10 + OR f='mnopqrstu' + OR b=946 + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + } +} {4 10 12 30 34 38 39 45 56 62 64 82 86 90 95 99 100 scan 0 sort 0} +do_test where7-2.376.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=11.0 AND d<12.0 AND d NOT NULL) + OR c=23023 + OR b=462 + OR ((a BETWEEN 17 AND 19) AND a!=18) + } +} {11 17 19 42 67 68 69 scan 0 sort 0} +do_test where7-2.376.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=11.0 AND d<12.0 AND d NOT NULL) + OR c=23023 + OR b=462 + OR ((a BETWEEN 17 AND 19) AND a!=18) + } +} {11 17 19 42 67 68 69 scan 0 sort 0} +do_test where7-2.377.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=539 + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR c=6006 + OR a=18 + OR c=24024 + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR c=19019 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR ((a BETWEEN 44 AND 46) AND a!=45) + } +} {9 11 16 17 18 38 43 44 46 49 55 56 57 70 71 72 87 scan 0 sort 0} +do_test where7-2.377.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=539 + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR c=6006 + OR a=18 + OR c=24024 + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR c=19019 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR ((a BETWEEN 44 AND 46) AND a!=45) + } +} {9 11 16 17 18 38 43 44 46 49 55 56 57 70 71 72 87 scan 0 sort 0} +do_test where7-2.378.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR a=20 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=121 + OR a=10 + OR b=792 + } +} {10 11 15 20 72 94 scan 0 sort 0} +do_test where7-2.378.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR a=20 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=121 + OR a=10 + OR b=792 + } +} {10 11 15 20 72 94 scan 0 sort 0} +do_test where7-2.379.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=99 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + } +} {9 14 40 66 85 87 92 scan 0 sort 0} +do_test where7-2.379.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=99 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + } +} {9 14 40 66 85 87 92 scan 0 sort 0} +do_test where7-2.380.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR b=715 + OR ((a BETWEEN 23 AND 25) AND a!=24) + } +} {6 23 25 32 58 65 79 81 84 scan 0 sort 0} +do_test where7-2.380.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR b=715 + OR ((a BETWEEN 23 AND 25) AND a!=24) + } +} {6 23 25 32 58 65 79 81 84 scan 0 sort 0} +do_test where7-2.381.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR a=46 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + } +} {28 46 97 scan 0 sort 0} +do_test where7-2.381.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR a=46 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + } +} {28 46 97 scan 0 sort 0} +do_test where7-2.382.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'defgh*') + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR b=1056 + OR b=146 + } +} {18 81 96 97 99 scan 0 sort 0} +do_test where7-2.382.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'defgh*') + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR b=1056 + OR b=146 + } +} {18 81 96 97 99 scan 0 sort 0} +do_test where7-2.383.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=15 + OR b=388 + OR ((a BETWEEN 82 AND 84) AND a!=83) + OR a=36 + OR b=737 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR a=75 + } +} {15 21 23 36 67 75 82 84 89 scan 0 sort 0} +do_test where7-2.383.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=15 + OR b=388 + OR ((a BETWEEN 82 AND 84) AND a!=83) + OR a=36 + OR b=737 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR a=75 + } +} {15 21 23 36 67 75 82 84 89 scan 0 sort 0} +do_test where7-2.384.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=9009 + OR a=34 + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=715 + OR b=619 + OR ((a BETWEEN 98 AND 100) AND a!=99) + } +} {16 25 26 27 34 65 95 98 100 scan 0 sort 0} +do_test where7-2.384.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=9009 + OR a=34 + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=715 + OR b=619 + OR ((a BETWEEN 98 AND 100) AND a!=99) + } +} {16 25 26 27 34 65 95 98 100 scan 0 sort 0} +do_test where7-2.385.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=61.0 AND d<62.0 AND d NOT NULL) + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=242 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=300 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR ((a BETWEEN 93 AND 95) AND a!=94) + } +} {1 11 13 21 22 24 26 27 32 34 39 41 53 61 74 76 79 93 95 scan 99 sort 0} +do_test where7-2.385.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=61.0 AND d<62.0 AND d NOT NULL) + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=242 + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=300 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR ((a BETWEEN 93 AND 95) AND a!=94) + } +} {1 11 13 21 22 24 26 27 32 34 39 41 53 61 74 76 79 93 95 scan 0 sort 0} +do_test where7-2.386.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=85 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=212 + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR b=36 + OR b=231 + OR b=1048 + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR c=19019 + } +} {21 25 27 33 43 55 56 57 69 71 85 92 scan 0 sort 0} +do_test where7-2.386.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=85 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=212 + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR b=36 + OR b=231 + OR b=1048 + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR c=19019 + } +} {21 25 27 33 43 55 56 57 69 71 85 92 scan 0 sort 0} +do_test where7-2.387.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 28 AND 30) AND a!=29) + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR b=1059 + OR b=630 + } +} {8 28 30 scan 0 sort 0} +do_test where7-2.387.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 28 AND 30) AND a!=29) + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR b=1059 + OR b=630 + } +} {8 28 30 scan 0 sort 0} +do_test where7-2.388.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='ghijklmno' + OR f='nopqrstuv' + OR b=297 + } +} {6 13 27 32 39 58 65 84 91 scan 0 sort 0} +do_test where7-2.388.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='ghijklmno' + OR f='nopqrstuv' + OR b=297 + } +} {6 13 27 32 39 58 65 84 91 scan 0 sort 0} +do_test where7-2.389.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1001 + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR a=58 + OR b=333 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR b=572 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + } +} {7 15 33 43 49 50 52 58 59 68 70 85 87 89 91 scan 0 sort 0} +do_test where7-2.389.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1001 + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR a=58 + OR b=333 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR b=572 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + } +} {7 15 33 43 49 50 52 58 59 68 70 85 87 89 91 scan 0 sort 0} +do_test where7-2.390.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1034 + OR f='lmnopqrst' + OR (g='qponmlk' AND f GLOB 'mnopq*') + } +} {11 37 38 63 89 94 scan 0 sort 0} +do_test where7-2.390.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1034 + OR f='lmnopqrst' + OR (g='qponmlk' AND f GLOB 'mnopq*') + } +} {11 37 38 63 89 94 scan 0 sort 0} +do_test where7-2.391.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=15015 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR b=58 + OR b=674 + OR b=979 + } +} {43 44 45 59 87 89 scan 0 sort 0} +do_test where7-2.391.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=15015 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR b=58 + OR b=674 + OR b=979 + } +} {43 44 45 59 87 89 scan 0 sort 0} +do_test where7-2.392.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR b=660 + OR b=341 + } +} {31 60 62 scan 0 sort 0} +do_test where7-2.392.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR b=660 + OR b=341 + } +} {31 60 62 scan 0 sort 0} +do_test where7-2.393.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=528 + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR b=630 + OR a=19 + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR f='wxyzabcde' + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR b=377 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR a=77 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + } +} {8 19 22 43 44 48 64 74 77 100 scan 0 sort 0} +do_test where7-2.393.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=528 + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR b=630 + OR a=19 + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR f='wxyzabcde' + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR b=377 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR a=77 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + } +} {8 19 22 43 44 48 64 74 77 100 scan 0 sort 0} +do_test where7-2.394.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=506 + OR a=70 + } +} {46 70 scan 0 sort 0} +do_test where7-2.394.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=506 + OR a=70 + } +} {46 70 scan 0 sort 0} +do_test where7-2.395.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=64 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'cdefg*') + OR c=14014 + OR b=586 + OR c=27027 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + } +} {26 28 40 41 42 52 57 64 74 78 79 80 81 86 scan 0 sort 0} +do_test where7-2.395.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=64 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'cdefg*') + OR c=14014 + OR b=586 + OR c=27027 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + } +} {26 28 40 41 42 52 57 64 74 78 79 80 81 86 scan 0 sort 0} +do_test where7-2.396.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=46 + OR b=297 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR b=275 + OR b=91 + OR b=1015 + OR c=12012 + OR a=23 + OR b=278 + } +} {23 25 27 34 35 36 46 57 59 75 scan 0 sort 0} +do_test where7-2.396.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=46 + OR b=297 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR b=275 + OR b=91 + OR b=1015 + OR c=12012 + OR a=23 + OR b=278 + } +} {23 25 27 34 35 36 46 57 59 75 scan 0 sort 0} +do_test where7-2.397.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR a=23 + OR b=737 + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR ((a BETWEEN 68 AND 70) AND a!=69) + } +} {18 20 23 25 27 61 67 68 69 70 71 98 scan 0 sort 0} +do_test where7-2.397.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR a=23 + OR b=737 + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR ((a BETWEEN 68 AND 70) AND a!=69) + } +} {18 20 23 25 27 61 67 68 69 70 71 98 scan 0 sort 0} +do_test where7-2.398.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=814 + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR b=377 + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + } +} {71 74 79 scan 0 sort 0} +do_test where7-2.398.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=814 + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR b=377 + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + } +} {71 74 79 scan 0 sort 0} +do_test where7-2.399.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=18 + OR b=1059 + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=795 + } +} {9 18 25 46 51 53 77 scan 0 sort 0} +do_test where7-2.399.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=18 + OR b=1059 + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=795 + } +} {9 18 25 46 51 53 77 scan 0 sort 0} +do_test where7-2.400.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR a=93 + OR a=11 + OR f='nopqrstuv' + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR a=17 + OR b=366 + } +} {11 13 17 22 24 27 37 39 63 65 89 91 93 scan 0 sort 0} +do_test where7-2.400.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR a=93 + OR a=11 + OR f='nopqrstuv' + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR a=17 + OR b=366 + } +} {11 13 17 22 24 27 37 39 63 65 89 91 93 scan 0 sort 0} +do_test where7-2.401.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=685 + OR a=33 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR (g='rqponml' AND f GLOB 'lmnop*') + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR b=715 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR a=6 + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {6 16 33 37 39 40 41 42 59 61 65 80 82 93 95 scan 0 sort 0} +do_test where7-2.401.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=685 + OR a=33 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR (g='rqponml' AND f GLOB 'lmnop*') + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR b=715 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR a=6 + OR ((a BETWEEN 59 AND 61) AND a!=60) + } +} {6 16 33 37 39 40 41 42 59 61 65 80 82 93 95 scan 0 sort 0} +do_test where7-2.402.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=89 + OR b=1037 + OR (g='mlkjihg' AND f GLOB 'ijklm*') + } +} {60 89 scan 0 sort 0} +do_test where7-2.402.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=89 + OR b=1037 + OR (g='mlkjihg' AND f GLOB 'ijklm*') + } +} {60 89 scan 0 sort 0} +do_test where7-2.403.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=663 + OR b=531 + OR b=146 + OR b=102 + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR a=26 + } +} {26 28 44 46 87 89 97 scan 0 sort 0} +do_test where7-2.403.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=663 + OR b=531 + OR b=146 + OR b=102 + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR a=26 + } +} {26 28 44 46 87 89 97 scan 0 sort 0} +do_test where7-2.404.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'stuvw*') + OR (g='rqponml' AND f GLOB 'jklmn*') + OR (g='lkjihgf' AND f GLOB 'mnopq*') + OR b=726 + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR c=2002 + OR c=15015 + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR b=201 + } +} {4 5 6 12 35 43 44 45 64 66 70 73 75 scan 0 sort 0} +do_test where7-2.404.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'stuvw*') + OR (g='rqponml' AND f GLOB 'jklmn*') + OR (g='lkjihgf' AND f GLOB 'mnopq*') + OR b=726 + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR c=2002 + OR c=15015 + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR b=201 + } +} {4 5 6 12 35 43 44 45 64 66 70 73 75 scan 0 sort 0} +do_test where7-2.405.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=924 + OR f='lmnopqrst' + OR b=1048 + } +} {11 37 63 72 84 89 scan 0 sort 0} +do_test where7-2.405.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=924 + OR f='lmnopqrst' + OR b=1048 + } +} {11 37 63 72 84 89 scan 0 sort 0} +do_test where7-2.406.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=198 + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=286 + OR ((a BETWEEN 65 AND 67) AND a!=66) + } +} {12 14 18 20 22 26 58 63 65 67 scan 0 sort 0} +do_test where7-2.406.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=198 + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR ((a BETWEEN 12 AND 14) AND a!=13) + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=286 + OR ((a BETWEEN 65 AND 67) AND a!=66) + } +} {12 14 18 20 22 26 58 63 65 67 scan 0 sort 0} +do_test where7-2.407.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=242 + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR f='bcdefghij' + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=38 + OR b=187 + } +} {1 17 19 22 27 38 53 57 59 79 88 99 scan 0 sort 0} +do_test where7-2.407.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=242 + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR f='bcdefghij' + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=38 + OR b=187 + } +} {1 17 19 22 27 38 53 57 59 79 88 99 scan 0 sort 0} +do_test where7-2.408.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=630 + OR a=55 + OR c=26026 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {10 23 55 68 76 77 78 scan 0 sort 0} +do_test where7-2.408.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=630 + OR a=55 + OR c=26026 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {10 23 55 68 76 77 78 scan 0 sort 0} +do_test where7-2.409.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='uvwxyzabc' + OR f='xyzabcdef' + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=69 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + } +} {8 20 23 31 34 46 49 51 53 60 70 72 75 79 86 98 scan 0 sort 0} +do_test where7-2.409.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='uvwxyzabc' + OR f='xyzabcdef' + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=69 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + } +} {8 20 23 31 34 46 49 51 53 60 70 72 75 79 86 98 scan 0 sort 0} +do_test where7-2.410.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1026 + OR b=454 + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR b=179 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR f='qrstuvwxy' + } +} {16 26 42 52 68 78 92 94 scan 0 sort 0} +do_test where7-2.410.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1026 + OR b=454 + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR b=179 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR f='qrstuvwxy' + } +} {16 26 42 52 68 78 92 94 scan 0 sort 0} +do_test where7-2.411.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 6 AND 8) AND a!=7) + OR b=619 + OR a=20 + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR b=946 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR a=64 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR b=1001 + OR b=858 + } +} {6 8 13 17 19 20 61 64 78 86 91 scan 0 sort 0} +do_test where7-2.411.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 6 AND 8) AND a!=7) + OR b=619 + OR a=20 + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR b=946 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR a=64 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR b=1001 + OR b=858 + } +} {6 8 13 17 19 20 61 64 78 86 91 scan 0 sort 0} +do_test where7-2.412.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=902 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=86 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + } +} {27 82 86 97 scan 0 sort 0} +do_test where7-2.412.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=902 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=86 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + } +} {27 82 86 97 scan 0 sort 0} +do_test where7-2.413.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) + OR a=32 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR c=32032 + } +} {4 32 38 56 94 95 96 scan 0 sort 0} +do_test where7-2.413.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) + OR a=32 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR c=32032 + } +} {4 32 38 56 94 95 96 scan 0 sort 0} +do_test where7-2.414.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=168 + OR c=2002 + OR b=77 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR f='qrstuvwxy' + } +} {4 5 6 7 16 27 42 68 94 scan 0 sort 0} +do_test where7-2.414.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=168 + OR c=2002 + OR b=77 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR f='qrstuvwxy' + } +} {4 5 6 7 16 27 42 68 94 scan 0 sort 0} +do_test where7-2.415.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='abcdefghi' + OR b=506 + } +} {26 46 52 78 scan 0 sort 0} +do_test where7-2.415.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='abcdefghi' + OR b=506 + } +} {26 46 52 78 scan 0 sort 0} +do_test where7-2.416.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=264 + OR c=34034 + OR a=96 + } +} {24 96 100 scan 0 sort 0} +do_test where7-2.416.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=264 + OR c=34034 + OR a=96 + } +} {24 96 100 scan 0 sort 0} +do_test where7-2.417.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) + OR a=27 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + } +} {19 27 32 55 57 scan 0 sort 0} +do_test where7-2.417.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) + OR a=27 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + } +} {19 27 32 55 57 scan 0 sort 0} +do_test where7-2.418.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=74.0 AND d<75.0 AND d NOT NULL) + OR b=77 + } +} {7 74 scan 0 sort 0} +do_test where7-2.418.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=74.0 AND d<75.0 AND d NOT NULL) + OR b=77 + } +} {7 74 scan 0 sort 0} +do_test where7-2.419.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=27027 + OR f='vwxyzabcd' + OR b=1048 + OR a=96 + OR a=99 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR b=561 + OR b=352 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR a=95 + } +} {18 21 32 37 47 51 56 58 73 79 80 81 95 96 99 scan 0 sort 0} +do_test where7-2.419.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=27027 + OR f='vwxyzabcd' + OR b=1048 + OR a=96 + OR a=99 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR b=561 + OR b=352 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR a=95 + } +} {18 21 32 37 47 51 56 58 73 79 80 81 95 96 99 scan 0 sort 0} +do_test where7-2.420.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=275 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR f='ghijklmno' + OR b=619 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=476 + OR a=83 + OR ((a BETWEEN 47 AND 49) AND a!=48) + } +} {6 10 12 25 32 47 49 58 83 84 91 93 99 scan 0 sort 0} +do_test where7-2.420.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=275 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR f='ghijklmno' + OR b=619 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=476 + OR a=83 + OR ((a BETWEEN 47 AND 49) AND a!=48) + } +} {6 10 12 25 32 47 49 58 83 84 91 93 99 scan 0 sort 0} +do_test where7-2.421.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=542 + OR a=17 + OR f='jklmnopqr' + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR a=23 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + } +} {5 7 9 17 23 25 35 39 61 87 scan 0 sort 0} +do_test where7-2.421.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=542 + OR a=17 + OR f='jklmnopqr' + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + OR a=23 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + } +} {5 7 9 17 23 25 35 39 61 87 scan 0 sort 0} +do_test where7-2.422.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=74.0 AND d<75.0 AND d NOT NULL) + OR b=363 + OR b=454 + } +} {33 74 scan 0 sort 0} +do_test where7-2.422.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=74.0 AND d<75.0 AND d NOT NULL) + OR b=363 + OR b=454 + } +} {33 74 scan 0 sort 0} +do_test where7-2.423.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1059 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=47 + OR b=660 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR a=84 + } +} {34 35 36 60 76 84 scan 0 sort 0} +do_test where7-2.423.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1059 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=47 + OR b=660 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR a=84 + } +} {34 35 36 60 76 84 scan 0 sort 0} +do_test where7-2.424.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='ghijklmno' + OR b=1012 + } +} {6 32 58 84 92 scan 0 sort 0} +do_test where7-2.424.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='ghijklmno' + OR b=1012 + } +} {6 32 58 84 92 scan 0 sort 0} +do_test where7-2.425.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=597 + OR f='lmnopqrst' + OR a=24 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR b=1023 + OR a=53 + OR a=78 + OR f='efghijklm' + OR (g='rqponml' AND f GLOB 'lmnop*') + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + } +} {4 11 24 30 31 33 37 53 56 63 78 82 85 89 93 96 scan 0 sort 0} +do_test where7-2.425.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=597 + OR f='lmnopqrst' + OR a=24 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR b=1023 + OR a=53 + OR a=78 + OR f='efghijklm' + OR (g='rqponml' AND f GLOB 'lmnop*') + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + } +} {4 11 24 30 31 33 37 53 56 63 78 82 85 89 93 96 scan 0 sort 0} +do_test where7-2.426.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=198 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=388 + } +} {18 94 scan 0 sort 0} +do_test where7-2.426.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=198 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=388 + } +} {18 94 scan 0 sort 0} +do_test where7-2.427.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='tuvwxyzab' + OR b=388 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR b=957 + OR b=663 + OR b=847 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + } +} {19 45 71 73 77 84 86 87 96 97 scan 0 sort 0} +do_test where7-2.427.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='tuvwxyzab' + OR b=388 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR b=957 + OR b=663 + OR b=847 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + } +} {19 45 71 73 77 84 86 87 96 97 scan 0 sort 0} +do_test where7-2.428.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=81.0 AND d<82.0 AND d NOT NULL) + OR a=56 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + } +} {56 81 84 scan 0 sort 0} +do_test where7-2.428.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=81.0 AND d<82.0 AND d NOT NULL) + OR a=56 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + } +} {56 81 84 scan 0 sort 0} +do_test where7-2.429.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c>=34035 + OR b=168 + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + } +} {1 27 53 79 89 scan 0 sort 0} +do_test where7-2.429.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c>=34035 + OR b=168 + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + } +} {1 27 53 79 89 scan 0 sort 0} +do_test where7-2.430.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 79 AND 81) AND a!=80) + OR b=564 + OR c=6006 + OR b=979 + } +} {16 17 18 79 81 89 scan 0 sort 0} +do_test where7-2.430.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 79 AND 81) AND a!=80) + OR b=564 + OR c=6006 + OR b=979 + } +} {16 17 18 79 81 89 scan 0 sort 0} +do_test where7-2.431.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR f='rstuvwxyz' + OR (g='qponmlk' AND f GLOB 'nopqr*') + } +} {17 29 39 40 43 69 95 scan 0 sort 0} +do_test where7-2.431.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR f='rstuvwxyz' + OR (g='qponmlk' AND f GLOB 'nopqr*') + } +} {17 29 39 40 43 69 95 scan 0 sort 0} +do_test where7-2.432.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=58 + OR b=484 + OR (d>=68.0 AND d<69.0 AND d NOT NULL) + OR b=671 + OR a=69 + } +} {44 61 68 69 scan 0 sort 0} +do_test where7-2.432.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=58 + OR b=484 + OR (d>=68.0 AND d<69.0 AND d NOT NULL) + OR b=671 + OR a=69 + } +} {44 61 68 69 scan 0 sort 0} +do_test where7-2.433.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='mnopqrstu' + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR b=861 + OR b=77 + OR f='qrstuvwxy' + } +} {7 12 16 38 42 64 68 73 90 94 scan 0 sort 0} +do_test where7-2.433.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='mnopqrstu' + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR b=861 + OR b=77 + OR f='qrstuvwxy' + } +} {7 12 16 38 42 64 68 73 90 94 scan 0 sort 0} +do_test where7-2.434.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=113 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=113 + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR ((a BETWEEN 62 AND 64) AND a!=63) + OR c=6006 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR b=946 + OR a=86 + } +} {4 14 16 17 18 51 62 64 86 scan 0 sort 0} +do_test where7-2.434.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=113 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=113 + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR ((a BETWEEN 62 AND 64) AND a!=63) + OR c=6006 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR b=946 + OR a=86 + } +} {4 14 16 17 18 51 62 64 86 scan 0 sort 0} +do_test where7-2.435.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR c=22022 + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR c=25025 + } +} {8 10 64 65 66 73 74 75 79 81 85 scan 0 sort 0} +do_test where7-2.435.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR c=22022 + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR c=25025 + } +} {8 10 64 65 66 73 74 75 79 81 85 scan 0 sort 0} +do_test where7-2.436.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 74 AND 76) AND a!=75) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=47 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR a=92 + OR b=795 + OR b=25 + OR c=7007 + OR a=93 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + } +} {14 18 19 20 21 40 44 46 66 74 76 92 93 95 scan 0 sort 0} +do_test where7-2.436.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 74 AND 76) AND a!=75) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=47 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR a=92 + OR b=795 + OR b=25 + OR c=7007 + OR a=93 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + } +} {14 18 19 20 21 40 44 46 66 74 76 92 93 95 scan 0 sort 0} +do_test where7-2.437.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR a=13 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR c=29029 + OR b=311 + OR b=366 + OR a=94 + OR a=72 + } +} {6 13 66 72 85 86 87 94 scan 0 sort 0} +do_test where7-2.437.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR a=13 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR c=29029 + OR b=311 + OR b=366 + OR a=94 + OR a=72 + } +} {6 13 66 72 85 86 87 94 scan 0 sort 0} +do_test where7-2.438.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=26026 + OR a=96 + OR a=22 + OR b=341 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR b=872 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR ((a BETWEEN 25 AND 27) AND a!=26) + } +} {2 22 25 27 31 76 77 78 96 scan 0 sort 0} +do_test where7-2.438.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=26026 + OR a=96 + OR a=22 + OR b=341 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR b=872 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR ((a BETWEEN 25 AND 27) AND a!=26) + } +} {2 22 25 27 31 76 77 78 96 scan 0 sort 0} +do_test where7-2.439.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=82.0 AND d<83.0 AND d NOT NULL) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=41 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR b=913 + } +} {6 23 36 41 51 63 65 82 83 scan 0 sort 0} +do_test where7-2.439.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=82.0 AND d<83.0 AND d NOT NULL) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=41 + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR b=913 + } +} {6 23 36 41 51 63 65 82 83 scan 0 sort 0} +do_test where7-2.440.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 42 AND 44) AND a!=43) + OR a=90 + } +} {42 44 90 scan 0 sort 0} +do_test where7-2.440.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 42 AND 44) AND a!=43) + OR a=90 + } +} {42 44 90 scan 0 sort 0} +do_test where7-2.441.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR b=484 + } +} {21 44 scan 0 sort 0} +do_test where7-2.441.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR b=484 + } +} {21 44 scan 0 sort 0} +do_test where7-2.442.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=377 + OR b=363 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR b=737 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR b=506 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR a=16 + } +} {16 22 25 33 46 55 57 67 100 scan 0 sort 0} +do_test where7-2.442.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=377 + OR b=363 + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR b=737 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR b=506 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR a=16 + } +} {16 22 25 33 46 55 57 67 100 scan 0 sort 0} +do_test where7-2.443.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR b=102 + OR b=212 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=487 + OR (g='ihgfedc' AND f GLOB 'efghi*') + } +} {37 77 82 scan 0 sort 0} +do_test where7-2.443.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR b=102 + OR b=212 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=487 + OR (g='ihgfedc' AND f GLOB 'efghi*') + } +} {37 77 82 scan 0 sort 0} +do_test where7-2.444.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=154 + OR a=51 + OR b=520 + } +} {14 51 scan 0 sort 0} +do_test where7-2.444.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=154 + OR a=51 + OR b=520 + } +} {14 51 scan 0 sort 0} +do_test where7-2.445.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=872 + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR b=957 + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR a=67 + OR a=72 + } +} {21 42 47 58 60 67 72 73 87 99 scan 0 sort 0} +do_test where7-2.445.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=872 + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR b=957 + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR a=67 + OR a=72 + } +} {21 42 47 58 60 67 72 73 87 99 scan 0 sort 0} +do_test where7-2.446.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=66 + OR b=102 + OR b=396 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR ((a BETWEEN 7 AND 9) AND a!=8) + OR b=759 + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR f='ghijklmno' + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + } +} {6 7 9 14 32 36 58 69 84 90 92 97 100 scan 0 sort 0} +do_test where7-2.446.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=66 + OR b=102 + OR b=396 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR ((a BETWEEN 7 AND 9) AND a!=8) + OR b=759 + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR f='ghijklmno' + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + } +} {6 7 9 14 32 36 58 69 84 90 92 97 100 scan 0 sort 0} +do_test where7-2.447.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 69 AND 71) AND a!=70) + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR a=72 + OR b=1100 + OR b=102 + OR b=135 + } +} {24 48 50 69 71 72 76 100 scan 0 sort 0} +do_test where7-2.447.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 69 AND 71) AND a!=70) + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR a=72 + OR b=1100 + OR b=102 + OR b=135 + } +} {24 48 50 69 71 72 76 100 scan 0 sort 0} +do_test where7-2.448.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=99 + OR a=76 + } +} {9 76 scan 0 sort 0} +do_test where7-2.448.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=99 + OR a=76 + } +} {9 76 scan 0 sort 0} +do_test where7-2.449.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=891 + OR b=806 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=861 + OR ((a BETWEEN 82 AND 84) AND a!=83) + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + } +} {19 34 81 82 84 85 87 scan 0 sort 0} +do_test where7-2.449.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=891 + OR b=806 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=861 + OR ((a BETWEEN 82 AND 84) AND a!=83) + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + } +} {19 34 81 82 84 85 87 scan 0 sort 0} +do_test where7-2.450.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1034 + OR b=91 + } +} {94 scan 0 sort 0} +do_test where7-2.450.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1034 + OR b=91 + } +} {94 scan 0 sort 0} +do_test where7-2.451.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=47 + OR a=91 + OR d>1e10 + OR (g='srqponm' AND f GLOB 'cdefg*') + } +} {28 91 scan 0 sort 0} +do_test where7-2.451.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=47 + OR a=91 + OR d>1e10 + OR (g='srqponm' AND f GLOB 'cdefg*') + } +} {28 91 scan 0 sort 0} +do_test where7-2.452.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1023 + OR f='zabcdefgh' + OR b=451 + OR b=443 + OR c>=34035 + OR b=58 + } +} {25 41 51 77 93 scan 0 sort 0} +do_test where7-2.452.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1023 + OR f='zabcdefgh' + OR b=451 + OR b=443 + OR c>=34035 + OR b=58 + } +} {25 41 51 77 93 scan 0 sort 0} +do_test where7-2.453.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=971 + OR b=36 + OR a=11 + OR f='hijklmnop' + } +} {7 11 33 59 85 scan 0 sort 0} +do_test where7-2.453.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=971 + OR b=36 + OR a=11 + OR f='hijklmnop' + } +} {7 11 33 59 85 scan 0 sort 0} +do_test where7-2.454.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR b=619 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR c=11011 + OR b=550 + OR b=1059 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR b=737 + } +} {3 18 29 31 32 33 50 55 67 78 81 84 91 92 93 scan 0 sort 0} +do_test where7-2.454.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR b=619 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR c=11011 + OR b=550 + OR b=1059 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR b=737 + } +} {3 18 29 31 32 33 50 55 67 78 81 84 91 92 93 scan 0 sort 0} +do_test where7-2.455.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='edcbazy' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR a=78 + OR a=27 + OR b=792 + OR b=946 + OR c=22022 + OR a=23 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=388 + } +} {13 23 27 39 59 61 64 65 66 72 78 80 86 91 99 scan 0 sort 0} +do_test where7-2.455.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='edcbazy' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR a=78 + OR a=27 + OR b=792 + OR b=946 + OR c=22022 + OR a=23 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=388 + } +} {13 23 27 39 59 61 64 65 66 72 78 80 86 91 99 scan 0 sort 0} +do_test where7-2.456.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=32032 + OR f IS NULL + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR b=825 + } +} {4 37 39 74 75 94 95 96 scan 0 sort 0} +do_test where7-2.456.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=32032 + OR f IS NULL + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR b=825 + } +} {4 37 39 74 75 94 95 96 scan 0 sort 0} +do_test where7-2.457.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=1078 + OR b=198 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR b=55 + OR b=517 + OR b=740 + } +} {5 7 18 21 47 54 67 73 84 98 99 scan 0 sort 0} +do_test where7-2.457.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=1078 + OR b=198 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR b=55 + OR b=517 + OR b=740 + } +} {5 7 18 21 47 54 67 73 84 98 99 scan 0 sort 0} +do_test where7-2.458.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'ijklm*') + OR c=25025 + OR b=550 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + } +} {8 22 50 53 73 74 75 scan 0 sort 0} +do_test where7-2.458.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'ijklm*') + OR c=25025 + OR b=550 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + } +} {8 22 50 53 73 74 75 scan 0 sort 0} +do_test where7-2.459.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=432 + OR f='opqrstuvw' + OR (g='kjihgfe' AND f GLOB 'qrstu*') + } +} {14 40 66 68 92 scan 0 sort 0} +do_test where7-2.459.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=432 + OR f='opqrstuvw' + OR (g='kjihgfe' AND f GLOB 'qrstu*') + } +} {14 40 66 68 92 scan 0 sort 0} +do_test where7-2.460.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 14 AND 16) AND a!=15) + OR b=847 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR b=583 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR b=938 + } +} {11 14 16 26 37 40 42 53 63 65 75 77 89 scan 0 sort 0} +do_test where7-2.460.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 14 AND 16) AND a!=15) + OR b=847 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR b=583 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR b=938 + } +} {11 14 16 26 37 40 42 53 63 65 75 77 89 scan 0 sort 0} +do_test where7-2.461.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=671 + OR a=56 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR b=157 + OR a=83 + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR c=21021 + OR b=319 + OR b=187 + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR b=839 + } +} {17 29 49 56 61 62 63 65 67 73 75 83 scan 0 sort 0} +do_test where7-2.461.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=671 + OR a=56 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR b=157 + OR a=83 + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR c=21021 + OR b=319 + OR b=187 + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR b=839 + } +} {17 29 49 56 61 62 63 65 67 73 75 83 scan 0 sort 0} +do_test where7-2.462.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=586 + OR d<0.0 + OR c=9009 + } +} {25 26 27 72 scan 0 sort 0} +do_test where7-2.462.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=586 + OR d<0.0 + OR c=9009 + } +} {25 26 27 72 scan 0 sort 0} +do_test where7-2.463.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=82 + OR a=34 + OR f='jklmnopqr' + OR a=82 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=454 + OR b=355 + OR c=21021 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=30 + } +} {9 16 30 34 35 61 62 63 65 82 87 scan 0 sort 0} +do_test where7-2.463.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=82 + OR a=34 + OR f='jklmnopqr' + OR a=82 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=454 + OR b=355 + OR c=21021 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=30 + } +} {9 16 30 34 35 61 62 63 65 82 87 scan 0 sort 0} +do_test where7-2.464.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 44 AND 46) AND a!=45) + OR a=53 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=594 + OR b=80 + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR d>1e10 + } +} {18 20 23 44 46 49 53 54 scan 0 sort 0} +do_test where7-2.464.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 44 AND 46) AND a!=45) + OR a=53 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=594 + OR b=80 + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR d>1e10 + } +} {18 20 23 44 46 49 53 54 scan 0 sort 0} +do_test where7-2.465.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='opqrstuvw' + OR a=7 + } +} {7 14 40 66 92 scan 0 sort 0} +do_test where7-2.465.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='opqrstuvw' + OR a=7 + } +} {7 14 40 66 92 scan 0 sort 0} +do_test where7-2.466.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=627 + OR ((a BETWEEN 75 AND 77) AND a!=76) + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR a=90 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + } +} {33 43 45 57 75 77 90 scan 0 sort 0} +do_test where7-2.466.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=627 + OR ((a BETWEEN 75 AND 77) AND a!=76) + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR a=90 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + } +} {33 43 45 57 75 77 90 scan 0 sort 0} +do_test where7-2.467.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=59 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR f='wxyzabcde' + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR a=70 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {5 9 14 16 22 23 25 48 51 59 69 70 71 74 77 100 scan 0 sort 0} +do_test where7-2.467.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=59 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR f='wxyzabcde' + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR a=70 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {5 9 14 16 22 23 25 48 51 59 69 70 71 74 77 100 scan 0 sort 0} +do_test where7-2.468.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=69 + OR (g='ihgfedc' AND f GLOB 'defgh*') + } +} {69 81 scan 0 sort 0} +do_test where7-2.468.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=69 + OR (g='ihgfedc' AND f GLOB 'defgh*') + } +} {69 81 scan 0 sort 0} +do_test where7-2.469.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=41 + OR a=43 + OR a=92 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR (g='mlkjihg' AND f GLOB 'klmno*') + } +} {41 43 62 92 95 scan 0 sort 0} +do_test where7-2.469.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=41 + OR a=43 + OR a=92 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR (g='mlkjihg' AND f GLOB 'klmno*') + } +} {41 43 62 92 95 scan 0 sort 0} +do_test where7-2.470.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=300 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR b=935 + OR b=190 + } +} {52 85 scan 0 sort 0} +do_test where7-2.470.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=300 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR b=935 + OR b=190 + } +} {52 85 scan 0 sort 0} +do_test where7-2.471.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='fghijklmn' + OR f='fghijklmn' + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR b=465 + OR b=586 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR b=88 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR b=726 + OR ((a BETWEEN 51 AND 53) AND a!=52) + } +} {4 5 8 20 30 31 32 51 53 57 66 83 scan 0 sort 0} +do_test where7-2.471.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='fghijklmn' + OR f='fghijklmn' + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR b=465 + OR b=586 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR b=88 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR b=726 + OR ((a BETWEEN 51 AND 53) AND a!=52) + } +} {4 5 8 20 30 31 32 51 53 57 66 83 scan 0 sort 0} +do_test where7-2.472.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR b=814 + OR a=20 + OR 1000000=34.0 AND d<35.0 AND d NOT NULL) + OR (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR b=814 + OR a=20 + OR 1000000=65.0 AND d<66.0 AND d NOT NULL) + OR c<=10 + OR a=92 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR ((a BETWEEN 0 AND 2) AND a!=1) + OR b=1026 + } +} {1 2 3 25 44 53 55 65 72 92 scan 0 sort 0} +do_test where7-2.473.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR c=1001 + OR b=484 + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR c<=10 + OR a=92 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR ((a BETWEEN 0 AND 2) AND a!=1) + OR b=1026 + } +} {1 2 3 25 44 53 55 65 72 92 scan 0 sort 0} +do_test where7-2.474.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=54 + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR b=993 + OR c=22022 + OR a=68 + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR a=62 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + OR b=1015 + } +} {3 29 54 55 62 64 65 66 68 81 99 scan 0 sort 0} +do_test where7-2.474.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=54 + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR b=993 + OR c=22022 + OR a=68 + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR a=62 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + OR b=1015 + } +} {3 29 54 55 62 64 65 66 68 81 99 scan 0 sort 0} +do_test where7-2.475.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=319 + OR a=50 + OR (g='srqponm' AND f GLOB 'defgh*') + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR a=96 + } +} {10 29 50 55 92 96 scan 0 sort 0} +do_test where7-2.475.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=319 + OR a=50 + OR (g='srqponm' AND f GLOB 'defgh*') + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR a=96 + } +} {10 29 50 55 92 96 scan 0 sort 0} +do_test where7-2.476.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=971 + OR c=18018 + OR b=564 + OR b=583 + OR b=80 + } +} {52 53 54 scan 0 sort 0} +do_test where7-2.476.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=971 + OR c=18018 + OR b=564 + OR b=583 + OR b=80 + } +} {52 53 54 scan 0 sort 0} +do_test where7-2.477.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=35.0 AND d<36.0 AND d NOT NULL) + OR b=1026 + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 35 scan 0 sort 0} +do_test where7-2.477.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=35.0 AND d<36.0 AND d NOT NULL) + OR b=1026 + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 35 scan 0 sort 0} +do_test where7-2.478.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR b=407 + OR b=454 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR b=627 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + } +} {9 13 34 35 37 39 46 57 61 65 87 91 scan 0 sort 0} +do_test where7-2.478.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR b=407 + OR b=454 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR b=627 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + } +} {9 13 34 35 37 39 46 57 61 65 87 91 scan 0 sort 0} +do_test where7-2.479.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) + OR c=34034 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR a=67 + } +} {6 18 20 24 26 32 58 67 79 84 100 scan 0 sort 0} +do_test where7-2.479.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) + OR c=34034 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR a=67 + } +} {6 18 20 24 26 32 58 67 79 84 100 scan 0 sort 0} +do_test where7-2.480.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=97 + OR b=575 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + } +} {1 2 4 16 42 68 81 94 97 scan 0 sort 0} +do_test where7-2.480.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=97 + OR b=575 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + } +} {1 2 4 16 42 68 81 94 97 scan 0 sort 0} +do_test where7-2.481.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=561 + OR b=773 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=201 + OR a=99 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR b=946 + OR b=993 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + } +} {19 23 36 38 46 51 86 94 99 scan 0 sort 0} +do_test where7-2.481.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=561 + OR b=773 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=201 + OR a=99 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR b=946 + OR b=993 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + } +} {19 23 36 38 46 51 86 94 99 scan 0 sort 0} +do_test where7-2.482.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=806 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR b=916 + OR b<0 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=154 + OR c=10010 + OR b=451 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + } +} {14 24 26 28 29 30 41 62 72 scan 0 sort 0} +do_test where7-2.482.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=806 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR b=916 + OR b<0 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=154 + OR c=10010 + OR b=451 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + } +} {14 24 26 28 29 30 41 62 72 scan 0 sort 0} +do_test where7-2.483.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=836 + OR d>1e10 + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR f='pqrstuvwx' + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR f='abcdefghi' + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR a=33 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR b=476 + } +} {3 5 15 19 20 21 26 33 41 52 57 67 76 78 88 90 93 scan 0 sort 0} +do_test where7-2.483.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=836 + OR d>1e10 + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR f='pqrstuvwx' + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR f='abcdefghi' + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR a=33 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR b=476 + } +} {3 5 15 19 20 21 26 33 41 52 57 67 76 78 88 90 93 scan 0 sort 0} +do_test where7-2.484.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=48 + OR a=92 + OR a=1 + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR b=905 + OR ((a BETWEEN 51 AND 53) AND a!=52) + } +} {1 4 7 28 30 37 48 51 53 56 82 92 scan 0 sort 0} +do_test where7-2.484.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=48 + OR a=92 + OR a=1 + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR b=905 + OR ((a BETWEEN 51 AND 53) AND a!=52) + } +} {1 4 7 28 30 37 48 51 53 56 82 92 scan 0 sort 0} +do_test where7-2.485.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR b=212 + OR a=42 + OR a=92 + } +} {4 17 42 92 scan 0 sort 0} +do_test where7-2.485.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR b=212 + OR a=42 + OR a=92 + } +} {4 17 42 92 scan 0 sort 0} +do_test where7-2.486.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=740 + OR b=564 + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR a=11 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR b=322 + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR b=902 + OR c>=34035 + } +} {6 11 22 44 46 51 82 scan 0 sort 0} +do_test where7-2.486.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=740 + OR b=564 + OR (g='onmlkji' AND f GLOB 'zabcd*') + OR a=11 + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR b=322 + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR b=902 + OR c>=34035 + } +} {6 11 22 44 46 51 82 scan 0 sort 0} +do_test where7-2.487.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 52 AND 54) AND a!=53) + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR a=27 + OR a=48 + OR b=927 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR f='abcdefghi' + OR b=91 + OR b=55 + } +} {5 8 26 27 48 52 54 56 58 78 89 91 96 scan 0 sort 0} +do_test where7-2.487.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 52 AND 54) AND a!=53) + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR a=27 + OR a=48 + OR b=927 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='fedcbaz' AND f GLOB 'stuvw*') + OR f='abcdefghi' + OR b=91 + OR b=55 + } +} {5 8 26 27 48 52 54 56 58 78 89 91 96 scan 0 sort 0} +do_test where7-2.488.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='srqponm' AND f GLOB 'efghi*') + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR a=20 + OR b=11 + } +} {1 20 30 88 90 scan 0 sort 0} +do_test where7-2.488.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='srqponm' AND f GLOB 'efghi*') + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR a=20 + OR b=11 + } +} {1 20 30 88 90 scan 0 sort 0} +do_test where7-2.489.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=55 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR (g='onmlkji' AND f GLOB 'abcde*') + OR a=50 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + } +} {5 13 27 50 51 52 64 73 scan 0 sort 0} +do_test where7-2.489.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=55 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR (g='onmlkji' AND f GLOB 'abcde*') + OR a=50 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + } +} {5 13 27 50 51 52 64 73 scan 0 sort 0} +do_test where7-2.490.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='rqponml' AND f GLOB 'ijklm*') + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + } +} {22 34 48 74 100 scan 0 sort 0} +do_test where7-2.490.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='rqponml' AND f GLOB 'ijklm*') + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + } +} {22 34 48 74 100 scan 0 sort 0} +do_test where7-2.491.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=704 + OR b=924 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR b=113 + } +} {64 84 90 scan 0 sort 0} +do_test where7-2.491.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=704 + OR b=924 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR b=113 + } +} {64 84 90 scan 0 sort 0} +do_test where7-2.492.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 20 AND 22) AND a!=21) + OR b=289 + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 20 22 scan 0 sort 0} +do_test where7-2.492.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 20 AND 22) AND a!=21) + OR b=289 + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 20 22 scan 0 sort 0} +do_test where7-2.493.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=935 + OR b=1001 + OR ((a BETWEEN 78 AND 80) AND a!=79) + OR a=31 + OR a=56 + } +} {31 56 78 80 85 91 scan 0 sort 0} +do_test where7-2.493.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=935 + OR b=1001 + OR ((a BETWEEN 78 AND 80) AND a!=79) + OR a=31 + OR a=56 + } +} {31 56 78 80 85 91 scan 0 sort 0} +do_test where7-2.494.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=726 + OR f='abcdefghi' + OR b=179 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=539 + OR b=66 + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {6 9 19 26 35 49 52 60 61 66 78 86 87 88 scan 0 sort 0} +do_test where7-2.494.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=726 + OR f='abcdefghi' + OR b=179 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=539 + OR b=66 + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {6 9 19 26 35 49 52 60 61 66 78 86 87 88 scan 0 sort 0} +do_test where7-2.495.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=179 + OR b=685 + } +} { scan 0 sort 0} +do_test where7-2.495.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=179 + OR b=685 + } +} { scan 0 sort 0} +do_test where7-2.496.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=201 + OR b=682 + OR b=443 + OR b=836 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR b=110 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + } +} {2 10 11 13 28 39 51 53 54 62 65 76 80 91 scan 0 sort 0} +do_test where7-2.496.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=201 + OR b=682 + OR b=443 + OR b=836 + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR ((a BETWEEN 51 AND 53) AND a!=52) + OR b=110 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + } +} {2 10 11 13 28 39 51 53 54 62 65 76 80 91 scan 0 sort 0} +do_test where7-2.497.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR b=462 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR a=22 + OR b=594 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='mlkjihg' AND f GLOB 'jklmn*') + } +} {4 6 18 22 24 42 44 50 54 57 61 70 74 76 96 scan 0 sort 0} +do_test where7-2.497.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR b=462 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR a=22 + OR b=594 + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='mlkjihg' AND f GLOB 'jklmn*') + } +} {4 6 18 22 24 42 44 50 54 57 61 70 74 76 96 scan 0 sort 0} +do_test where7-2.498.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'wxyza*') + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR f='vwxyzabcd' + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR a=37 + OR a=50 + } +} {1 10 13 21 22 37 47 50 73 99 scan 0 sort 0} +do_test where7-2.498.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'wxyza*') + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR f='vwxyzabcd' + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR a=37 + OR a=50 + } +} {1 10 13 21 22 37 47 50 73 99 scan 0 sort 0} +do_test where7-2.499.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 83 AND 85) AND a!=84) + OR b=784 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + OR b=825 + OR a=80 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=531 + OR a=100 + } +} {20 23 46 72 75 80 83 85 97 98 100 scan 0 sort 0} +do_test where7-2.499.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 83 AND 85) AND a!=84) + OR b=784 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + OR b=825 + OR a=80 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=531 + OR a=100 + } +} {20 23 46 72 75 80 83 85 97 98 100 scan 0 sort 0} +do_test where7-2.500.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=220 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {19 20 53 scan 0 sort 0} +do_test where7-2.500.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') + OR b=220 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {19 20 53 scan 0 sort 0} +do_test where7-2.501.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=92 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR b=990 + } +} {9 90 92 scan 0 sort 0} +do_test where7-2.501.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=92 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR b=990 + } +} {9 90 92 scan 0 sort 0} +do_test where7-2.502.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 77 AND 79) AND a!=78) + OR b=894 + OR c=28028 + OR b=905 + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR b=1037 + } +} {26 45 52 70 77 78 79 82 83 84 scan 0 sort 0} +do_test where7-2.502.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 77 AND 79) AND a!=78) + OR b=894 + OR c=28028 + OR b=905 + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR b=1037 + } +} {26 45 52 70 77 78 79 82 83 84 scan 0 sort 0} +do_test where7-2.503.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) + OR b=773 + OR f='defghijkl' + } +} {3 29 55 72 81 scan 0 sort 0} +do_test where7-2.503.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) + OR b=773 + OR f='defghijkl' + } +} {3 29 55 72 81 scan 0 sort 0} +do_test where7-2.504.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=861 + OR (g='rqponml' AND f GLOB 'lmnop*') + } +} {12 37 scan 0 sort 0} +do_test where7-2.504.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=861 + OR (g='rqponml' AND f GLOB 'lmnop*') + } +} {12 37 scan 0 sort 0} +do_test where7-2.505.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=704 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=25 + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR b=487 + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + } +} {10 23 51 64 77 79 83 84 89 scan 0 sort 0} +do_test where7-2.505.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=704 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=25 + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR b=487 + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + } +} {10 23 51 64 77 79 83 84 89 scan 0 sort 0} +do_test where7-2.506.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=19 + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR b=674 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=355 + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR c=28028 + OR b=649 + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR (g='srqponm' AND f GLOB 'fghij*') + } +} {17 19 31 41 49 59 60 72 74 82 83 84 scan 0 sort 0} +do_test where7-2.506.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=19 + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR b=674 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=355 + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR c=28028 + OR b=649 + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR (g='srqponm' AND f GLOB 'fghij*') + } +} {17 19 31 41 49 59 60 72 74 82 83 84 scan 0 sort 0} +do_test where7-2.507.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 76 AND 78) AND a!=77) + OR a=1 + OR a=22 + OR b=836 + OR c=24024 + } +} {1 22 70 71 72 76 78 scan 0 sort 0} +do_test where7-2.507.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 76 AND 78) AND a!=77) + OR a=1 + OR a=22 + OR b=836 + OR c=24024 + } +} {1 22 70 71 72 76 78 scan 0 sort 0} +do_test where7-2.508.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=135 + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 39 AND 41) AND a!=40) + } +} {20 39 41 scan 0 sort 0} +do_test where7-2.508.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=135 + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 39 AND 41) AND a!=40) + } +} {20 39 41 scan 0 sort 0} +do_test where7-2.509.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'ijklm*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {9 35 61 86 87 scan 0 sort 0} +do_test where7-2.509.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'ijklm*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {9 35 61 86 87 scan 0 sort 0} +do_test where7-2.510.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'wxyza*') + OR f='ghijklmno' + } +} {6 32 58 74 84 scan 0 sort 0} +do_test where7-2.510.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'wxyza*') + OR f='ghijklmno' + } +} {6 32 58 74 84 scan 0 sort 0} +do_test where7-2.511.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=825 + OR b=902 + OR a=40 + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR a=30 + OR a=10 + OR a=73 + } +} {10 28 30 40 73 75 82 scan 0 sort 0} +do_test where7-2.511.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=825 + OR b=902 + OR a=40 + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR a=30 + OR a=10 + OR a=73 + } +} {10 28 30 40 73 75 82 scan 0 sort 0} +do_test where7-2.512.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 22 AND 24) AND a!=23) + OR a=5 + OR b=432 + OR b=979 + OR b=762 + OR b=352 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR c=27027 + OR c=20020 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {5 22 23 24 32 36 38 58 59 60 79 80 81 89 scan 0 sort 0} +do_test where7-2.512.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 22 AND 24) AND a!=23) + OR a=5 + OR b=432 + OR b=979 + OR b=762 + OR b=352 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR c=27027 + OR c=20020 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {5 22 23 24 32 36 38 58 59 60 79 80 81 89 scan 0 sort 0} +do_test where7-2.513.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR b=99 + OR a=54 + } +} {5 7 9 10 36 54 62 88 scan 0 sort 0} +do_test where7-2.513.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR b=99 + OR a=54 + } +} {5 7 9 10 36 54 62 88 scan 0 sort 0} +do_test where7-2.514.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=300 + OR (g='mlkjihg' AND f GLOB 'klmno*') + OR b=319 + OR f='fghijklmn' + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR ((a BETWEEN 42 AND 44) AND a!=43) + } +} {5 29 31 42 44 57 62 73 83 scan 0 sort 0} +do_test where7-2.514.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=300 + OR (g='mlkjihg' AND f GLOB 'klmno*') + OR b=319 + OR f='fghijklmn' + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR ((a BETWEEN 42 AND 44) AND a!=43) + } +} {5 29 31 42 44 57 62 73 83 scan 0 sort 0} +do_test where7-2.515.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=671 + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=1004 + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR b=748 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + } +} {5 7 18 20 23 27 61 68 82 86 88 scan 0 sort 0} +do_test where7-2.515.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=671 + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=1004 + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR b=748 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + } +} {5 7 18 20 23 27 61 68 82 86 88 scan 0 sort 0} +do_test where7-2.516.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=47 + OR b=784 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR a=16 + OR a=25 + OR b=572 + } +} {16 21 23 25 47 52 scan 0 sort 0} +do_test where7-2.516.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=47 + OR b=784 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR a=16 + OR a=25 + OR b=572 + } +} {16 21 23 25 47 52 scan 0 sort 0} +do_test where7-2.517.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'wxyza*') + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR b=110 + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR c=26026 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR b=850 + OR a=6 + } +} {6 10 67 69 74 76 77 78 91 scan 0 sort 0} +do_test where7-2.517.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'wxyza*') + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR b=110 + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR c=26026 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR b=850 + OR a=6 + } +} {6 10 67 69 74 76 77 78 91 scan 0 sort 0} +do_test where7-2.518.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 74 AND 76) AND a!=75) + OR ((a BETWEEN 1 AND 3) AND a!=2) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR (g='mlkjihg' AND f GLOB 'klmno*') + OR b=135 + OR a=28 + OR ((a BETWEEN 1 AND 3) AND a!=2) + OR b=737 + } +} {1 3 19 28 62 67 74 76 scan 0 sort 0} +do_test where7-2.518.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 74 AND 76) AND a!=75) + OR ((a BETWEEN 1 AND 3) AND a!=2) + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR (g='mlkjihg' AND f GLOB 'klmno*') + OR b=135 + OR a=28 + OR ((a BETWEEN 1 AND 3) AND a!=2) + OR b=737 + } +} {1 3 19 28 62 67 74 76 scan 0 sort 0} +do_test where7-2.519.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=242 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR ((a BETWEEN 20 AND 22) AND a!=21) + } +} {20 22 scan 0 sort 0} +do_test where7-2.519.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=242 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR ((a BETWEEN 20 AND 22) AND a!=21) + } +} {20 22 scan 0 sort 0} +do_test where7-2.520.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=528 + OR a=41 + OR f='cdefghijk' + OR a=98 + OR b=759 + OR a=43 + OR b=286 + OR f='hijklmnop' + } +} {2 7 26 28 33 41 43 48 54 59 69 80 85 98 scan 0 sort 0} +do_test where7-2.520.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=528 + OR a=41 + OR f='cdefghijk' + OR a=98 + OR b=759 + OR a=43 + OR b=286 + OR f='hijklmnop' + } +} {2 7 26 28 33 41 43 48 54 59 69 80 85 98 scan 0 sort 0} +do_test where7-2.521.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR a=52 + } +} {6 15 52 61 scan 0 sort 0} +do_test where7-2.521.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR a=52 + } +} {6 15 52 61 scan 0 sort 0} +do_test where7-2.522.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'abcde*') + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR a=86 + OR c=33033 + OR c=2002 + OR a=92 + } +} {2 4 5 6 78 86 92 97 98 99 scan 0 sort 0} +do_test where7-2.522.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'abcde*') + OR ((a BETWEEN 2 AND 4) AND a!=3) + OR a=86 + OR c=33033 + OR c=2002 + OR a=92 + } +} {2 4 5 6 78 86 92 97 98 99 scan 0 sort 0} +do_test where7-2.523.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 47 AND 49) AND a!=48) + OR b=517 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR (g='srqponm' AND f GLOB 'fghij*') + OR f='defghijkl' + OR b=707 + OR c>=34035 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR a=80 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {3 23 29 31 33 35 47 49 55 63 67 69 80 81 scan 0 sort 0} +do_test where7-2.523.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 47 AND 49) AND a!=48) + OR b=517 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR (g='srqponm' AND f GLOB 'fghij*') + OR f='defghijkl' + OR b=707 + OR c>=34035 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR a=80 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {3 23 29 31 33 35 47 49 55 63 67 69 80 81 scan 0 sort 0} +do_test where7-2.524.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=209 + OR b=399 + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + } +} {19 96 97 scan 0 sort 0} +do_test where7-2.524.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=209 + OR b=399 + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + } +} {19 96 97 scan 0 sort 0} +do_test where7-2.525.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 18 AND 20) AND a!=19) + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=597 + OR a=95 + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR b=432 + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + } +} {18 20 24 38 50 55 76 92 95 scan 0 sort 0} +do_test where7-2.525.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 18 AND 20) AND a!=19) + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=597 + OR a=95 + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR b=432 + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + } +} {18 20 24 38 50 55 76 92 95 scan 0 sort 0} +do_test where7-2.526.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=88.0 AND d<89.0 AND d NOT NULL) + OR b=157 + OR ((a BETWEEN 78 AND 80) AND a!=79) + OR a=3 + OR b=663 + OR a=2 + OR c=21021 + OR b=330 + OR b=231 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + } +} {2 3 21 27 30 61 62 63 78 80 88 scan 0 sort 0} +do_test where7-2.526.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=88.0 AND d<89.0 AND d NOT NULL) + OR b=157 + OR ((a BETWEEN 78 AND 80) AND a!=79) + OR a=3 + OR b=663 + OR a=2 + OR c=21021 + OR b=330 + OR b=231 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + } +} {2 3 21 27 30 61 62 63 78 80 88 scan 0 sort 0} +do_test where7-2.527.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'fghij*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR f IS NULL + } +} {64 66 83 scan 0 sort 0} +do_test where7-2.527.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'fghij*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR f IS NULL + } +} {64 66 83 scan 0 sort 0} +do_test where7-2.528.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 99 AND 101) AND a!=100) + OR (g='fedcbaz' AND f GLOB 'pqrst*') + OR 1000000=54.0 AND d<55.0 AND d NOT NULL) + OR b=814 + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR b=619 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + } +} {46 53 54 55 58 74 80 scan 0 sort 0} +do_test where7-2.530.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'defgh*') + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=784 + OR b=583 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=814 + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR b=619 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + } +} {46 53 54 55 58 74 80 scan 0 sort 0} +do_test where7-2.531.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=86 + OR b=484 + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR b=418 + OR b=509 + OR a=42 + OR b=825 + OR a=91 + OR b=1023 + OR b=814 + OR ((a BETWEEN 99 AND 101) AND a!=100) + } +} {38 42 44 74 75 79 86 91 93 99 scan 0 sort 0} +do_test where7-2.531.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=86 + OR b=484 + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR b=418 + OR b=509 + OR a=42 + OR b=825 + OR a=91 + OR b=1023 + OR b=814 + OR ((a BETWEEN 99 AND 101) AND a!=100) + } +} {38 42 44 74 75 79 86 91 93 99 scan 0 sort 0} +do_test where7-2.532.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=231 + OR a=81 + OR a=72 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR b=396 + } +} {21 24 26 36 72 81 86 scan 0 sort 0} +do_test where7-2.532.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=231 + OR a=81 + OR a=72 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR b=396 + } +} {21 24 26 36 72 81 86 scan 0 sort 0} +do_test where7-2.533.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=74.0 AND d<75.0 AND d NOT NULL) + OR a=63 + OR ((a BETWEEN 70 AND 72) AND a!=71) + OR a=71 + OR b=22 + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR a=53 + } +} {2 21 53 59 61 63 70 71 72 74 76 78 scan 0 sort 0} +do_test where7-2.533.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=74.0 AND d<75.0 AND d NOT NULL) + OR a=63 + OR ((a BETWEEN 70 AND 72) AND a!=71) + OR a=71 + OR b=22 + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR a=53 + } +} {2 21 53 59 61 63 70 71 72 74 76 78 scan 0 sort 0} +do_test where7-2.534.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=861 + OR b=649 + OR b=146 + OR f='abcdefghi' + } +} {26 52 59 78 scan 0 sort 0} +do_test where7-2.534.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=861 + OR b=649 + OR b=146 + OR f='abcdefghi' + } +} {26 52 59 78 scan 0 sort 0} +do_test where7-2.535.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR c=5005 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR a=93 + OR c=24024 + OR b=619 + OR b=234 + OR b=55 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + } +} {5 9 13 14 15 21 35 47 50 52 56 61 70 71 72 73 87 93 99 scan 0 sort 0} +do_test where7-2.535.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR c=5005 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR a=93 + OR c=24024 + OR b=619 + OR b=234 + OR b=55 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + } +} {5 9 13 14 15 21 35 47 50 52 56 61 70 71 72 73 87 93 99 scan 0 sort 0} +do_test where7-2.536.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=355 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=806 + OR b=462 + OR b=531 + OR (g='lkjihgf' AND f GLOB 'lmnop*') + OR f='mnopqrstu' + } +} {12 38 42 49 63 64 69 90 scan 0 sort 0} +do_test where7-2.536.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=355 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=806 + OR b=462 + OR b=531 + OR (g='lkjihgf' AND f GLOB 'lmnop*') + OR f='mnopqrstu' + } +} {12 38 42 49 63 64 69 90 scan 0 sort 0} +do_test where7-2.537.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR f='pqrstuvwx' + OR (g='nmlkjih' AND f GLOB 'efghi*') + OR b=495 + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR a=75 + } +} {15 41 45 56 60 62 67 70 75 93 scan 0 sort 0} +do_test where7-2.537.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR f='pqrstuvwx' + OR (g='nmlkjih' AND f GLOB 'efghi*') + OR b=495 + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR a=75 + } +} {15 41 45 56 60 62 67 70 75 93 scan 0 sort 0} +do_test where7-2.538.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'efghi*') + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=748 + OR b=913 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR a=22 + } +} {4 5 21 22 68 83 scan 0 sort 0} +do_test where7-2.538.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'efghi*') + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=748 + OR b=913 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR a=22 + } +} {4 5 21 22 68 83 scan 0 sort 0} +do_test where7-2.539.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=19 + OR b=902 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR b=168 + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR a=50 + OR f='uvwxyzabc' + OR b=836 + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR a=50 + } +} {19 20 46 50 63 65 67 72 76 77 79 82 98 scan 0 sort 0} +do_test where7-2.539.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=19 + OR b=902 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR b=168 + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR a=50 + OR f='uvwxyzabc' + OR b=836 + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR a=50 + } +} {19 20 46 50 63 65 67 72 76 77 79 82 98 scan 0 sort 0} +do_test where7-2.540.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=12012 + OR b=993 + OR b=839 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR a=87 + } +} {30 32 34 35 36 87 scan 0 sort 0} +do_test where7-2.540.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=12012 + OR b=993 + OR b=839 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR a=87 + } +} {30 32 34 35 36 87 scan 0 sort 0} +do_test where7-2.541.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=814 + OR c=30030 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR a=16 + OR b=1048 + OR b=113 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR b=729 + OR a=54 + } +} {3 16 34 40 54 61 74 88 89 90 scan 0 sort 0} +do_test where7-2.541.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=814 + OR c=30030 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR a=16 + OR b=1048 + OR b=113 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR b=729 + OR a=54 + } +} {3 16 34 40 54 61 74 88 89 90 scan 0 sort 0} +do_test where7-2.542.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=399 + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=814 + OR c=22022 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR a=1 + OR b=311 + OR b=121 + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=198 + } +} {1 6 8 11 18 32 37 58 63 64 65 66 71 74 84 89 scan 0 sort 0} +do_test where7-2.542.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=399 + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=814 + OR c=22022 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR a=1 + OR b=311 + OR b=121 + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=198 + } +} {1 6 8 11 18 32 37 58 63 64 65 66 71 74 84 89 scan 0 sort 0} +do_test where7-2.543.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=146 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR a=57 + } +} {52 57 scan 0 sort 0} +do_test where7-2.543.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=146 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR a=57 + } +} {52 57 scan 0 sort 0} +do_test where7-2.544.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) + OR f='fghijklmn' + OR a=70 + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + } +} {4 5 31 57 70 83 100 scan 0 sort 0} +do_test where7-2.544.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) + OR f='fghijklmn' + OR a=70 + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + } +} {4 5 31 57 70 83 100 scan 0 sort 0} +do_test where7-2.545.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=42 + OR b=333 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR b=1089 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR a=22 + OR b=594 + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + } +} {5 12 15 22 31 35 42 54 57 83 99 scan 0 sort 0} +do_test where7-2.545.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=42 + OR b=333 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR b=1089 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR a=22 + OR b=594 + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + } +} {5 12 15 22 31 35 42 54 57 83 99 scan 0 sort 0} +do_test where7-2.546.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=113 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR f='mnopqrstu' + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR b=902 + } +} {3 5 12 16 17 25 26 38 52 64 67 69 78 82 90 scan 0 sort 0} +do_test where7-2.546.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=113 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR f='mnopqrstu' + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR b=902 + } +} {3 5 12 16 17 25 26 38 52 64 67 69 78 82 90 scan 0 sort 0} +do_test where7-2.547.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='onmlkji' AND f GLOB 'zabcd*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR a=13 + } +} {13 15 41 51 67 93 scan 0 sort 0} +do_test where7-2.547.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='onmlkji' AND f GLOB 'zabcd*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR a=13 + } +} {13 15 41 51 67 93 scan 0 sort 0} +do_test where7-2.548.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='edcbazy' AND f GLOB 'wxyza*') + OR b=410 + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=418 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + } +} {38 65 82 88 100 scan 0 sort 0} +do_test where7-2.548.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='edcbazy' AND f GLOB 'wxyza*') + OR b=410 + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=418 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + } +} {38 65 82 88 100 scan 0 sort 0} +do_test where7-2.549.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=5 + OR a=95 + OR a=56 + OR a=46 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + } +} {5 10 41 46 56 61 95 100 scan 0 sort 0} +do_test where7-2.549.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=5 + OR a=95 + OR a=56 + OR a=46 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + } +} {5 10 41 46 56 61 95 100 scan 0 sort 0} +do_test where7-2.550.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) + OR a=13 + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR a=9 + OR a=27 + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=484 + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=594 + } +} {9 13 27 37 44 54 75 87 88 90 scan 0 sort 0} +do_test where7-2.550.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) + OR a=13 + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR a=9 + OR a=27 + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=484 + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR b=594 + } +} {9 13 27 37 44 54 75 87 88 90 scan 0 sort 0} +do_test where7-2.551.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=539 + OR b=418 + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR b=759 + } +} {15 38 49 69 scan 0 sort 0} +do_test where7-2.551.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=539 + OR b=418 + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR b=759 + } +} {15 38 49 69 scan 0 sort 0} +do_test where7-2.552.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1001 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR c=34034 + OR a=84 + } +} {8 54 84 91 100 scan 0 sort 0} +do_test where7-2.552.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1001 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR c=34034 + OR a=84 + } +} {8 54 84 91 100 scan 0 sort 0} +do_test where7-2.553.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=795 + OR b=671 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR b=322 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR c=34034 + OR b=410 + } +} {15 38 41 60 61 63 67 71 73 93 100 scan 0 sort 0} +do_test where7-2.553.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=795 + OR b=671 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR b=322 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR c=34034 + OR b=410 + } +} {15 38 41 60 61 63 67 71 73 93 100 scan 0 sort 0} +do_test where7-2.554.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=13013 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=47 + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=828 + } +} {37 38 39 42 61 69 79 94 scan 0 sort 0} +do_test where7-2.554.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=13013 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=47 + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=828 + } +} {37 38 39 42 61 69 79 94 scan 0 sort 0} +do_test where7-2.555.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=451 + OR b=836 + OR (g='onmlkji' AND f GLOB 'wxyza*') + } +} {41 48 76 scan 0 sort 0} +do_test where7-2.555.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=451 + OR b=836 + OR (g='onmlkji' AND f GLOB 'wxyza*') + } +} {41 48 76 scan 0 sort 0} +do_test where7-2.556.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=575 + OR b=748 + OR b=520 + OR b=154 + OR a=70 + OR f='efghijklm' + } +} {4 14 30 56 68 70 82 scan 0 sort 0} +do_test where7-2.556.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=575 + OR b=748 + OR b=520 + OR b=154 + OR a=70 + OR f='efghijklm' + } +} {4 14 30 56 68 70 82 scan 0 sort 0} +do_test where7-2.557.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='tuvwxyzab' + OR (g='nmlkjih' AND f GLOB 'efghi*') + } +} {19 45 56 71 97 scan 0 sort 0} +do_test where7-2.557.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='tuvwxyzab' + OR (g='nmlkjih' AND f GLOB 'efghi*') + } +} {19 45 56 71 97 scan 0 sort 0} +do_test where7-2.558.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=806 + OR a=47 + OR d<0.0 + OR b=982 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR e IS NULL + OR c=32032 + OR b=795 + } +} {2 12 47 87 94 95 96 97 99 scan 0 sort 0} +do_test where7-2.558.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=806 + OR a=47 + OR d<0.0 + OR b=982 + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR e IS NULL + OR c=32032 + OR b=795 + } +} {2 12 47 87 94 95 96 97 99 scan 0 sort 0} +do_test where7-2.559.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=62 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='edcbazy' AND f GLOB 'vwxyz*') + } +} {23 49 62 75 89 91 99 scan 0 sort 0} +do_test where7-2.559.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=62 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR (g='edcbazy' AND f GLOB 'vwxyz*') + } +} {23 49 62 75 89 91 99 scan 0 sort 0} +do_test where7-2.560.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) + OR b=1056 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR b=729 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR b=220 + OR b=498 + OR ((a BETWEEN 96 AND 98) AND a!=97) + } +} {9 20 57 73 96 98 scan 0 sort 0} +do_test where7-2.560.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) + OR b=1056 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR b=729 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR b=220 + OR b=498 + OR ((a BETWEEN 96 AND 98) AND a!=97) + } +} {9 20 57 73 96 98 scan 0 sort 0} +do_test where7-2.561.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=44 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (g='wvutsrq' AND f GLOB 'klmno*') + } +} {4 10 38 scan 0 sort 0} +do_test where7-2.561.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=44 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (g='wvutsrq' AND f GLOB 'klmno*') + } +} {4 10 38 scan 0 sort 0} +do_test where7-2.562.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=883 + OR b=311 + OR b=880 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR a=88 + OR b=154 + OR a=94 + OR a=37 + OR c=31031 + } +} {14 37 41 57 59 80 88 91 92 93 94 scan 0 sort 0} +do_test where7-2.562.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=883 + OR b=311 + OR b=880 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR a=88 + OR b=154 + OR a=94 + OR a=37 + OR c=31031 + } +} {14 37 41 57 59 80 88 91 92 93 94 scan 0 sort 0} +do_test where7-2.563.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='onmlkji' AND f GLOB 'xyzab*') + OR a=10 + OR b=190 + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR b=385 + OR a=82 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR c=22022 + } +} {8 10 35 49 55 63 64 65 66 67 69 82 90 scan 0 sort 0} +do_test where7-2.563.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='onmlkji' AND f GLOB 'xyzab*') + OR a=10 + OR b=190 + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR b=385 + OR a=82 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR c=22022 + } +} {8 10 35 49 55 63 64 65 66 67 69 82 90 scan 0 sort 0} +do_test where7-2.564.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1070 + OR a=33 + OR b=363 + OR a=47 + } +} {33 47 scan 0 sort 0} +do_test where7-2.564.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1070 + OR a=33 + OR b=363 + OR a=47 + } +} {33 47 scan 0 sort 0} +do_test where7-2.565.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=1001 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=49 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR c=33033 + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR g IS NULL + OR b=220 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + } +} {1 2 3 18 20 33 35 49 60 62 63 65 70 81 97 98 99 scan 0 sort 0} +do_test where7-2.565.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=1001 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=49 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR c=33033 + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR g IS NULL + OR b=220 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + } +} {1 2 3 18 20 33 35 49 60 62 63 65 70 81 97 98 99 scan 0 sort 0} +do_test where7-2.566.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=212 + OR b=418 + OR ((a BETWEEN 31 AND 33) AND a!=32) + } +} {31 33 38 71 scan 0 sort 0} +do_test where7-2.566.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=212 + OR b=418 + OR ((a BETWEEN 31 AND 33) AND a!=32) + } +} {31 33 38 71 scan 0 sort 0} +do_test where7-2.567.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=344 + OR f='nopqrstuv' + OR b=704 + OR a=84 + } +} {13 39 64 65 84 91 scan 0 sort 0} +do_test where7-2.567.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=344 + OR f='nopqrstuv' + OR b=704 + OR a=84 + } +} {13 39 64 65 84 91 scan 0 sort 0} +do_test where7-2.568.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 30 AND 32) AND a!=31) + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + } +} {5 30 32 scan 0 sort 0} +do_test where7-2.568.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 30 AND 32) AND a!=31) + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + } +} {5 30 32 scan 0 sort 0} +do_test where7-2.569.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'jklmn*') + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + } +} {26 52 78 87 scan 0 sort 0} +do_test where7-2.569.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'jklmn*') + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + } +} {26 52 78 87 scan 0 sort 0} +do_test where7-2.570.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 0 AND 2) AND a!=1) + OR b=1100 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR b=421 + OR b=465 + OR b=894 + OR c=13013 + OR b=47 + OR b=674 + OR ((a BETWEEN 0 AND 2) AND a!=1) + } +} {2 37 38 39 70 100 scan 0 sort 0} +do_test where7-2.570.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 0 AND 2) AND a!=1) + OR b=1100 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR b=421 + OR b=465 + OR b=894 + OR c=13013 + OR b=47 + OR b=674 + OR ((a BETWEEN 0 AND 2) AND a!=1) + } +} {2 37 38 39 70 100 scan 0 sort 0} +do_test where7-2.571.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=18018 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR b=410 + OR b=858 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + } +} {49 52 53 54 78 scan 0 sort 0} +do_test where7-2.571.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=18018 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR b=410 + OR b=858 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + } +} {49 52 53 54 78 scan 0 sort 0} +do_test where7-2.572.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ponmlkj' AND f GLOB 'vwxyz*') + OR b=781 + } +} {47 71 scan 0 sort 0} +do_test where7-2.572.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ponmlkj' AND f GLOB 'vwxyz*') + OR b=781 + } +} {47 71 scan 0 sort 0} +do_test where7-2.573.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1070 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR a=54 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR a=9 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + } +} {7 9 25 33 47 50 52 54 59 63 85 scan 0 sort 0} +do_test where7-2.573.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1070 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR a=54 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR a=9 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + } +} {7 9 25 33 47 50 52 54 59 63 85 scan 0 sort 0} +do_test where7-2.574.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=55 + OR a=62 + OR a=63 + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR (g='rqponml' AND f GLOB 'ijklm*') + OR ((a BETWEEN 99 AND 101) AND a!=100) + } +} {34 50 55 62 63 99 scan 0 sort 0} +do_test where7-2.574.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=55 + OR a=62 + OR a=63 + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR (g='rqponml' AND f GLOB 'ijklm*') + OR ((a BETWEEN 99 AND 101) AND a!=100) + } +} {34 50 55 62 63 99 scan 0 sort 0} +do_test where7-2.575.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=421 + OR b=146 + OR b=22 + OR f='efghijklm' + } +} {2 4 30 56 82 scan 0 sort 0} +do_test where7-2.575.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=421 + OR b=146 + OR b=22 + OR f='efghijklm' + } +} {2 4 30 56 82 scan 0 sort 0} +do_test where7-2.576.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=553 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=583 + OR a=56 + } +} {21 23 48 53 56 59 61 scan 0 sort 0} +do_test where7-2.576.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=553 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=583 + OR a=56 + } +} {21 23 48 53 56 59 61 scan 0 sort 0} +do_test where7-2.577.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=83 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR a=1 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=245 + } +} {1 17 19 29 49 51 77 83 scan 0 sort 0} +do_test where7-2.577.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=83 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR a=1 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=245 + } +} {1 17 19 29 49 51 77 83 scan 0 sort 0} +do_test where7-2.578.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=3003 + OR b=619 + OR ((a BETWEEN 19 AND 21) AND a!=20) + } +} {7 8 9 19 21 scan 0 sort 0} +do_test where7-2.578.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=3003 + OR b=619 + OR ((a BETWEEN 19 AND 21) AND a!=20) + } +} {7 8 9 19 21 scan 0 sort 0} +do_test where7-2.579.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=924 + OR a=92 + OR a=63 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + } +} {60 63 84 92 97 scan 0 sort 0} +do_test where7-2.579.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=924 + OR a=92 + OR a=63 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + } +} {60 63 84 92 97 scan 0 sort 0} +do_test where7-2.580.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=440 + OR f='vwxyzabcd' + OR b=190 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR b=88 + OR b=58 + } +} {8 11 21 37 40 42 47 63 73 89 99 scan 0 sort 0} +do_test where7-2.580.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=440 + OR f='vwxyzabcd' + OR b=190 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR b=88 + OR b=58 + } +} {8 11 21 37 40 42 47 63 73 89 99 scan 0 sort 0} +do_test where7-2.581.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=495 + OR c=24024 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR b=1001 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR d>1e10 + OR b=531 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR b=1089 + } +} {25 45 49 70 71 72 82 91 99 scan 0 sort 0} +do_test where7-2.581.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=495 + OR c=24024 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR b=1001 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR d>1e10 + OR b=531 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR b=1089 + } +} {25 45 49 70 71 72 82 91 99 scan 0 sort 0} +do_test where7-2.582.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + } +} {41 48 scan 0 sort 0} +do_test where7-2.582.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) + OR (d>=41.0 AND d<42.0 AND d NOT NULL) + } +} {41 48 scan 0 sort 0} +do_test where7-2.583.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR d>1e10 + OR b=22 + OR c=5005 + OR ((a BETWEEN 22 AND 24) AND a!=23) + } +} {1 2 13 14 15 22 24 52 71 73 80 82 91 93 scan 0 sort 0} +do_test where7-2.583.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR d>1e10 + OR b=22 + OR c=5005 + OR ((a BETWEEN 22 AND 24) AND a!=23) + } +} {1 2 13 14 15 22 24 52 71 73 80 82 91 93 scan 0 sort 0} +do_test where7-2.584.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 9 AND 11) AND a!=10) + OR b=1078 + OR b=806 + OR b=605 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + } +} {9 11 15 23 25 41 55 67 76 93 98 scan 0 sort 0} +do_test where7-2.584.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 9 AND 11) AND a!=10) + OR b=1078 + OR b=806 + OR b=605 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + } +} {9 11 15 23 25 41 55 67 76 93 98 scan 0 sort 0} +do_test where7-2.585.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR b=572 + OR c=10010 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=29 + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + } +} {7 28 29 30 33 52 59 68 84 85 86 scan 0 sort 0} +do_test where7-2.585.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR b=572 + OR c=10010 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=29 + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + } +} {7 28 29 30 33 52 59 68 84 85 86 scan 0 sort 0} +do_test where7-2.586.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 94 AND 96) AND a!=95) + OR b=858 + OR b=806 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + } +} {63 77 78 94 96 scan 0 sort 0} +do_test where7-2.586.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 94 AND 96) AND a!=95) + OR b=858 + OR b=806 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + } +} {63 77 78 94 96 scan 0 sort 0} +do_test where7-2.587.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='vwxyzabcd' + OR a=72 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=935 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR c=13013 + } +} {21 36 37 38 39 40 47 72 73 85 99 scan 0 sort 0} +do_test where7-2.587.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='vwxyzabcd' + OR a=72 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=935 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR c=13013 + } +} {21 36 37 38 39 40 47 72 73 85 99 scan 0 sort 0} +do_test where7-2.588.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=5005 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR b=143 + OR a=68 + OR a=77 + OR b=80 + } +} {13 14 15 43 44 68 77 88 scan 0 sort 0} +do_test where7-2.588.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=5005 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR b=143 + OR a=68 + OR a=77 + OR b=80 + } +} {13 14 15 43 44 68 77 88 scan 0 sort 0} +do_test where7-2.589.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=99 + OR ((a BETWEEN 12 AND 14) AND a!=13) + } +} {5 6 12 14 68 72 76 78 99 scan 0 sort 0} +do_test where7-2.589.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'ghijk*') + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=99 + OR ((a BETWEEN 12 AND 14) AND a!=13) + } +} {5 6 12 14 68 72 76 78 99 scan 0 sort 0} +do_test where7-2.590.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'opqrs*') + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR b=971 + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {5 13 40 88 90 scan 0 sort 0} +do_test where7-2.590.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'opqrs*') + OR ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR b=971 + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {5 13 40 88 90 scan 0 sort 0} +do_test where7-2.591.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR b=806 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR b=1015 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + } +} {10 13 36 39 43 62 65 68 70 88 91 scan 0 sort 0} +do_test where7-2.591.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR b=806 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR b=1015 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + } +} {10 13 36 39 43 62 65 68 70 88 91 scan 0 sort 0} +do_test where7-2.592.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='nopqrstuv' + OR b=993 + OR a=76 + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR c=20020 + OR a=26 + OR b=1048 + OR b=561 + OR (g='rqponml' AND f GLOB 'klmno*') + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR a=56 + } +} {13 26 36 39 51 55 56 57 58 59 60 65 76 79 91 scan 0 sort 0} +do_test where7-2.592.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='nopqrstuv' + OR b=993 + OR a=76 + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR c=20020 + OR a=26 + OR b=1048 + OR b=561 + OR (g='rqponml' AND f GLOB 'klmno*') + OR ((a BETWEEN 55 AND 57) AND a!=56) + OR a=56 + } +} {13 26 36 39 51 55 56 57 58 59 60 65 76 79 91 scan 0 sort 0} +do_test where7-2.593.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=781 + OR b=671 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=113 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=385 + OR (g='hgfedcb' AND f GLOB 'fghij*') + } +} {15 16 35 39 41 60 61 71 83 scan 0 sort 0} +do_test where7-2.593.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=781 + OR b=671 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR b=113 + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=385 + OR (g='hgfedcb' AND f GLOB 'fghij*') + } +} {15 16 35 39 41 60 61 71 83 scan 0 sort 0} +do_test where7-2.594.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=410 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=674 + OR b=825 + OR b=704 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR a=76 + OR c=32032 + OR ((a BETWEEN 43 AND 45) AND a!=44) + } +} {9 43 45 58 60 61 64 75 76 85 87 94 95 96 scan 0 sort 0} +do_test where7-2.594.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=410 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=674 + OR b=825 + OR b=704 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR a=76 + OR c=32032 + OR ((a BETWEEN 43 AND 45) AND a!=44) + } +} {9 43 45 58 60 61 64 75 76 85 87 94 95 96 scan 0 sort 0} +do_test where7-2.595.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=869 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + } +} {43 79 scan 0 sort 0} +do_test where7-2.595.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=869 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + } +} {43 79 scan 0 sort 0} +do_test where7-2.596.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=869 + OR a=34 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + } +} {34 79 87 scan 0 sort 0} +do_test where7-2.596.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=869 + OR a=34 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + } +} {34 79 87 scan 0 sort 0} +do_test where7-2.597.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='rqponml' AND f GLOB 'hijkl*') + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR a=8 + OR a=72 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {8 33 44 72 90 95 97 scan 0 sort 0} +do_test where7-2.597.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='rqponml' AND f GLOB 'hijkl*') + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR a=8 + OR a=72 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {8 33 44 72 90 95 97 scan 0 sort 0} +do_test where7-2.598.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=20 + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=341 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=814 + OR b=1026 + OR a=14 + OR a=13 + OR b=1037 + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {13 14 20 26 31 56 58 74 76 scan 0 sort 0} +do_test where7-2.598.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=20 + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=341 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=814 + OR b=1026 + OR a=14 + OR a=13 + OR b=1037 + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {13 14 20 26 31 56 58 74 76 scan 0 sort 0} +do_test where7-2.599.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=443 + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=839 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR c=7007 + } +} {10 13 19 20 21 49 51 scan 0 sort 0} +do_test where7-2.599.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=443 + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=839 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR c=7007 + } +} {10 13 19 20 21 49 51 scan 0 sort 0} +do_test where7-2.600.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR a=21 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + OR f='zabcdefgh' + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=506 + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR b=88 + OR b=190 + } +} {3 8 9 14 16 21 25 42 46 51 68 77 94 97 scan 0 sort 0} +do_test where7-2.600.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR a=21 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + OR f='zabcdefgh' + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=506 + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR b=88 + OR b=190 + } +} {3 8 9 14 16 21 25 42 46 51 68 77 94 97 scan 0 sort 0} +do_test where7-2.601.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=41.0 AND d<42.0 AND d NOT NULL) + OR f='bcdefghij' + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=762 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'yzabc*') + } +} {1 27 30 41 53 54 61 63 68 70 76 79 scan 0 sort 0} +do_test where7-2.601.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=41.0 AND d<42.0 AND d NOT NULL) + OR f='bcdefghij' + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=762 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'yzabc*') + } +} {1 27 30 41 53 54 61 63 68 70 76 79 scan 0 sort 0} +do_test where7-2.602.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=85.0 AND d<86.0 AND d NOT NULL) + OR f='qrstuvwxy' + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + } +} {16 42 56 68 85 94 scan 0 sort 0} +do_test where7-2.602.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=85.0 AND d<86.0 AND d NOT NULL) + OR f='qrstuvwxy' + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + } +} {16 42 56 68 85 94 scan 0 sort 0} +do_test where7-2.603.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR a=21 + OR b<0 + OR f='bcdefghij' + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {1 14 16 21 27 53 57 79 89 scan 0 sort 0} +do_test where7-2.603.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=89.0 AND d<90.0 AND d NOT NULL) + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR a=21 + OR b<0 + OR f='bcdefghij' + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {1 14 16 21 27 53 57 79 89 scan 0 sort 0} +do_test where7-2.604.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=1067 + OR b=231 + OR b=113 + OR b=22 + OR a=55 + OR b=663 + } +} {2 21 40 55 83 97 scan 0 sort 0} +do_test where7-2.604.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'fghij*') + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=1067 + OR b=231 + OR b=113 + OR b=22 + OR a=55 + OR b=663 + } +} {2 21 40 55 83 97 scan 0 sort 0} +do_test where7-2.605.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=1 + OR b=454 + OR b=396 + OR b=1059 + OR a=69 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR b=440 + OR b=825 + } +} {1 21 36 40 47 69 73 75 99 scan 0 sort 0} +do_test where7-2.605.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=1 + OR b=454 + OR b=396 + OR b=1059 + OR a=69 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR b=440 + OR b=825 + } +} {1 21 36 40 47 69 73 75 99 scan 0 sort 0} +do_test where7-2.606.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) + OR b=308 + OR c<=10 + OR (g='xwvutsr' AND f GLOB 'hijkl*') + OR f='ghijklmno' + OR b=289 + OR a=5 + OR b=267 + OR b=949 + OR ((a BETWEEN 7 AND 9) AND a!=8) + } +} {5 6 7 9 26 28 32 58 84 scan 0 sort 0} +do_test where7-2.606.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) + OR b=308 + OR c<=10 + OR (g='xwvutsr' AND f GLOB 'hijkl*') + OR f='ghijklmno' + OR b=289 + OR a=5 + OR b=267 + OR b=949 + OR ((a BETWEEN 7 AND 9) AND a!=8) + } +} {5 6 7 9 26 28 32 58 84 scan 0 sort 0} +do_test where7-2.607.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 95 AND 97) AND a!=96) + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR b=993 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR b=663 + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR b=869 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR b=121 + } +} {11 17 24 43 45 50 76 79 81 95 97 scan 0 sort 0} +do_test where7-2.607.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 95 AND 97) AND a!=96) + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR b=993 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR b=663 + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR b=869 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR b=121 + } +} {11 17 24 43 45 50 76 79 81 95 97 scan 0 sort 0} +do_test where7-2.608.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'efghi*') + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR b=770 + } +} {4 27 70 87 scan 0 sort 0} +do_test where7-2.608.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'efghi*') + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR b=770 + } +} {4 27 70 87 scan 0 sort 0} +do_test where7-2.609.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 80 AND 82) AND a!=81) + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {19 45 57 71 80 82 90 97 scan 0 sort 0} +do_test where7-2.609.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 80 AND 82) AND a!=81) + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {19 45 57 71 80 82 90 97 scan 0 sort 0} +do_test where7-2.610.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=22 + OR c=31031 + OR b=894 + OR a=31 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR a=94 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR a=21 + OR b=1001 + } +} {2 21 31 84 86 91 92 93 94 95 scan 0 sort 0} +do_test where7-2.610.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=22 + OR c=31031 + OR b=894 + OR a=31 + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR a=94 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR a=21 + OR b=1001 + } +} {2 21 31 84 86 91 92 93 94 95 scan 0 sort 0} +do_test where7-2.611.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='onmlkji' AND f GLOB 'zabcd*') + OR b=1092 + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR a=77 + OR a=63 + OR b=762 + OR b=894 + OR b=685 + OR (g='vutsrqp' AND f GLOB 'nopqr*') + } +} {13 46 51 63 77 80 scan 0 sort 0} +do_test where7-2.611.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='onmlkji' AND f GLOB 'zabcd*') + OR b=1092 + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR a=77 + OR a=63 + OR b=762 + OR b=894 + OR b=685 + OR (g='vutsrqp' AND f GLOB 'nopqr*') + } +} {13 46 51 63 77 80 scan 0 sort 0} +do_test where7-2.612.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'klmno*') + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=231 + } +} {10 21 93 95 scan 0 sort 0} +do_test where7-2.612.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'klmno*') + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=231 + } +} {10 21 93 95 scan 0 sort 0} +do_test where7-2.613.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=828 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + } +} {8 10 26 52 78 scan 0 sort 0} +do_test where7-2.613.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=828 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + } +} {8 10 26 52 78 scan 0 sort 0} +do_test where7-2.614.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=520 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR a=21 + } +} {4 6 13 21 31 33 39 47 50 65 91 100 scan 0 sort 0} +do_test where7-2.614.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=520 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR a=21 + } +} {4 6 13 21 31 33 39 47 50 65 91 100 scan 0 sort 0} +do_test where7-2.615.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=553 + OR (g='lkjihgf' AND f GLOB 'lmnop*') + OR b=1034 + OR b=418 + OR a=57 + OR f='mnopqrstu' + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + } +} {12 38 57 63 64 90 94 99 scan 0 sort 0} +do_test where7-2.615.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=553 + OR (g='lkjihgf' AND f GLOB 'lmnop*') + OR b=1034 + OR b=418 + OR a=57 + OR f='mnopqrstu' + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + } +} {12 38 57 63 64 90 94 99 scan 0 sort 0} +do_test where7-2.616.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=43 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR b=418 + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR b=594 + OR a=21 + OR a=78 + OR a=91 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + } +} {21 38 43 47 54 70 78 80 91 scan 0 sort 0} +do_test where7-2.616.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=43 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR b=418 + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR b=594 + OR a=21 + OR a=78 + OR a=91 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + } +} {21 38 43 47 54 70 78 80 91 scan 0 sort 0} +do_test where7-2.617.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=671 + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR ((a BETWEEN 95 AND 97) AND a!=96) + } +} {48 61 95 97 scan 0 sort 0} +do_test where7-2.617.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=671 + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR ((a BETWEEN 95 AND 97) AND a!=96) + } +} {48 61 95 97 scan 0 sort 0} +do_test where7-2.618.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) + OR b=726 + OR b=663 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR a=25 + OR f='qrstuvwxy' + } +} {2 13 16 25 42 66 68 94 scan 0 sort 0} +do_test where7-2.618.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) + OR b=726 + OR b=663 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR a=25 + OR f='qrstuvwxy' + } +} {2 13 16 25 42 66 68 94 scan 0 sort 0} +do_test where7-2.619.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=806 + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR b=275 + OR ((a BETWEEN 80 AND 82) AND a!=81) + } +} {10 12 25 50 80 82 scan 0 sort 0} +do_test where7-2.619.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=806 + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR b=275 + OR ((a BETWEEN 80 AND 82) AND a!=81) + } +} {10 12 25 50 80 82 scan 0 sort 0} +do_test where7-2.620.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=24024 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR b=429 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR b=110 + OR a=39 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + } +} {2 10 23 39 70 71 72 scan 0 sort 0} +do_test where7-2.620.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=24024 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR b=429 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR b=110 + OR a=39 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + } +} {2 10 23 39 70 71 72 scan 0 sort 0} +do_test where7-2.621.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=66 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR b=198 + OR b=682 + OR c=23023 + } +} {18 62 66 67 68 69 70 scan 0 sort 0} +do_test where7-2.621.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=66 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR b=198 + OR b=682 + OR c=23023 + } +} {18 62 66 67 68 69 70 scan 0 sort 0} +do_test where7-2.622.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=806 + OR b=253 + OR a=36 + } +} {23 36 scan 0 sort 0} +do_test where7-2.622.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=806 + OR b=253 + OR a=36 + } +} {23 36 scan 0 sort 0} +do_test where7-2.623.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=509 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR b=718 + OR a=4 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + } +} {4 13 16 22 24 56 58 69 scan 0 sort 0} +do_test where7-2.623.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=509 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (g='vutsrqp' AND f GLOB 'nopqr*') + OR b=718 + OR a=4 + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + } +} {4 13 16 22 24 56 58 69 scan 0 sort 0} +do_test where7-2.624.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR b=1026 + OR a=93 + OR c=18018 + } +} {52 53 54 77 93 scan 0 sort 0} +do_test where7-2.624.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR b=1026 + OR a=93 + OR c=18018 + } +} {52 53 54 77 93 scan 0 sort 0} +do_test where7-2.625.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=388 + OR a=44 + } +} {44 scan 0 sort 0} +do_test where7-2.625.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=388 + OR a=44 + } +} {44 scan 0 sort 0} +do_test where7-2.626.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=9009 + OR b=542 + OR f='cdefghijk' + OR b=319 + OR b=616 + } +} {2 25 26 27 28 29 54 56 80 scan 0 sort 0} +do_test where7-2.626.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=9009 + OR b=542 + OR f='cdefghijk' + OR b=319 + OR b=616 + } +} {2 25 26 27 28 29 54 56 80 scan 0 sort 0} +do_test where7-2.627.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=990 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=531 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR f='qrstuvwxy' + } +} {6 16 32 41 42 43 57 58 67 68 84 86 90 94 97 scan 0 sort 0} +do_test where7-2.627.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=990 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=531 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR f='qrstuvwxy' + } +} {6 16 32 41 42 43 57 58 67 68 84 86 90 94 97 scan 0 sort 0} +do_test where7-2.628.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=60 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR b=627 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=883 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR f='yzabcdefg' + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + } +} {24 38 50 57 59 60 73 76 78 93 99 scan 0 sort 0} +do_test where7-2.628.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=60 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR b=627 + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=883 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR f='yzabcdefg' + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + } +} {24 38 50 57 59 60 73 76 78 93 99 scan 0 sort 0} +do_test where7-2.629.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=696 + OR b=938 + OR a=18 + OR b=957 + OR c=18018 + OR c=3003 + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {7 8 9 18 33 35 52 53 54 87 scan 0 sort 0} +do_test where7-2.629.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=696 + OR b=938 + OR a=18 + OR b=957 + OR c=18018 + OR c=3003 + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {7 8 9 18 33 35 52 53 54 87 scan 0 sort 0} +do_test where7-2.630.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=29029 + OR a=73 + } +} {73 85 86 87 scan 0 sort 0} +do_test where7-2.630.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=29029 + OR a=73 + } +} {73 85 86 87 scan 0 sort 0} +do_test where7-2.631.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=28 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR b=69 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=781 + OR a=64 + OR b=91 + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR a=16 + OR b=278 + OR a=26 + } +} {16 26 27 28 64 71 82 85 87 scan 0 sort 0} +do_test where7-2.631.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=28 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR b=69 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=781 + OR a=64 + OR b=91 + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR a=16 + OR b=278 + OR a=26 + } +} {16 26 27 28 64 71 82 85 87 scan 0 sort 0} +do_test where7-2.632.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=70 + OR c=3003 + } +} {7 8 9 70 scan 0 sort 0} +do_test where7-2.632.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=70 + OR c=3003 + } +} {7 8 9 70 scan 0 sort 0} +do_test where7-2.633.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=31031 + OR a=76 + OR b=1023 + OR b=33 + } +} {3 76 91 92 93 scan 0 sort 0} +do_test where7-2.633.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=31031 + OR a=76 + OR b=1023 + OR b=33 + } +} {3 76 91 92 93 scan 0 sort 0} +do_test where7-2.634.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=1001 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {62 86 91 scan 0 sort 0} +do_test where7-2.634.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=1001 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {62 86 91 scan 0 sort 0} +do_test where7-2.635.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='yzabcdefg' + OR ((a BETWEEN 48 AND 50) AND a!=49) + OR a=100 + OR (g='rqponml' AND f GLOB 'ijklm*') + OR a=62 + OR a=67 + OR b=605 + OR c=23023 + OR a=26 + OR b=982 + OR ((a BETWEEN 3 AND 5) AND a!=4) + } +} {3 5 24 26 34 48 50 55 62 67 68 69 76 100 scan 0 sort 0} +do_test where7-2.635.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='yzabcdefg' + OR ((a BETWEEN 48 AND 50) AND a!=49) + OR a=100 + OR (g='rqponml' AND f GLOB 'ijklm*') + OR a=62 + OR a=67 + OR b=605 + OR c=23023 + OR a=26 + OR b=982 + OR ((a BETWEEN 3 AND 5) AND a!=4) + } +} {3 5 24 26 34 48 50 55 62 67 68 69 76 100 scan 0 sort 0} +do_test where7-2.636.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=220 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR f IS NULL + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR b=784 + } +} {20 24 25 26 27 scan 0 sort 0} +do_test where7-2.636.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=220 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR f IS NULL + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR b=784 + } +} {20 24 25 26 27 scan 0 sort 0} +do_test where7-2.637.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR b=751 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR a=67 + OR b=102 + } +} {10 17 43 67 69 88 95 scan 0 sort 0} +do_test where7-2.637.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR b=751 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR a=67 + OR b=102 + } +} {10 17 43 67 69 88 95 scan 0 sort 0} +do_test where7-2.638.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=69.0 AND d<70.0 AND d NOT NULL) + OR b=256 + OR c=7007 + OR c=26026 + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR a=66 + } +} {19 20 21 66 69 74 76 77 78 80 82 scan 0 sort 0} +do_test where7-2.638.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=69.0 AND d<70.0 AND d NOT NULL) + OR b=256 + OR c=7007 + OR c=26026 + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR a=66 + } +} {19 20 21 66 69 74 76 77 78 80 82 scan 0 sort 0} +do_test where7-2.639.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=2002 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR b=33 + OR b=817 + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + } +} {3 4 5 6 8 10 21 34 41 43 45 60 81 86 scan 0 sort 0} +do_test where7-2.639.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=2002 + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR b=33 + OR b=817 + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + } +} {3 4 5 6 8 10 21 34 41 43 45 60 81 86 scan 0 sort 0} +do_test where7-2.640.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='srqponm' AND f GLOB 'cdefg*') + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR a=80 + OR a=53 + OR a=62 + OR a=49 + OR a=53 + OR a=56 + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + } +} {28 49 53 56 62 80 81 83 scan 0 sort 0} +do_test where7-2.640.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='srqponm' AND f GLOB 'cdefg*') + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR a=80 + OR a=53 + OR a=62 + OR a=49 + OR a=53 + OR a=56 + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + } +} {28 49 53 56 62 80 81 83 scan 0 sort 0} +do_test where7-2.641.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 7 AND 9) AND a!=8) + OR b=652 + OR a=72 + OR b=209 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR a=38 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR d>1e10 + } +} {7 9 19 23 38 66 68 72 scan 0 sort 0} +do_test where7-2.641.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 7 AND 9) AND a!=8) + OR b=652 + OR a=72 + OR b=209 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR a=38 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR d>1e10 + } +} {7 9 19 23 38 66 68 72 scan 0 sort 0} +do_test where7-2.642.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=949 + OR e IS NULL + } +} { scan 0 sort 0} +do_test where7-2.642.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=949 + OR e IS NULL + } +} { scan 0 sort 0} +do_test where7-2.643.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=179 + OR (g='srqponm' AND f GLOB 'defgh*') + OR b=509 + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR f='bcdefghij' + } +} {1 26 27 29 49 53 58 60 79 scan 0 sort 0} +do_test where7-2.643.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=179 + OR (g='srqponm' AND f GLOB 'defgh*') + OR b=509 + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR f='bcdefghij' + } +} {1 26 27 29 49 53 58 60 79 scan 0 sort 0} +do_test where7-2.644.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=23 + OR a=43 + OR c=19019 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR c=18018 + } +} {23 43 47 52 53 54 55 56 57 scan 0 sort 0} +do_test where7-2.644.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=23 + OR a=43 + OR c=19019 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR c=18018 + } +} {23 43 47 52 53 54 55 56 57 scan 0 sort 0} +do_test where7-2.645.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=36 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=231 + } +} {21 22 36 scan 0 sort 0} +do_test where7-2.645.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=36 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=231 + } +} {21 22 36 scan 0 sort 0} +do_test where7-2.646.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=21 + OR b=355 + OR a=97 + } +} {21 97 scan 0 sort 0} +do_test where7-2.646.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=21 + OR b=355 + OR a=97 + } +} {21 97 scan 0 sort 0} +do_test where7-2.647.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=421 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR b=704 + OR a=90 + OR a=78 + OR 1000000=80.0 AND d<81.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + } +} {28 42 53 55 64 78 80 81 90 scan 0 sort 0} +do_test where7-2.647.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=421 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR b=704 + OR a=90 + OR a=78 + OR 1000000=80.0 AND d<81.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + } +} {28 42 53 55 64 78 80 81 90 scan 0 sort 0} +do_test where7-2.648.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'pqrst*') + OR ((a BETWEEN 93 AND 95) AND a!=94) + } +} {93 95 scan 0 sort 0} +do_test where7-2.648.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'pqrst*') + OR ((a BETWEEN 93 AND 95) AND a!=94) + } +} {93 95 scan 0 sort 0} +do_test where7-2.649.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE d<0.0 + OR a=78 + OR b=539 + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR e IS NULL + OR a=48 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {8 10 25 27 48 49 57 78 scan 0 sort 0} +do_test where7-2.649.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE d<0.0 + OR a=78 + OR b=539 + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR e IS NULL + OR a=48 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {8 10 25 27 48 49 57 78 scan 0 sort 0} +do_test where7-2.650.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 94 AND 96) AND a!=95) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=22 + } +} {2 78 94 96 scan 0 sort 0} +do_test where7-2.650.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 94 AND 96) AND a!=95) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=22 + } +} {2 78 94 96 scan 0 sort 0} +do_test where7-2.651.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=275 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR f='ijklmnopq' + } +} {8 25 34 37 53 57 59 60 86 92 scan 0 sort 0} +do_test where7-2.651.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=275 + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR f='ijklmnopq' + } +} {8 25 34 37 53 57 59 60 86 92 scan 0 sort 0} +do_test where7-2.652.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=256 + OR c=13013 + OR b=44 + OR f='jklmnopqr' + OR b=883 + } +} {4 9 35 37 38 39 61 87 scan 0 sort 0} +do_test where7-2.652.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=256 + OR c=13013 + OR b=44 + OR f='jklmnopqr' + OR b=883 + } +} {4 9 35 37 38 39 61 87 scan 0 sort 0} +do_test where7-2.653.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='zabcdefgh' + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR a=54 + OR b=770 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR a=81 + OR b=190 + OR a=2 + } +} {2 3 25 51 54 70 77 81 96 98 scan 0 sort 0} +do_test where7-2.653.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='zabcdefgh' + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR a=54 + OR b=770 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR a=81 + OR b=190 + OR a=2 + } +} {2 3 25 51 54 70 77 81 96 98 scan 0 sort 0} +do_test where7-2.654.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR c=12012 + OR a=16 + OR a=15 + OR ((a BETWEEN 70 AND 72) AND a!=71) + OR a=69 + OR b=748 + OR a=61 + OR b=473 + OR ((a BETWEEN 69 AND 71) AND a!=70) + } +} {12 15 16 34 35 36 43 61 68 69 70 71 72 scan 0 sort 0} +do_test where7-2.654.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR c=12012 + OR a=16 + OR a=15 + OR ((a BETWEEN 70 AND 72) AND a!=71) + OR a=69 + OR b=748 + OR a=61 + OR b=473 + OR ((a BETWEEN 69 AND 71) AND a!=70) + } +} {12 15 16 34 35 36 43 61 68 69 70 71 72 scan 0 sort 0} +do_test where7-2.655.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=223 + OR a=14 + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR b=539 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR a=21 + } +} {14 21 33 35 41 48 49 61 74 76 scan 0 sort 0} +do_test where7-2.655.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=223 + OR a=14 + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR b=539 + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR a=21 + } +} {14 21 33 35 41 48 49 61 74 76 scan 0 sort 0} +do_test where7-2.656.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=99 + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR a=73 + OR a=56 + OR b=253 + OR b=880 + } +} {5 23 31 56 57 73 80 83 99 scan 0 sort 0} +do_test where7-2.656.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=99 + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR a=73 + OR a=56 + OR b=253 + OR b=880 + } +} {5 23 31 56 57 73 80 83 99 scan 0 sort 0} +do_test where7-2.657.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=927 + OR b=300 + OR b=223 + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=154 + OR b=759 + } +} {9 14 69 95 scan 0 sort 0} +do_test where7-2.657.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=927 + OR b=300 + OR b=223 + OR (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=154 + OR b=759 + } +} {9 14 69 95 scan 0 sort 0} +do_test where7-2.658.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=242 + OR b=905 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR a=24 + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR b=1100 + OR b=850 + OR ((a BETWEEN 55 AND 57) AND a!=56) + } +} {22 24 55 57 66 67 69 86 96 100 scan 0 sort 0} +do_test where7-2.658.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=242 + OR b=905 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'ijklm*') + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR a=24 + OR ((a BETWEEN 67 AND 69) AND a!=68) + OR b=1100 + OR b=850 + OR ((a BETWEEN 55 AND 57) AND a!=56) + } +} {22 24 55 57 66 67 69 86 96 100 scan 0 sort 0} +do_test where7-2.659.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=190 + OR a=72 + OR b=377 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR b=476 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + } +} {2 26 52 72 78 93 scan 0 sort 0} +do_test where7-2.659.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=190 + OR a=72 + OR b=377 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR b=476 + OR (g='yxwvuts' AND f GLOB 'cdefg*') + } +} {2 26 52 72 78 93 scan 0 sort 0} +do_test where7-2.660.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=245 + OR b=638 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR f='opqrstuvw' + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=817 + OR a=85 + OR (g='lkjihgf' AND f GLOB 'mnopq*') + } +} {14 40 58 62 64 66 67 85 86 92 scan 0 sort 0} +do_test where7-2.660.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=245 + OR b=638 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR f='opqrstuvw' + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR b=817 + OR a=85 + OR (g='lkjihgf' AND f GLOB 'mnopq*') + } +} {14 40 58 62 64 66 67 85 86 92 scan 0 sort 0} +do_test where7-2.661.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 22 AND 24) AND a!=23) + OR b=968 + } +} {22 24 88 scan 0 sort 0} +do_test where7-2.661.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 22 AND 24) AND a!=23) + OR b=968 + } +} {22 24 88 scan 0 sort 0} +do_test where7-2.662.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=22 + OR b=993 + OR f='tuvwxyzab' + } +} {2 19 45 60 62 71 74 76 97 scan 0 sort 0} +do_test where7-2.662.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 60 AND 62) AND a!=61) + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=22 + OR b=993 + OR f='tuvwxyzab' + } +} {2 19 45 60 62 71 74 76 97 scan 0 sort 0} +do_test where7-2.663.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 55 AND 57) AND a!=56) + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR c<=10 + OR ((a BETWEEN 75 AND 77) AND a!=76) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=553 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR b=1045 + } +} {55 57 72 73 75 77 85 95 scan 0 sort 0} +do_test where7-2.663.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 55 AND 57) AND a!=56) + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR c<=10 + OR ((a BETWEEN 75 AND 77) AND a!=76) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=553 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR b=1045 + } +} {55 57 72 73 75 77 85 95 scan 0 sort 0} +do_test where7-2.664.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=440 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR a=89 + OR c=18018 + OR b=154 + OR b=506 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR a=78 + OR b=751 + } +} {1 3 5 14 27 31 40 44 46 52 53 54 57 78 79 83 89 scan 0 sort 0} +do_test where7-2.664.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=440 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR ((a BETWEEN 44 AND 46) AND a!=45) + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR a=89 + OR c=18018 + OR b=154 + OR b=506 + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR a=78 + OR b=751 + } +} {1 3 5 14 27 31 40 44 46 52 53 54 57 78 79 83 89 scan 0 sort 0} +do_test where7-2.665.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=407 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR (g='rqponml' AND f GLOB 'klmno*') + OR b=209 + OR b=814 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR a=44 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR b=1092 + } +} {10 19 36 37 38 44 65 74 99 scan 0 sort 0} +do_test where7-2.665.2 { + count_steps_sort { 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 b=814 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} +} {10 19 36 37 38 44 65 74 99 scan 0 sort 0} do_test where7-2.666.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 24 AND 26) AND a!=25) + OR b=1103 + OR b=190 + OR b=737 + OR a=97 + OR b=451 + OR b=583 + OR a=63 + OR c=8008 + OR ((a BETWEEN 45 AND 47) AND a!=46) } -} {6 19 20 21 29 31 34 35 36 38 48 68 86 scan 0 sort 0} +} {22 23 24 26 41 45 47 53 63 67 97 scan 0 sort 0} do_test where7-2.666.2 { - count_steps { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 24 AND 26) AND a!=25) + OR b=1103 + OR b=190 + OR b=737 + OR a=97 + OR b=451 + OR b=583 + OR a=63 + OR c=8008 + OR ((a BETWEEN 45 AND 47) AND a!=46) + } +} {22 23 24 26 41 45 47 53 63 67 97 scan 0 sort 0} +do_test where7-2.667.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=12 + OR b=935 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=1070 + OR a=24 + OR a=95 + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR a=40 + OR b=935 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {12 24 27 29 40 53 85 87 95 scan 0 sort 0} +do_test where7-2.667.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=12 + OR b=935 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=1070 + OR a=24 + OR a=95 + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR a=40 + OR b=935 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {12 24 27 29 40 53 85 87 95 scan 0 sort 0} +do_test where7-2.668.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=858 + OR a=82 + OR b=209 + OR b=374 + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR c=22022 + } +} {19 34 40 64 65 66 76 78 82 scan 0 sort 0} +do_test where7-2.668.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=858 + OR a=82 + OR b=209 + OR b=374 + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR c=22022 + } +} {19 34 40 64 65 66 76 78 82 scan 0 sort 0} +do_test where7-2.669.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=27 + OR (g='rqponml' AND f GLOB 'lmnop*') + OR b=121 + OR ((a BETWEEN 7 AND 9) AND a!=8) + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=67 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR c=1001 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR ((a BETWEEN 19 AND 21) AND a!=20) + } +} {1 2 3 7 8 9 11 19 21 27 30 32 37 50 52 67 scan 0 sort 0} +do_test where7-2.669.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=27 + OR (g='rqponml' AND f GLOB 'lmnop*') + OR b=121 + OR ((a BETWEEN 7 AND 9) AND a!=8) + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=67 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR c=1001 + OR ((a BETWEEN 50 AND 52) AND a!=51) + OR ((a BETWEEN 19 AND 21) AND a!=20) + } +} {1 2 3 7 8 9 11 19 21 27 30 32 37 50 52 67 scan 0 sort 0} +do_test where7-2.670.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=99 + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + } +} {1 9 46 57 98 scan 0 sort 0} +do_test where7-2.670.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=99 + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=98.0 AND d<99.0 AND d NOT NULL) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + } +} {1 9 46 57 98 scan 0 sort 0} +do_test where7-2.671.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=3 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=355 + OR b=814 + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR a=81 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR b=542 + OR b=795 + } +} {3 42 62 74 79 81 scan 0 sort 0} +do_test where7-2.671.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=3 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR b=355 + OR b=814 + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR a=81 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR b=542 + OR b=795 + } +} {3 42 62 74 79 81 scan 0 sort 0} +do_test where7-2.672.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR b=363 + OR (g='srqponm' AND f GLOB 'fghij*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR b=619 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR a=73 + } +} {1 14 31 33 56 64 66 73 scan 0 sort 0} +do_test where7-2.672.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR b=363 + OR (g='srqponm' AND f GLOB 'fghij*') + OR ((a BETWEEN 64 AND 66) AND a!=65) + OR b=619 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + OR a=73 + } +} {1 14 31 33 56 64 66 73 scan 0 sort 0} +do_test where7-2.673.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=935 + OR a=42 + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR b=330 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {9 30 35 42 55 61 85 87 scan 0 sort 0} +do_test where7-2.673.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=935 + OR a=42 + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR b=330 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {9 30 35 42 55 61 85 87 scan 0 sort 0} +do_test where7-2.674.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=79 + OR b=201 + OR b=99 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR a=64 + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR a=89 + } +} {9 16 19 21 42 64 68 79 89 94 scan 0 sort 0} +do_test where7-2.674.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=79 + OR b=201 + OR b=99 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR a=64 + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR a=89 + } +} {9 16 19 21 42 64 68 79 89 94 scan 0 sort 0} +do_test where7-2.675.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=784 + OR a=85 + OR b=663 + OR c=17017 + OR b=561 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b=495 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR b=352 + OR ((a BETWEEN 39 AND 41) AND a!=40) + } +} {32 39 41 45 49 50 51 65 68 85 scan 0 sort 0} +do_test where7-2.675.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=784 + OR a=85 + OR b=663 + OR c=17017 + OR b=561 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR b=495 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR b=352 + OR ((a BETWEEN 39 AND 41) AND a!=40) + } +} {32 39 41 45 49 50 51 65 68 85 scan 0 sort 0} +do_test where7-2.676.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR f='klmnopqrs' + OR f='lmnopqrst' + } +} {10 11 19 36 37 62 63 88 89 100 scan 0 sort 0} +do_test where7-2.676.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR f='klmnopqrs' + OR f='lmnopqrst' + } +} {10 11 19 36 37 62 63 88 89 100 scan 0 sort 0} +do_test where7-2.677.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 90 AND 92) AND a!=91) + OR a=46 + OR a=44 + } +} {44 46 90 92 scan 0 sort 0} +do_test where7-2.677.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 90 AND 92) AND a!=91) + OR a=46 + OR a=44 + } +} {44 46 90 92 scan 0 sort 0} +do_test where7-2.678.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=36 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR b=682 + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR b=91 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR c=12012 + OR b=267 + OR (g='jihgfed' AND f GLOB 'yzabc*') + } +} {18 20 34 35 36 39 43 53 55 62 76 95 97 scan 0 sort 0} +do_test where7-2.678.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=36 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR b=682 + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR b=91 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR c=12012 + OR b=267 + OR (g='jihgfed' AND f GLOB 'yzabc*') + } +} {18 20 34 35 36 39 43 53 55 62 76 95 97 scan 0 sort 0} +do_test where7-2.679.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=594 + OR f='hijklmnop' + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR b=707 + OR b=363 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=157 + OR (g='tsrqpon' AND f GLOB 'yzabc*') + } +} {7 12 24 33 54 58 59 65 67 85 scan 0 sort 0} +do_test where7-2.679.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=594 + OR f='hijklmnop' + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR b=707 + OR b=363 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=157 + OR (g='tsrqpon' AND f GLOB 'yzabc*') + } +} {7 12 24 33 54 58 59 65 67 85 scan 0 sort 0} +do_test where7-2.680.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=2 + OR a=84 + OR b=399 + OR b=828 + OR a=21 + OR b=748 + OR c=13013 + OR a=57 + OR f='mnopqrstu' + } +} {2 12 21 27 37 38 39 57 64 68 84 90 scan 0 sort 0} +do_test where7-2.680.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=2 + OR a=84 + OR b=399 + OR b=828 + OR a=21 + OR b=748 + OR c=13013 + OR a=57 + OR f='mnopqrstu' + } +} {2 12 21 27 37 38 39 57 64 68 84 90 scan 0 sort 0} +do_test where7-2.681.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='nmlkjih' AND f GLOB 'defgh*') + OR b=674 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR c=3003 + OR a=19 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR ((a BETWEEN 20 AND 22) AND a!=21) + } +} {7 8 9 19 20 22 38 40 46 55 scan 0 sort 0} +do_test where7-2.681.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'defgh*') + OR b=674 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR c=3003 + OR a=19 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR ((a BETWEEN 20 AND 22) AND a!=21) + } +} {7 8 9 19 20 22 38 40 46 55 scan 0 sort 0} +do_test where7-2.682.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=652 + OR a=83 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=102 + OR b=300 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + } +} {49 83 97 scan 0 sort 0} +do_test where7-2.682.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=652 + OR a=83 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=102 + OR b=300 + OR (d>=49.0 AND d<50.0 AND d NOT NULL) + } +} {49 83 97 scan 0 sort 0} +do_test where7-2.683.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 53 AND 55) AND a!=54) + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR c=4004 + OR a=95 + OR b=707 + OR f='vwxyzabcd' + OR b=286 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=693 + OR ((a BETWEEN 6 AND 8) AND a!=7) + } +} {6 8 10 11 12 21 26 43 45 47 53 55 63 73 95 99 scan 0 sort 0} +do_test where7-2.683.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 53 AND 55) AND a!=54) + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR c=4004 + OR a=95 + OR b=707 + OR f='vwxyzabcd' + OR b=286 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=693 + OR ((a BETWEEN 6 AND 8) AND a!=7) + } +} {6 8 10 11 12 21 26 43 45 47 53 55 63 73 95 99 scan 0 sort 0} +do_test where7-2.684.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=209 + OR b=198 + OR a=52 + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR d<0.0 + OR (g='rqponml' AND f GLOB 'jklmn*') + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR b=168 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='uvwxyzabc' + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + } +} {7 18 19 20 24 33 35 42 46 52 59 64 72 85 98 scan 0 sort 0} +do_test where7-2.684.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=209 + OR b=198 + OR a=52 + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR d<0.0 + OR (g='rqponml' AND f GLOB 'jklmn*') + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR b=168 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='uvwxyzabc' + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + } +} {7 18 19 20 24 33 35 42 46 52 59 64 72 85 98 scan 0 sort 0} +do_test where7-2.685.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 4 AND 6) AND a!=5) + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR f='rstuvwxyz' + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=14 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + } +} {4 6 8 12 14 17 21 26 43 47 69 73 84 89 91 95 99 scan 0 sort 0} +do_test where7-2.685.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 4 AND 6) AND a!=5) + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR f='rstuvwxyz' + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR a=14 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + } +} {4 6 8 12 14 17 21 26 43 47 69 73 84 89 91 95 99 scan 0 sort 0} +do_test where7-2.686.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 13 AND 15) AND a!=14) + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR f='mnopqrstu' + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR a=38 + OR c=26026 + } +} {2 12 13 15 33 35 38 64 76 77 78 90 93 95 97 scan 0 sort 0} +do_test where7-2.686.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 13 AND 15) AND a!=14) + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR f='mnopqrstu' + OR (g='fedcbaz' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR a=38 + OR c=26026 + } +} {2 12 13 15 33 35 38 64 76 77 78 90 93 95 97 scan 0 sort 0} +do_test where7-2.687.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ponmlkj' AND f GLOB 'stuvw*') + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR a=7 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='srqponm' AND f GLOB 'ghijk*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {7 32 33 35 39 44 71 73 scan 0 sort 0} +do_test where7-2.687.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ponmlkj' AND f GLOB 'stuvw*') + OR ((a BETWEEN 71 AND 73) AND a!=72) + OR a=7 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='srqponm' AND f GLOB 'ghijk*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {7 32 33 35 39 44 71 73 scan 0 sort 0} +do_test where7-2.688.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=6006 + OR b=938 + OR b=484 + OR b=652 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR f='opqrstuvw' + } +} {14 15 16 17 18 40 41 44 58 66 67 92 93 scan 0 sort 0} +do_test where7-2.688.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=6006 + OR b=938 + OR b=484 + OR b=652 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR f='opqrstuvw' + } +} {14 15 16 17 18 40 41 44 58 66 67 92 93 scan 0 sort 0} +do_test where7-2.689.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=27027 + OR b=968 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=487 + OR b=924 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR c=14014 + OR b=1001 + } +} {40 41 42 51 70 79 80 81 84 88 91 scan 0 sort 0} +do_test where7-2.689.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=27027 + OR b=968 + OR (d>=51.0 AND d<52.0 AND d NOT NULL) + OR b=487 + OR b=924 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + OR c=14014 + OR b=1001 + } +} {40 41 42 51 70 79 80 81 84 88 91 scan 0 sort 0} +do_test where7-2.690.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=25 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=443 + OR b=564 + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=531 + OR b=1081 + OR a=96 + } +} {10 19 25 43 45 69 71 90 96 97 scan 0 sort 0} +do_test where7-2.690.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=25 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=443 + OR b=564 + OR (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=531 + OR b=1081 + OR a=96 + } +} {10 19 25 43 45 69 71 90 96 97 scan 0 sort 0} +do_test where7-2.691.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=36 + OR (g='srqponm' AND f GLOB 'defgh*') + } +} {29 scan 0 sort 0} +do_test where7-2.691.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=36 + OR (g='srqponm' AND f GLOB 'defgh*') + } +} {29 scan 0 sort 0} +do_test where7-2.692.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'stuvw*') + OR b=531 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + } +} {3 70 93 95 scan 0 sort 0} +do_test where7-2.692.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'stuvw*') + OR b=531 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + } +} {3 70 93 95 scan 0 sort 0} +do_test where7-2.693.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=256 + OR b=1034 + } +} {94 scan 0 sort 0} +do_test where7-2.693.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=256 + OR b=1034 + } +} {94 scan 0 sort 0} +do_test where7-2.694.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR b=784 + OR b=718 + OR a=18 + OR a=3 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR c=28028 + } +} {3 18 19 21 24 26 47 58 60 73 82 83 84 99 scan 0 sort 0} +do_test where7-2.694.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR (d>=83.0 AND d<84.0 AND d NOT NULL) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR b=784 + OR b=718 + OR a=18 + OR a=3 + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR c=28028 + } +} {3 18 19 21 24 26 47 58 60 73 82 83 84 99 scan 0 sort 0} +do_test where7-2.695.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=473 + OR b=649 + OR ((a BETWEEN 46 AND 48) AND a!=47) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR b=1100 + OR b=1012 + OR a=72 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR b=176 + OR b=355 + } +} {16 18 43 46 48 59 72 91 92 100 scan 0 sort 0} +do_test where7-2.695.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=473 + OR b=649 + OR ((a BETWEEN 46 AND 48) AND a!=47) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR b=1100 + OR b=1012 + OR a=72 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR b=176 + OR b=355 + } +} {16 18 43 46 48 59 72 91 92 100 scan 0 sort 0} +do_test where7-2.696.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR f='cdefghijk' + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + } +} {2 15 19 28 29 30 32 54 80 91 scan 0 sort 0} +do_test where7-2.696.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR f='cdefghijk' + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + } +} {2 15 19 28 29 30 32 54 80 91 scan 0 sort 0} +do_test where7-2.697.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='mlkjihg' AND f GLOB 'ijklm*') + OR b=883 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=938 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR f='defghijkl' + OR c=2002 + OR b=990 + } +} {3 4 5 6 17 19 22 29 55 60 81 90 scan 0 sort 0} +do_test where7-2.697.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='mlkjihg' AND f GLOB 'ijklm*') + OR b=883 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=938 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR f='defghijkl' + OR c=2002 + OR b=990 + } +} {3 4 5 6 17 19 22 29 55 60 81 90 scan 0 sort 0} +do_test where7-2.698.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 7 AND 9) AND a!=8) + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR b=902 + OR b=25 + } +} {7 9 76 82 scan 0 sort 0} +do_test where7-2.698.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 7 AND 9) AND a!=8) + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR b=902 + OR b=25 + } +} {7 9 76 82 scan 0 sort 0} +do_test where7-2.699.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'abcde*') + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=1092 + OR b=495 + } +} {26 45 55 68 70 74 76 scan 0 sort 0} +do_test where7-2.699.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'abcde*') + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR ((a BETWEEN 74 AND 76) AND a!=75) + OR b=1092 + OR b=495 + } +} {26 45 55 68 70 74 76 scan 0 sort 0} +do_test where7-2.700.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 90 AND 92) AND a!=91) + OR a=46 + OR a=74 + } +} {46 74 90 92 scan 0 sort 0} +do_test where7-2.700.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 90 AND 92) AND a!=91) + OR a=46 + OR a=74 + } +} {46 74 90 92 scan 0 sort 0} +do_test where7-2.701.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=18 + OR b=66 + OR b=498 + OR b=143 + OR b=1034 + OR b=289 + OR b=319 + } +} {6 13 18 29 94 scan 0 sort 0} +do_test where7-2.701.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=18 + OR b=66 + OR b=498 + OR b=143 + OR b=1034 + OR b=289 + OR b=319 + } +} {6 13 18 29 94 scan 0 sort 0} +do_test where7-2.702.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR (g='srqponm' AND f GLOB 'cdefg*') + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR f='lmnopqrst' + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR b=872 + OR a=44 + OR ((a BETWEEN 38 AND 40) AND a!=39) + } +} {11 13 25 28 30 37 38 40 44 45 51 54 63 77 79 89 scan 0 sort 0} +do_test where7-2.702.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?abcd*' AND f GLOB 'zabc*') + OR (g='srqponm' AND f GLOB 'efghi*') + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR (g='srqponm' AND f GLOB 'cdefg*') + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR f='lmnopqrst' + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR b=872 + OR a=44 + OR ((a BETWEEN 38 AND 40) AND a!=39) + } +} {11 13 25 28 30 37 38 40 44 45 51 54 63 77 79 89 scan 0 sort 0} +do_test where7-2.703.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR a=20 + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR b=1004 + OR b=77 + OR b=927 + OR a=99 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + } +} {7 17 20 46 66 71 72 73 75 98 99 scan 0 sort 0} +do_test where7-2.703.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR a=20 + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR b=1004 + OR b=77 + OR b=927 + OR a=99 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + } +} {7 17 20 46 66 71 72 73 75 98 99 scan 0 sort 0} +do_test where7-2.704.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=76.0 AND d<77.0 AND d NOT NULL) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=11 + OR ((a BETWEEN 21 AND 23) AND a!=22) + } +} {1 21 23 45 76 scan 0 sort 0} +do_test where7-2.704.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=76.0 AND d<77.0 AND d NOT NULL) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=11 + OR ((a BETWEEN 21 AND 23) AND a!=22) + } +} {1 21 23 45 76 scan 0 sort 0} +do_test where7-2.705.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=572 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {52 57 scan 0 sort 0} +do_test where7-2.705.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=572 + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {52 57 scan 0 sort 0} +do_test where7-2.706.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) + OR ((a BETWEEN 54 AND 56) AND a!=55) + OR f='lmnopqrst' + OR (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR a=23 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + } +} {10 11 23 36 37 44 54 56 62 63 69 81 88 89 scan 0 sort 0} +do_test where7-2.706.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) + OR ((a BETWEEN 54 AND 56) AND a!=55) + OR f='lmnopqrst' + OR (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR a=23 + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + } +} {10 11 23 36 37 44 54 56 62 63 69 81 88 89 scan 0 sort 0} +do_test where7-2.707.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=836 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR b=605 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR b=759 + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR a=40 + OR f='ghijklmno' + OR (g='hgfedcb' AND f GLOB 'hijkl*') + } +} {6 24 32 38 40 46 50 55 58 69 70 76 84 85 89 91 scan 0 sort 0} +do_test where7-2.707.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=836 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR b=605 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR b=759 + OR (f GLOB '?zabc*' AND f GLOB 'yzab*') + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR a=40 + OR f='ghijklmno' + OR (g='hgfedcb' AND f GLOB 'hijkl*') + } +} {6 24 32 38 40 46 50 55 58 69 70 76 84 85 89 91 scan 0 sort 0} +do_test where7-2.708.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + } +} {42 51 scan 0 sort 0} +do_test where7-2.708.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + } +} {42 51 scan 0 sort 0} +do_test where7-2.709.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=27027 + OR b=872 + OR a=56 + } +} {56 79 80 81 scan 0 sort 0} +do_test where7-2.709.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=27027 + OR b=872 + OR a=56 + } +} {56 79 80 81 scan 0 sort 0} +do_test where7-2.710.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=685 + OR b=256 + OR ((a BETWEEN 78 AND 80) AND a!=79) + OR a=44 + OR a=63 + OR a=15 + OR ((a BETWEEN 22 AND 24) AND a!=23) + } +} {15 22 24 44 63 78 80 scan 0 sort 0} +do_test where7-2.710.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=685 + OR b=256 + OR ((a BETWEEN 78 AND 80) AND a!=79) + OR a=44 + OR a=63 + OR a=15 + OR ((a BETWEEN 22 AND 24) AND a!=23) + } +} {15 22 24 44 63 78 80 scan 0 sort 0} +do_test where7-2.711.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='nmlkjih' AND f GLOB 'efghi*') + OR a=34 + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR a=67 + OR a=28 + } +} {6 8 28 34 56 67 75 scan 0 sort 0} +do_test where7-2.711.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'efghi*') + OR a=34 + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR (d>=75.0 AND d<76.0 AND d NOT NULL) + OR a=67 + OR a=28 + } +} {6 8 28 34 56 67 75 scan 0 sort 0} +do_test where7-2.712.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR a=52 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='ghijklmno' + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=319 + OR a=34 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR f='hijklmnop' + } +} {6 7 12 18 24 29 32 33 34 41 52 58 59 68 70 84 85 scan 0 sort 0} +do_test where7-2.712.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR a=52 + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR f='ghijklmno' + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=319 + OR a=34 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR f='hijklmnop' + } +} {6 7 12 18 24 29 32 33 34 41 52 58 59 68 70 84 85 scan 0 sort 0} +do_test where7-2.713.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR a=47 + } +} {41 47 69 71 scan 0 sort 0} +do_test where7-2.713.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'pqrst*') + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR a=47 + } +} {41 47 69 71 scan 0 sort 0} +do_test where7-2.714.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 33 AND 35) AND a!=34) + OR c=7007 + } +} {19 20 21 33 35 scan 0 sort 0} +do_test where7-2.714.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 33 AND 35) AND a!=34) + OR c=7007 + } +} {19 20 21 33 35 scan 0 sort 0} +do_test where7-2.715.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=531 + OR a=12 + OR b=583 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR a=61 + OR b=187 + } +} {12 17 53 61 93 95 scan 0 sort 0} +do_test where7-2.715.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=531 + OR a=12 + OR b=583 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR a=61 + OR b=187 + } +} {12 17 53 61 93 95 scan 0 sort 0} +do_test where7-2.716.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=31031 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=256 + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=715 + OR b=212 + OR b=99 + OR c=29029 + } +} {9 12 38 45 65 66 68 77 79 85 86 87 91 92 93 scan 0 sort 0} +do_test where7-2.716.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=31031 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=256 + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=715 + OR b=212 + OR b=99 + OR c=29029 + } +} {9 12 38 45 65 66 68 77 79 85 86 87 91 92 93 scan 0 sort 0} +do_test where7-2.717.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 40 AND 42) AND a!=41) + OR b=33 + OR a=62 + OR b=916 + OR b=1012 + OR a=2 + OR a=51 + OR b=286 + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=80 + } +} {2 3 26 40 42 51 62 92 96 scan 0 sort 0} +do_test where7-2.717.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 40 AND 42) AND a!=41) + OR b=33 + OR a=62 + OR b=916 + OR b=1012 + OR a=2 + OR a=51 + OR b=286 + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=80 + } +} {2 3 26 40 42 51 62 92 96 scan 0 sort 0} +do_test where7-2.718.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=847 + OR f='efghijklm' + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + } +} {4 6 30 56 77 82 scan 0 sort 0} +do_test where7-2.718.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=847 + OR f='efghijklm' + OR (d>=6.0 AND d<7.0 AND d NOT NULL) + } +} {4 6 30 56 77 82 scan 0 sort 0} +do_test where7-2.719.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR ((a BETWEEN 62 AND 64) AND a!=63) + } +} {25 62 64 scan 0 sort 0} +do_test where7-2.719.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR ((a BETWEEN 62 AND 64) AND a!=63) + } +} {25 62 64 scan 0 sort 0} +do_test where7-2.720.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 43 AND 45) AND a!=44) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR a=43 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR b=729 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + } +} {14 31 33 43 45 53 scan 0 sort 0} +do_test where7-2.720.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 43 AND 45) AND a!=44) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR a=43 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR b=729 + OR (g='vutsrqp' AND f GLOB 'opqrs*') + } +} {14 31 33 43 45 53 scan 0 sort 0} +do_test where7-2.721.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='efghijklm' + OR a=70 + OR b=278 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR c=8008 + OR f='opqrstuvw' + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {4 5 14 22 23 24 25 30 33 35 40 56 66 70 82 92 scan 0 sort 0} +do_test where7-2.721.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='efghijklm' + OR a=70 + OR b=278 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR c=8008 + OR f='opqrstuvw' + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR (g='xwvutsr' AND f GLOB 'fghij*') + } +} {4 5 14 22 23 24 25 30 33 35 40 56 66 70 82 92 scan 0 sort 0} +do_test where7-2.722.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR c<=10 + OR (g='srqponm' AND f GLOB 'fghij*') + OR a=35 + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=1089 + OR a=73 + OR b=737 + OR c=18018 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {6 23 31 32 35 40 42 52 53 54 58 62 67 73 84 99 scan 0 sort 0} +do_test where7-2.722.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR c<=10 + OR (g='srqponm' AND f GLOB 'fghij*') + OR a=35 + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=1089 + OR a=73 + OR b=737 + OR c=18018 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + } +} {6 23 31 32 35 40 42 52 53 54 58 62 67 73 84 99 scan 0 sort 0} +do_test where7-2.723.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 0 AND 2) AND a!=1) + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=762 + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR a=80 + } +} {2 39 41 79 80 95 scan 0 sort 0} +do_test where7-2.723.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 0 AND 2) AND a!=1) + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=762 + OR ((a BETWEEN 39 AND 41) AND a!=40) + OR a=80 + } +} {2 39 41 79 80 95 scan 0 sort 0} +do_test where7-2.724.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 28 AND 30) AND a!=29) + OR b=737 + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR b=979 + OR a=36 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR a=55 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + } +} {20 28 30 36 46 50 55 67 72 80 82 89 95 98 scan 0 sort 0} +do_test where7-2.724.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 28 AND 30) AND a!=29) + OR b=737 + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR b=979 + OR a=36 + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + OR a=55 + OR (g='fedcbaz' AND f GLOB 'rstuv*') + } +} {20 28 30 36 46 50 55 67 72 80 82 89 95 98 scan 0 sort 0} +do_test where7-2.725.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=75 + OR a=61 + OR (g='onmlkji' AND f GLOB 'abcde*') + OR (g='gfedcba' AND f GLOB 'nopqr*') + } +} {52 61 75 91 scan 0 sort 0} +do_test where7-2.725.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=75 + OR a=61 + OR (g='onmlkji' AND f GLOB 'abcde*') + OR (g='gfedcba' AND f GLOB 'nopqr*') + } +} {52 61 75 91 scan 0 sort 0} +do_test where7-2.726.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1004 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR a=56 + } +} {7 56 61 scan 0 sort 0} +do_test where7-2.726.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1004 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR a=56 + } +} {7 56 61 scan 0 sort 0} +do_test where7-2.727.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=93 + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR a=83 + OR b=828 + OR b=454 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR b=924 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + OR a=50 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + } +} {38 50 58 66 83 84 89 91 93 scan 0 sort 0} +do_test where7-2.727.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=93 + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR a=83 + OR b=828 + OR b=454 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR b=924 + OR (g='lkjihgf' AND f GLOB 'opqrs*') + OR a=50 + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + } +} {38 50 58 66 83 84 89 91 93 scan 0 sort 0} +do_test where7-2.728.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='stuvwxyza' + OR a=44 + OR c=2002 + } +} {4 5 6 18 44 70 96 scan 0 sort 0} +do_test where7-2.728.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='stuvwxyza' + OR a=44 + OR c=2002 + } +} {4 5 6 18 44 70 96 scan 0 sort 0} +do_test where7-2.729.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=55 + OR a=65 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + } +} {14 40 55 65 66 92 scan 0 sort 0} +do_test where7-2.729.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=55 + OR a=65 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + } +} {14 40 55 65 66 92 scan 0 sort 0} +do_test where7-2.730.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 72 AND 74) AND a!=73) + OR b=605 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR f='ijklmnopq' + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR c=9009 + OR b=374 + } +} {8 12 13 25 26 27 34 43 55 60 72 74 86 88 scan 0 sort 0} +do_test where7-2.730.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 72 AND 74) AND a!=73) + OR b=605 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR f='ijklmnopq' + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR c=9009 + OR b=374 + } +} {8 12 13 25 26 27 34 43 55 60 72 74 86 88 scan 0 sort 0} +do_test where7-2.731.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=476 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR b=982 + OR a=43 + OR b=355 + } +} {8 43 scan 0 sort 0} +do_test where7-2.731.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=476 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR b=982 + OR a=43 + OR b=355 + } +} {8 43 scan 0 sort 0} +do_test where7-2.732.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=85 + OR b=718 + OR (g='fedcbaz' AND f GLOB 'pqrst*') + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + } +} {1 25 27 53 79 85 93 scan 0 sort 0} +do_test where7-2.732.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=85 + OR b=718 + OR (g='fedcbaz' AND f GLOB 'pqrst*') + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + } +} {1 25 27 53 79 85 93 scan 0 sort 0} +do_test where7-2.733.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=73.0 AND d<74.0 AND d NOT NULL) + OR ((a BETWEEN 96 AND 98) AND a!=97) + } +} {73 96 98 scan 0 sort 0} +do_test where7-2.733.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=73.0 AND d<74.0 AND d NOT NULL) + OR ((a BETWEEN 96 AND 98) AND a!=97) + } +} {73 96 98 scan 0 sort 0} +do_test where7-2.734.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=176 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR b=619 + OR b=597 + OR b=198 + OR a=27 + OR b=91 + OR a=77 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + } +} {16 18 25 27 29 77 80 scan 0 sort 0} +do_test where7-2.734.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=176 + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR b=619 + OR b=597 + OR b=198 + OR a=27 + OR b=91 + OR a=77 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + } +} {16 18 25 27 29 77 80 scan 0 sort 0} +do_test where7-2.735.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=41 + OR b=528 + OR c=3003 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=22 + } +} {2 7 8 9 20 22 41 48 scan 0 sort 0} +do_test where7-2.735.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=41 + OR b=528 + OR c=3003 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR b=22 + } +} {2 7 8 9 20 22 41 48 scan 0 sort 0} +do_test where7-2.736.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR b=465 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=37 + OR b=1056 + OR (g='srqponm' AND f GLOB 'defgh*') + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR b=1023 + } +} {4 16 29 37 42 63 65 68 93 94 96 scan 0 sort 0} +do_test where7-2.736.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR b=465 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=37 + OR b=1056 + OR (g='srqponm' AND f GLOB 'defgh*') + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR b=1023 + } +} {4 16 29 37 42 63 65 68 93 94 96 scan 0 sort 0} +do_test where7-2.737.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=76 + OR a=8 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR b=495 + OR b=663 + OR a=98 + OR b=748 + } +} {8 27 45 68 76 98 scan 0 sort 0} +do_test where7-2.737.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=76 + OR a=8 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR b=495 + OR b=663 + OR a=98 + OR b=748 + } +} {8 27 45 68 76 98 scan 0 sort 0} +do_test where7-2.738.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1081 + OR b=542 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=828 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR a=18 + } +} {18 47 61 64 67 scan 0 sort 0} +do_test where7-2.738.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1081 + OR b=542 + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=828 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR a=18 + } +} {18 47 61 64 67 scan 0 sort 0} +do_test where7-2.739.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='abcdefghi' + OR a=14 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR c=27027 + OR a=47 + } +} {13 14 26 47 52 78 79 80 81 scan 0 sort 0} +do_test where7-2.739.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='abcdefghi' + OR a=14 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR c=27027 + OR a=47 + } +} {13 14 26 47 52 78 79 80 81 scan 0 sort 0} +do_test where7-2.740.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=31031 + OR b=737 + OR a=37 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR a=91 + OR b=77 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + } +} {7 37 65 67 91 92 93 94 98 100 scan 0 sort 0} +do_test where7-2.740.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=31031 + OR b=737 + OR a=37 + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR a=91 + OR b=77 + OR (d>=94.0 AND d<95.0 AND d NOT NULL) + } +} {7 37 65 67 91 92 93 94 98 100 scan 0 sort 0} +do_test where7-2.741.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=17 + OR b=484 + OR c=3003 + OR b=121 + OR a=53 + } +} {7 8 9 11 17 44 53 scan 0 sort 0} +do_test where7-2.741.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=17 + OR b=484 + OR c=3003 + OR b=121 + OR a=53 + } +} {7 8 9 11 17 44 53 scan 0 sort 0} +do_test where7-2.742.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=880 + OR b=696 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR b=308 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR ((a BETWEEN 96 AND 98) AND a!=97) + } +} {5 28 65 80 96 98 scan 0 sort 0} +do_test where7-2.742.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=880 + OR b=696 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR b=308 + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR ((a BETWEEN 96 AND 98) AND a!=97) + } +} {5 28 65 80 96 98 scan 0 sort 0} +do_test where7-2.743.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR a=24 + OR f IS NULL + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR c=12012 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + } +} {24 25 34 35 36 57 77 88 scan 0 sort 0} +do_test where7-2.743.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR a=24 + OR f IS NULL + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR c=12012 + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + } +} {24 25 34 35 36 57 77 88 scan 0 sort 0} +do_test where7-2.744.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=94 + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR b=792 + OR a=77 + OR a=26 + OR b=641 + OR a=38 + } +} {26 38 72 74 77 85 94 scan 0 sort 0} +do_test where7-2.744.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=94 + OR (d>=74.0 AND d<75.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR b=792 + OR a=77 + OR a=26 + OR b=641 + OR a=38 + } +} {26 38 72 74 77 85 94 scan 0 sort 0} +do_test where7-2.745.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 51 AND 53) AND a!=52) + OR (d>=30.0 AND d<31.0 AND d NOT NULL) + OR b=14 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=121 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {11 15 17 27 30 51 53 63 86 89 91 scan 0 sort 0} +do_test where7-2.745.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 51 AND 53) AND a!=52) + OR (d>=30.0 AND d<31.0 AND d NOT NULL) + OR b=14 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR ((a BETWEEN 15 AND 17) AND a!=16) + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=121 + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + } +} {11 15 17 27 30 51 53 63 86 89 91 scan 0 sort 0} +do_test where7-2.746.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=517 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR f='opqrstuvw' + } +} {14 40 47 66 69 71 92 scan 0 sort 0} +do_test where7-2.746.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=517 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR f='opqrstuvw' + } +} {14 40 47 66 69 71 92 scan 0 sort 0} +do_test where7-2.747.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=267 + OR c=19019 + OR a=42 + OR b=938 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {1 9 17 21 22 24 32 34 35 42 43 55 56 57 61 69 84 87 95 scan 0 sort 0} +do_test where7-2.747.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=267 + OR c=19019 + OR a=42 + OR b=938 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + } +} {1 9 17 21 22 24 32 34 35 42 43 55 56 57 61 69 84 87 95 scan 0 sort 0} +do_test where7-2.748.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=179 + OR a=50 + OR (g='srqponm' AND f GLOB 'defgh*') + } +} {29 50 scan 0 sort 0} +do_test where7-2.748.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=179 + OR a=50 + OR (g='srqponm' AND f GLOB 'defgh*') + } +} {29 50 scan 0 sort 0} +do_test where7-2.749.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='vutsrqp' AND f GLOB 'rstuv*') + OR f='xyzabcdef' + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=575 + OR b=385 + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=46 + OR b=220 + OR a=63 + } +} {17 18 20 23 35 46 49 51 63 65 75 scan 0 sort 0} +do_test where7-2.749.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='vutsrqp' AND f GLOB 'rstuv*') + OR f='xyzabcdef' + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=575 + OR b=385 + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=46 + OR b=220 + OR a=63 + } +} {17 18 20 23 35 46 49 51 63 65 75 scan 0 sort 0} +do_test where7-2.750.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1056 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=1078 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + OR c=31031 + OR b=869 + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR b=245 + OR a=92 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=880 + } +} {66 77 79 80 91 92 93 96 98 scan 0 sort 0} +do_test where7-2.750.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1056 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=1078 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + OR c=31031 + OR b=869 + OR (g='jihgfed' AND f GLOB 'zabcd*') + OR b=245 + OR a=92 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=880 + } +} {66 77 79 80 91 92 93 96 98 scan 0 sort 0} +do_test where7-2.751.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1078 + OR c=28028 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR c=9009 + OR a=17 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + } +} {16 17 19 25 26 27 38 39 40 42 61 68 82 83 84 94 98 scan 0 sort 0} +do_test where7-2.751.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1078 + OR c=28028 + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR (g='mlkjihg' AND f GLOB 'jklmn*') + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR c=9009 + OR a=17 + OR (d>=39.0 AND d<40.0 AND d NOT NULL) + } +} {16 17 19 25 26 27 38 39 40 42 61 68 82 83 84 94 98 scan 0 sort 0} +do_test where7-2.752.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) + OR b=762 + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR f='tuvwxyzab' + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR b=1034 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + } +} {14 19 31 33 44 45 57 58 71 94 97 scan 0 sort 0} +do_test where7-2.752.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) + OR b=762 + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR f='tuvwxyzab' + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR b=1034 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + } +} {14 19 31 33 44 45 57 58 71 94 97 scan 0 sort 0} +do_test where7-2.753.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=47 + OR b=187 + OR a=56 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR ((a BETWEEN 89 AND 91) AND a!=90) + } +} {17 30 32 56 68 70 89 91 scan 0 sort 0} +do_test where7-2.753.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=47 + OR b=187 + OR a=56 + OR ((a BETWEEN 30 AND 32) AND a!=31) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR ((a BETWEEN 89 AND 91) AND a!=90) + } +} {17 30 32 56 68 70 89 91 scan 0 sort 0} +do_test where7-2.754.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=11011 + OR a=14 + OR c=16016 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'efghi*') + OR f='jklmnopqr' + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=916 + } +} {9 14 21 25 30 31 32 33 35 46 47 48 61 87 96 scan 0 sort 0} +do_test where7-2.754.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=11011 + OR a=14 + OR c=16016 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'efghi*') + OR f='jklmnopqr' + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=916 + } +} {9 14 21 25 30 31 32 33 35 46 47 48 61 87 96 scan 0 sort 0} +do_test where7-2.755.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=949 + OR (g='srqponm' AND f GLOB 'cdefg*') + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR c<=10 + OR a=14 + OR b=608 + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=121 + OR b=333 + OR ((a BETWEEN 93 AND 95) AND a!=94) + } +} {11 14 17 28 66 93 95 98 scan 0 sort 0} +do_test where7-2.755.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=949 + OR (g='srqponm' AND f GLOB 'cdefg*') + OR (g='vutsrqp' AND f GLOB 'rstuv*') + OR c<=10 + OR a=14 + OR b=608 + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=121 + OR b=333 + OR ((a BETWEEN 93 AND 95) AND a!=94) + } +} {11 14 17 28 66 93 95 98 scan 0 sort 0} +do_test where7-2.756.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=355 + OR b=627 + OR b=1001 + OR b=1026 + OR ((a BETWEEN 58 AND 60) AND a!=59) + } +} {57 58 60 69 91 scan 0 sort 0} +do_test where7-2.756.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'rstuv*') + OR b=355 + OR b=627 + OR b=1001 + OR b=1026 + OR ((a BETWEEN 58 AND 60) AND a!=59) + } +} {57 58 60 69 91 scan 0 sort 0} +do_test where7-2.757.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'efghi*') + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + } +} {4 79 scan 0 sort 0} +do_test where7-2.757.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'efghi*') + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + } +} {4 79 scan 0 sort 0} +do_test where7-2.758.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=685 + OR a=14 + OR b=990 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR f='efghijklm' + OR c=1001 + OR b=784 + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + } +} {1 2 3 4 14 26 30 32 56 69 82 90 scan 0 sort 0} +do_test where7-2.758.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=685 + OR a=14 + OR b=990 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR f='efghijklm' + OR c=1001 + OR b=784 + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + } +} {1 2 3 4 14 26 30 32 56 69 82 90 scan 0 sort 0} +do_test where7-2.759.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=54 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR c=26026 + OR ((a BETWEEN 97 AND 99) AND a!=98) + } +} {39 54 76 77 78 97 99 scan 0 sort 0} +do_test where7-2.759.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=54 + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR c=26026 + OR ((a BETWEEN 97 AND 99) AND a!=98) + } +} {39 54 76 77 78 97 99 scan 0 sort 0} +do_test where7-2.760.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'ghijk*') + OR c=24024 + OR a=98 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR a=5 + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='rqponml' AND f GLOB 'klmno*') + OR f='pqrstuvwx' + OR f='bcdefghij' + OR b=1001 + OR ((a BETWEEN 77 AND 79) AND a!=78) + } +} {1 5 15 21 27 31 33 36 41 53 67 70 71 72 77 79 84 91 93 98 scan 0 sort 0} +do_test where7-2.760.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'ghijk*') + OR c=24024 + OR a=98 + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + OR a=5 + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (g='rqponml' AND f GLOB 'klmno*') + OR f='pqrstuvwx' + OR f='bcdefghij' + OR b=1001 + OR ((a BETWEEN 77 AND 79) AND a!=78) + } +} {1 5 15 21 27 31 33 36 41 53 67 70 71 72 77 79 84 91 93 98 scan 0 sort 0} +do_test where7-2.761.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=781 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR f='lmnopqrst' + OR a=39 + OR a=100 + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {1 11 14 37 39 40 54 56 58 63 66 71 89 92 99 100 scan 0 sort 0} +do_test where7-2.761.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=781 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR f='lmnopqrst' + OR a=39 + OR a=100 + OR ((a BETWEEN 56 AND 58) AND a!=57) + } +} {1 11 14 37 39 40 54 56 58 63 66 71 89 92 99 100 scan 0 sort 0} +do_test where7-2.762.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=4004 + OR b=718 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR a=50 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR b=363 + OR (g='rqponml' AND f GLOB 'ijklm*') + OR b=1023 + } +} {10 11 12 33 34 40 50 93 scan 0 sort 0} +do_test where7-2.762.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=4004 + OR b=718 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR a=50 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR b=363 + OR (g='rqponml' AND f GLOB 'ijklm*') + OR b=1023 + } +} {10 11 12 33 34 40 50 93 scan 0 sort 0} +do_test where7-2.763.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1081 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR b=473 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR b=586 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + } +} {20 26 43 45 46 55 72 98 scan 0 sort 0} +do_test where7-2.763.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1081 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR b=473 + OR ((a BETWEEN 43 AND 45) AND a!=44) + OR b=586 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') + } +} {20 26 43 45 46 55 72 98 scan 0 sort 0} +do_test where7-2.764.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + } +} {7 13 33 58 59 85 scan 0 sort 0} +do_test where7-2.764.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + } +} {7 13 33 58 59 85 scan 0 sort 0} +do_test where7-2.765.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR a=47 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR (g='lkjihgf' AND f GLOB 'lmnop*') + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + OR f='lmnopqrst' + } +} {11 37 47 63 68 76 78 84 85 89 scan 0 sort 0} +do_test where7-2.765.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR ((a BETWEEN 76 AND 78) AND a!=77) + OR a=47 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR (g='lkjihgf' AND f GLOB 'lmnop*') + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + OR f='lmnopqrst' + } +} {11 37 47 63 68 76 78 84 85 89 scan 0 sort 0} +do_test where7-2.766.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c>=34035 + OR a=29 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR f='abcdefghi' + OR b=993 + OR ((a BETWEEN 52 AND 54) AND a!=53) + OR ((a BETWEEN 45 AND 47) AND a!=46) + } +} {19 21 26 29 45 47 52 54 73 78 99 scan 0 sort 0} +do_test where7-2.766.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c>=34035 + OR a=29 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') + OR f='abcdefghi' + OR b=993 + OR ((a BETWEEN 52 AND 54) AND a!=53) + OR ((a BETWEEN 45 AND 47) AND a!=46) + } +} {19 21 26 29 45 47 52 54 73 78 99 scan 0 sort 0} +do_test where7-2.767.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=696 + OR b=154 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR a=22 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR a=52 + OR a=21 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + } +} {14 16 21 22 24 47 52 63 70 scan 0 sort 0} +do_test where7-2.767.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=696 + OR b=154 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR a=22 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR a=52 + OR a=21 + OR (d>=70.0 AND d<71.0 AND d NOT NULL) + } +} {14 16 21 22 24 47 52 63 70 scan 0 sort 0} +do_test where7-2.768.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=693 + OR b=201 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR b=520 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR b=407 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR c>=34035 + OR b=135 + } +} {23 25 36 37 38 63 scan 0 sort 0} +do_test where7-2.768.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=693 + OR b=201 + OR ((a BETWEEN 36 AND 38) AND a!=37) + OR b=520 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR b=407 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR c>=34035 + OR b=135 + } +} {23 25 36 37 38 63 scan 0 sort 0} +do_test where7-2.769.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=43.0 AND d<44.0 AND d NOT NULL) + OR b=707 + OR b=14 + OR b=1089 + OR b=352 + } +} {32 43 99 scan 0 sort 0} +do_test where7-2.769.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=43.0 AND d<44.0 AND d NOT NULL) + OR b=707 + OR b=14 + OR b=1089 + OR b=352 + } +} {32 43 99 scan 0 sort 0} +do_test where7-2.770.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=278 + OR b=278 + OR b=825 + OR f='rstuvwxyz' + OR b=938 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR ((a BETWEEN 43 AND 45) AND a!=44) + } +} {17 19 43 45 69 75 95 scan 0 sort 0} +do_test where7-2.770.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=278 + OR b=278 + OR b=825 + OR f='rstuvwxyz' + OR b=938 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR ((a BETWEEN 43 AND 45) AND a!=44) + } +} {17 19 43 45 69 75 95 scan 0 sort 0} +do_test where7-2.771.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 32 AND 34) AND a!=33) + OR b=1045 + OR c=27027 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + } +} {11 32 34 37 63 79 80 81 89 95 scan 0 sort 0} +do_test where7-2.771.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 32 AND 34) AND a!=33) + OR b=1045 + OR c=27027 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + } +} {11 32 34 37 63 79 80 81 89 95 scan 0 sort 0} +do_test where7-2.772.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=87 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=487 + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {47 87 90 scan 0 sort 0} +do_test where7-2.772.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=87 + OR (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=487 + OR (g='gfedcba' AND f GLOB 'mnopq*') + } +} {47 87 90 scan 0 sort 0} +do_test where7-2.773.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 30 AND 32) AND a!=31) + OR b=69 + OR b=608 + OR b=814 + OR a=67 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR b=1059 + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR a=18 + OR b=407 + OR ((a BETWEEN 10 AND 12) AND a!=11) + } +} {10 12 18 30 32 37 58 61 67 74 scan 0 sort 0} +do_test where7-2.773.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 30 AND 32) AND a!=31) + OR b=69 + OR b=608 + OR b=814 + OR a=67 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR b=1059 + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR a=18 + OR b=407 + OR ((a BETWEEN 10 AND 12) AND a!=11) + } +} {10 12 18 30 32 37 58 61 67 74 scan 0 sort 0} +do_test where7-2.774.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=223 + OR b=80 + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR ((a BETWEEN 74 AND 76) AND a!=75) + } +} {74 76 97 99 scan 0 sort 0} +do_test where7-2.774.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=223 + OR b=80 + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR ((a BETWEEN 74 AND 76) AND a!=75) + } +} {74 76 97 99 scan 0 sort 0} +do_test where7-2.775.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=220 + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=363 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR ((a BETWEEN 10 AND 12) AND a!=11) + } +} {10 12 20 33 52 54 55 66 scan 0 sort 0} +do_test where7-2.775.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=220 + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=363 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'defgh*') + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR ((a BETWEEN 10 AND 12) AND a!=11) + } +} {10 12 20 33 52 54 55 66 scan 0 sort 0} +do_test where7-2.776.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=498 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR b=880 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR b=828 + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR b=113 + } +} {5 15 60 62 80 scan 0 sort 0} +do_test where7-2.776.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=498 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR b=880 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR b=828 + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR b=113 + } +} {5 15 60 62 80 scan 0 sort 0} +do_test where7-2.777.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1059 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR b=960 + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=894 + OR c=2002 + } +} {4 5 6 12 16 20 42 68 94 scan 0 sort 0} +do_test where7-2.777.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1059 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR b=960 + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR b=894 + OR c=2002 + } +} {4 5 6 12 16 20 42 68 94 scan 0 sort 0} +do_test where7-2.778.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=14 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + } +} {85 scan 0 sort 0} +do_test where7-2.778.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=14 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + } +} {85 scan 0 sort 0} +do_test where7-2.779.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=806 + OR (g='rqponml' AND f GLOB 'hijkl*') + OR b=795 + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR c=23023 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + } +} {21 23 33 67 68 69 86 88 99 scan 0 sort 0} +do_test where7-2.779.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=806 + OR (g='rqponml' AND f GLOB 'hijkl*') + OR b=795 + OR ((a BETWEEN 99 AND 101) AND a!=100) + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR c=23023 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + } +} {21 23 33 67 68 69 86 88 99 scan 0 sort 0} +do_test where7-2.780.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=726 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR f='abcdefghi' + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR b=869 + } +} {8 10 15 26 41 52 66 67 78 79 92 93 scan 0 sort 0} +do_test where7-2.780.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=726 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR f='abcdefghi' + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR b=869 + } +} {8 10 15 26 41 52 66 67 78 79 92 93 scan 0 sort 0} +do_test where7-2.781.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=59 + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR b=1081 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + } +} {5 7 59 96 scan 0 sort 0} +do_test where7-2.781.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=59 + OR ((a BETWEEN 5 AND 7) AND a!=6) + OR b=1081 + OR (g='fedcbaz' AND f GLOB 'stuvw*') + } +} {5 7 59 96 scan 0 sort 0} +do_test where7-2.782.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'nopqr*') + OR b=1037 + OR b=132 + OR c=1001 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=32 + } +} {1 2 3 12 18 20 32 39 58 68 91 scan 0 sort 0} +do_test where7-2.782.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'nopqr*') + OR b=1037 + OR b=132 + OR c=1001 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=32 + } +} {1 2 3 12 18 20 32 39 58 68 91 scan 0 sort 0} +do_test where7-2.783.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=24 + OR b=927 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR a=7 + OR b=462 + OR b=608 + OR b=781 + OR b=253 + OR c=25025 + OR b=132 + } +} {7 12 23 24 42 52 71 73 74 75 scan 0 sort 0} +do_test where7-2.783.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=24 + OR b=927 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR a=7 + OR b=462 + OR b=608 + OR b=781 + OR b=253 + OR c=25025 + OR b=132 + } +} {7 12 23 24 42 52 71 73 74 75 scan 0 sort 0} +do_test where7-2.784.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=1001 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR a=83 + } +} {23 25 61 83 91 scan 0 sort 0} +do_test where7-2.784.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=1001 + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR a=83 + } +} {23 25 61 83 91 scan 0 sort 0} +do_test where7-2.785.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=36 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR ((a BETWEEN 46 AND 48) AND a!=47) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR ((a BETWEEN 26 AND 28) AND a!=27) + } +} {3 26 28 29 31 33 46 48 55 60 73 77 80 81 82 91 scan 0 sort 0} +do_test where7-2.785.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=36 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR ((a BETWEEN 46 AND 48) AND a!=47) + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR (d>=91.0 AND d<92.0 AND d NOT NULL) + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR ((a BETWEEN 26 AND 28) AND a!=27) + } +} {3 26 28 29 31 33 46 48 55 60 73 77 80 81 82 91 scan 0 sort 0} +do_test where7-2.786.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=69 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR a=98 + OR b=300 + OR a=41 + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR a=33 + OR ((a BETWEEN 10 AND 12) AND a!=11) + } +} {1 2 10 12 28 33 37 39 41 54 58 60 69 80 98 scan 0 sort 0} +do_test where7-2.786.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=69 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR a=98 + OR b=300 + OR a=41 + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR a=33 + OR ((a BETWEEN 10 AND 12) AND a!=11) + } +} {1 2 10 12 28 33 37 39 41 54 58 60 69 80 98 scan 0 sort 0} +do_test where7-2.787.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR ((a BETWEEN 94 AND 96) AND a!=95) + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR b=619 + OR c=6006 + OR b=91 + OR b=297 + OR b=165 + } +} {1 15 16 17 18 22 24 27 53 68 70 71 79 90 94 96 scan 0 sort 0} +do_test where7-2.787.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 68 AND 70) AND a!=69) + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR ((a BETWEEN 94 AND 96) AND a!=95) + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR b=619 + OR c=6006 + OR b=91 + OR b=297 + OR b=165 + } +} {1 15 16 17 18 22 24 27 53 68 70 71 79 90 94 96 scan 0 sort 0} +do_test where7-2.788.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 9 AND 11) AND a!=10) + OR a=55 + OR (g='jihgfed' AND f GLOB 'xyzab*') + } +} {9 11 55 75 scan 0 sort 0} +do_test where7-2.788.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 9 AND 11) AND a!=10) + OR a=55 + OR (g='jihgfed' AND f GLOB 'xyzab*') + } +} {9 11 55 75 scan 0 sort 0} +do_test where7-2.789.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR b=737 + OR b=201 + OR a=7 + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR b=957 + } +} {2 7 26 67 84 86 87 scan 0 sort 0} +do_test where7-2.789.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR b=737 + OR b=201 + OR a=7 + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (g='yxwvuts' AND f GLOB 'cdefg*') + OR b=957 + } +} {2 7 26 67 84 86 87 scan 0 sort 0} +do_test where7-2.790.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 90 AND 92) AND a!=91) + OR a=74 + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR a=89 + } +} {18 44 67 70 74 79 89 90 92 95 96 97 scan 0 sort 0} +do_test where7-2.790.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 90 AND 92) AND a!=91) + OR a=74 + OR (g='lkjihgf' AND f GLOB 'pqrst*') + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') + OR a=89 + } +} {18 44 67 70 74 79 89 90 92 95 96 97 scan 0 sort 0} +do_test where7-2.791.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=179 + OR b=1081 + OR b=377 + OR b=495 + OR b=564 + OR b=289 + OR (g='qponmlk' AND f GLOB 'nopqr*') + } +} {39 45 scan 0 sort 0} +do_test where7-2.791.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=179 + OR b=1081 + OR b=377 + OR b=495 + OR b=564 + OR b=289 + OR (g='qponmlk' AND f GLOB 'nopqr*') + } +} {39 45 scan 0 sort 0} +do_test where7-2.792.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'wxyza*') + OR a=69 + OR a=12 + OR b=718 + OR ((a BETWEEN 20 AND 22) AND a!=21) + } +} {12 20 22 69 scan 0 sort 0} +do_test where7-2.792.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'wxyza*') + OR a=69 + OR a=12 + OR b=718 + OR ((a BETWEEN 20 AND 22) AND a!=21) + } +} {12 20 22 69 scan 0 sort 0} +do_test where7-2.793.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR f='klmnopqrs' + OR b=674 + OR a=96 + OR a=99 + OR b=608 + OR b=707 + OR f='cdefghijk' + OR a=91 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + } +} {2 10 23 25 28 36 54 62 80 88 91 96 99 scan 0 sort 0} +do_test where7-2.793.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'zabcd*') + OR f='klmnopqrs' + OR b=674 + OR a=96 + OR a=99 + OR b=608 + OR b=707 + OR f='cdefghijk' + OR a=91 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + } +} {2 10 23 25 28 36 54 62 80 88 91 96 99 scan 0 sort 0} +do_test where7-2.794.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR b=564 + OR b=784 + OR b=418 + OR b=275 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR a=58 + OR c=11011 + OR b=660 + } +} {9 25 31 32 33 35 38 58 60 61 87 88 scan 0 sort 0} +do_test where7-2.794.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR b=564 + OR b=784 + OR b=418 + OR b=275 + OR (g='gfedcba' AND f GLOB 'klmno*') + OR a=58 + OR c=11011 + OR b=660 + } +} {9 25 31 32 33 35 38 58 60 61 87 88 scan 0 sort 0} +do_test where7-2.795.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=25.0 AND d<26.0 AND d NOT NULL) + OR b=509 + OR b=1004 + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR f='pqrstuvwx' + } +} {15 25 28 30 41 57 59 67 93 scan 0 sort 0} +do_test where7-2.795.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=25.0 AND d<26.0 AND d NOT NULL) + OR b=509 + OR b=1004 + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR ((a BETWEEN 57 AND 59) AND a!=58) + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR f='pqrstuvwx' + } +} {15 25 28 30 41 57 59 67 93 scan 0 sort 0} +do_test where7-2.796.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=440 + OR ((a BETWEEN 52 AND 54) AND a!=53) + } +} {40 52 54 scan 0 sort 0} +do_test where7-2.796.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=440 + OR ((a BETWEEN 52 AND 54) AND a!=53) + } +} {40 52 54 scan 0 sort 0} +do_test where7-2.797.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=95.0 AND d<96.0 AND d NOT NULL) + OR f='abcdefghi' + } +} {26 52 78 95 scan 0 sort 0} +do_test where7-2.797.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=95.0 AND d<96.0 AND d NOT NULL) + OR f='abcdefghi' + } +} {26 52 78 95 scan 0 sort 0} +do_test where7-2.798.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=19 + OR a=29 + OR b=476 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR b=91 + } +} {19 29 41 scan 0 sort 0} +do_test where7-2.798.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=19 + OR a=29 + OR b=476 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR b=91 + } +} {19 29 41 scan 0 sort 0} +do_test where7-2.799.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='lmnopqrst' + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR a=47 + OR a=71 + } +} {8 11 37 47 63 71 89 scan 0 sort 0} +do_test where7-2.799.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='lmnopqrst' + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR a=47 + OR a=71 + } +} {8 11 37 47 63 71 89 scan 0 sort 0} +do_test where7-2.800.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=531 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=44 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR b=707 + OR b=322 + } +} {4 12 32 34 49 84 95 97 scan 0 sort 0} +do_test where7-2.800.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=531 + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=44 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR b=707 + OR b=322 + } +} {4 12 32 34 49 84 95 97 scan 0 sort 0} +do_test where7-2.801.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR f='jklmnopqr' + } +} {3 9 29 35 55 61 81 82 87 89 scan 0 sort 0} +do_test where7-2.801.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?efgh*' AND f GLOB 'defg*') + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR f='jklmnopqr' + } +} {3 9 29 35 55 61 81 82 87 89 scan 0 sort 0} +do_test where7-2.802.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=946 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR a=47 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR b=80 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR (g='tsrqpon' AND f GLOB 'xyzab*') + } +} {8 23 42 47 60 62 78 86 93 scan 0 sort 0} +do_test where7-2.802.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=946 + OR (g='ihgfedc' AND f GLOB 'abcde*') + OR a=47 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR b=80 + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR (g='tsrqpon' AND f GLOB 'xyzab*') + } +} {8 23 42 47 60 62 78 86 93 scan 0 sort 0} +do_test where7-2.803.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=48 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR b=1015 + OR a=57 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR b=165 + } +} {4 9 15 35 47 48 49 50 55 57 61 87 98 100 scan 0 sort 0} +do_test where7-2.803.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=48 + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR b=1015 + OR a=57 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR ((a BETWEEN 47 AND 49) AND a!=48) + OR ((a BETWEEN 98 AND 100) AND a!=99) + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR (d>=4.0 AND d<5.0 AND d NOT NULL) + OR b=165 + } +} {4 9 15 35 47 48 49 50 55 57 61 87 98 100 scan 0 sort 0} +do_test where7-2.804.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 97 AND 99) AND a!=98) + OR a=73 + OR b=1048 + OR c>=34035 + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR a=72 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=638 + } +} {58 72 73 80 91 93 97 99 scan 0 sort 0} +do_test where7-2.804.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 97 AND 99) AND a!=98) + OR a=73 + OR b=1048 + OR c>=34035 + OR (g='ihgfedc' AND f GLOB 'cdefg*') + OR a=72 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=638 + } +} {58 72 73 80 91 93 97 99 scan 0 sort 0} +do_test where7-2.805.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 28 AND 30) AND a!=29) + OR a=39 + OR b=165 + } +} {15 28 30 39 scan 0 sort 0} +do_test where7-2.805.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 28 AND 30) AND a!=29) + OR a=39 + OR b=165 + } +} {15 28 30 39 scan 0 sort 0} +do_test where7-2.806.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=50 + OR ((a BETWEEN 61 AND 63) AND a!=62) + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR a=32 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR a=14 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=946 + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR b=124 + } +} {14 17 32 43 45 50 53 55 61 63 69 86 93 95 97 scan 0 sort 0} +do_test where7-2.806.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=50 + OR ((a BETWEEN 61 AND 63) AND a!=62) + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR a=32 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR a=14 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR b=946 + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR b=124 + } +} {14 17 32 43 45 50 53 55 61 63 69 86 93 95 97 scan 0 sort 0} +do_test where7-2.807.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {52 66 88 90 scan 0 sort 0} +do_test where7-2.807.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 88 AND 90) AND a!=89) + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {52 66 88 90 scan 0 sort 0} +do_test where7-2.808.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=6 + OR f='tuvwxyzab' + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR b=286 + OR b=781 + } +} {6 19 26 45 59 71 97 scan 0 sort 0} +do_test where7-2.808.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=6 + OR f='tuvwxyzab' + OR (g='mlkjihg' AND f GLOB 'hijkl*') + OR b=286 + OR b=781 + } +} {6 19 26 45 59 71 97 scan 0 sort 0} +do_test where7-2.809.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR f='vwxyzabcd' + OR b=275 + } +} {9 11 21 25 35 37 43 47 61 63 73 77 79 81 87 89 99 100 scan 0 sort 0} +do_test where7-2.809.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR f='vwxyzabcd' + OR b=275 + } +} {9 11 21 25 35 37 43 47 61 63 73 77 79 81 87 89 99 100 scan 0 sort 0} +do_test where7-2.810.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR a=59 + } +} {4 30 59 64 89 91 scan 0 sort 0} +do_test where7-2.810.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) + OR (g='xwvutsr' AND f GLOB 'efghi*') + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'nopqr*') + OR a=59 + } +} {4 30 59 64 89 91 scan 0 sort 0} +do_test where7-2.811.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR b=663 + OR f='ghijklmno' + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR f='ghijklmno' + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR b=1081 + } +} {6 8 10 14 16 19 22 32 48 58 64 71 74 84 99 100 scan 0 sort 0} +do_test where7-2.811.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR b=663 + OR f='ghijklmno' + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR f='ghijklmno' + OR (d>=64.0 AND d<65.0 AND d NOT NULL) + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + OR b=1081 + } +} {6 8 10 14 16 19 22 32 48 58 64 71 74 84 99 100 scan 0 sort 0} +do_test where7-2.812.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 30 AND 32) AND a!=31) + OR a=96 + OR b=355 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR b=597 + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR b=168 + OR (g='vutsrqp' AND f GLOB 'pqrst*') + } +} {10 15 30 32 36 62 81 88 92 94 96 scan 0 sort 0} +do_test where7-2.812.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 30 AND 32) AND a!=31) + OR a=96 + OR b=355 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR b=597 + OR ((a BETWEEN 92 AND 94) AND a!=93) + OR (d>=88.0 AND d<89.0 AND d NOT NULL) + OR (f GLOB '?lmno*' AND f GLOB 'klmn*') + OR b=168 + OR (g='vutsrqp' AND f GLOB 'pqrst*') + } +} {10 15 30 32 36 62 81 88 92 94 96 scan 0 sort 0} +do_test where7-2.813.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=957 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR a=40 + } +} {9 40 47 58 60 87 89 scan 0 sort 0} +do_test where7-2.813.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=47.0 AND d<48.0 AND d NOT NULL) + OR b=957 + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR a=40 + } +} {9 40 47 58 60 87 89 scan 0 sort 0} +do_test where7-2.814.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 12 AND 14) AND a!=13) + OR a=36 + OR a=75 + OR b=179 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR b=850 + OR a=62 + } +} {12 14 18 36 43 62 65 75 scan 0 sort 0} +do_test where7-2.814.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 12 AND 14) AND a!=13) + OR a=36 + OR a=75 + OR b=179 + OR (d>=43.0 AND d<44.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'stuvw*') + OR (d>=65.0 AND d<66.0 AND d NOT NULL) + OR b=850 + OR a=62 + } +} {12 14 18 36 43 62 65 75 scan 0 sort 0} +do_test where7-2.815.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 21 AND 23) AND a!=22) + OR a=79 + OR a=66 + OR b=487 + OR a=1 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR c=5005 + OR a=47 + OR c=5005 + OR b=319 + OR b=1037 + } +} {1 13 14 15 21 23 29 47 54 66 79 scan 0 sort 0} +do_test where7-2.815.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 21 AND 23) AND a!=22) + OR a=79 + OR a=66 + OR b=487 + OR a=1 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR c=5005 + OR a=47 + OR c=5005 + OR b=319 + OR b=1037 + } +} {1 13 14 15 21 23 29 47 54 66 79 scan 0 sort 0} +do_test where7-2.816.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=176 + OR b=297 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR f='ijklmnopq' + } +} {8 16 25 27 34 60 86 scan 0 sort 0} +do_test where7-2.816.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=176 + OR b=297 + OR (g='tsrqpon' AND f GLOB 'zabcd*') + OR f='ijklmnopq' + } +} {8 16 25 27 34 60 86 scan 0 sort 0} +do_test where7-2.817.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=10.0 AND d<11.0 AND d NOT NULL) + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR b=319 + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR a=21 + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + } +} {9 10 11 21 29 31 33 72 90 92 scan 0 sort 0} +do_test where7-2.817.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=10.0 AND d<11.0 AND d NOT NULL) + OR ((a BETWEEN 90 AND 92) AND a!=91) + OR b=319 + OR ((a BETWEEN 31 AND 33) AND a!=32) + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR a=21 + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + } +} {9 10 11 21 29 31 33 72 90 92 scan 0 sort 0} +do_test where7-2.818.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=396 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=1012 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR b=784 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=979 + OR c<=10 + OR b=913 + OR b=66 + } +} {6 9 22 35 36 60 61 72 83 87 89 92 scan 0 sort 0} +do_test where7-2.818.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=22.0 AND d<23.0 AND d NOT NULL) + OR b=396 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR b=1012 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR b=784 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + OR b=979 + OR c<=10 + OR b=913 + OR b=66 + } +} {6 9 22 35 36 60 61 72 83 87 89 92 scan 0 sort 0} +do_test where7-2.819.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=3 + OR b=803 + } +} {3 73 scan 0 sort 0} +do_test where7-2.819.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=3 + OR b=803 + } +} {3 73 scan 0 sort 0} +do_test where7-2.820.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 79 AND 81) AND a!=80) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + } +} {16 19 23 25 42 45 68 71 79 81 94 97 scan 0 sort 0} +do_test where7-2.820.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 79 AND 81) AND a!=80) + OR (f GLOB '?rstu*' AND f GLOB 'qrst*') + OR ((a BETWEEN 23 AND 25) AND a!=24) + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + } +} {16 19 23 25 42 45 68 71 79 81 94 97 scan 0 sort 0} +do_test where7-2.821.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=1001 + OR a=16 + OR b=132 + OR b=1012 + OR f='xyzabcdef' + OR b=682 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + } +} {1 2 3 12 16 23 49 52 62 75 92 scan 0 sort 0} +do_test where7-2.821.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=1001 + OR a=16 + OR b=132 + OR b=1012 + OR f='xyzabcdef' + OR b=682 + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + } +} {1 2 3 12 16 23 49 52 62 75 92 scan 0 sort 0} +do_test where7-2.822.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=96 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + } +} {19 96 scan 0 sort 0} +do_test where7-2.822.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=96 + OR (d>=19.0 AND d<20.0 AND d NOT NULL) + } +} {19 96 scan 0 sort 0} +do_test where7-2.823.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=2 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR a=23 + OR b=1092 + OR c=19019 + OR b=245 + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR b=572 + OR ((a BETWEEN 22 AND 24) AND a!=23) + } +} {2 11 12 22 23 24 38 52 55 56 57 64 68 70 90 97 99 scan 0 sort 0} +do_test where7-2.823.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=2 + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + OR a=23 + OR b=1092 + OR c=19019 + OR b=245 + OR ((a BETWEEN 97 AND 99) AND a!=98) + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR b=572 + OR ((a BETWEEN 22 AND 24) AND a!=23) + } +} {2 11 12 22 23 24 38 52 55 56 57 64 68 70 90 97 99 scan 0 sort 0} +do_test where7-2.824.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=993 + OR c=17017 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=333 + } +} {16 29 37 49 50 51 53 85 scan 0 sort 0} +do_test where7-2.824.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) + OR b=993 + OR c=17017 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=333 + } +} {16 29 37 49 50 51 53 85 scan 0 sort 0} +do_test where7-2.825.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=330 + OR a=73 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=828 + OR b=363 + OR (g='rqponml' AND f GLOB 'lmnop*') + } +} {30 33 37 40 61 73 scan 0 sort 0} +do_test where7-2.825.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=330 + OR a=73 + OR (d>=61.0 AND d<62.0 AND d NOT NULL) + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=828 + OR b=363 + OR (g='rqponml' AND f GLOB 'lmnop*') + } +} {30 33 37 40 61 73 scan 0 sort 0} +do_test where7-2.826.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='gfedcba' AND f GLOB 'lmnop*') + OR a=41 + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR b=825 + } +} {29 41 75 89 scan 0 sort 0} +do_test where7-2.826.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='gfedcba' AND f GLOB 'lmnop*') + OR a=41 + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR b=825 + } +} {29 41 75 89 scan 0 sort 0} +do_test where7-2.827.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 46 AND 48) AND a!=47) + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=905 + OR b=176 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR b=561 + OR c=8008 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR b=935 + OR c=1001 + } +} {1 2 3 10 16 22 23 24 46 48 51 84 85 89 91 scan 0 sort 0} +do_test where7-2.827.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 46 AND 48) AND a!=47) + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + OR b=905 + OR b=176 + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR b=561 + OR c=8008 + OR (g='hgfedcb' AND f GLOB 'ghijk*') + OR b=935 + OR c=1001 + } +} {1 2 3 10 16 22 23 24 46 48 51 84 85 89 91 scan 0 sort 0} +do_test where7-2.828.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 75 AND 77) AND a!=76) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {72 75 77 scan 0 sort 0} +do_test where7-2.828.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 75 AND 77) AND a!=76) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {72 75 77 scan 0 sort 0} +do_test where7-2.829.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 5 AND 7) AND a!=6) + OR a=28 + } +} {5 7 28 scan 0 sort 0} +do_test where7-2.829.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 5 AND 7) AND a!=6) + OR a=28 + } +} {5 7 28 scan 0 sort 0} +do_test where7-2.830.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=781 + OR b=410 + } +} {71 scan 0 sort 0} +do_test where7-2.830.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=781 + OR b=410 + } +} {71 scan 0 sort 0} +do_test where7-2.831.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 18 AND 20) AND a!=19) + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR f='zabcdefgh' + OR b=861 + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR a=28 + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=311 + } +} {6 15 18 20 25 28 32 40 42 51 56 58 63 72 77 84 scan 0 sort 0} +do_test where7-2.831.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 18 AND 20) AND a!=19) + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR f='zabcdefgh' + OR b=861 + OR (g='vutsrqp' AND f GLOB 'pqrst*') + OR a=28 + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=311 + } +} {6 15 18 20 25 28 32 40 42 51 56 58 63 72 77 84 scan 0 sort 0} +do_test where7-2.832.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=575 + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR b=418 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR b=792 + OR b=861 + OR b=220 + OR ((a BETWEEN 89 AND 91) AND a!=90) + } +} {12 15 20 38 41 64 67 72 73 89 90 91 93 scan 0 sort 0} +do_test where7-2.832.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=575 + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR b=418 + OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') + OR b=792 + OR b=861 + OR b=220 + OR ((a BETWEEN 89 AND 91) AND a!=90) + } +} {12 15 20 38 41 64 67 72 73 89 90 91 93 scan 0 sort 0} +do_test where7-2.833.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=517 + OR b=913 + OR b=253 + OR b=198 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=17 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + } +} {17 18 23 27 47 83 85 scan 0 sort 0} +do_test where7-2.833.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=517 + OR b=913 + OR b=253 + OR b=198 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR a=17 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + } +} {17 18 23 27 47 83 85 scan 0 sort 0} +do_test where7-2.834.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'qrstu*') + OR b=693 + OR a=73 + OR b=627 + OR c=5005 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=267 + OR b=872 + OR a=27 + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {13 14 15 27 28 42 57 62 63 73 88 scan 0 sort 0} +do_test where7-2.834.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'qrstu*') + OR b=693 + OR a=73 + OR b=627 + OR c=5005 + OR (d>=62.0 AND d<63.0 AND d NOT NULL) + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR b=267 + OR b=872 + OR a=27 + OR (g='gfedcba' AND f GLOB 'klmno*') + } +} {13 14 15 27 28 42 57 62 63 73 88 scan 0 sort 0} +do_test where7-2.835.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=10 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=1059 + OR a=70 + OR a=93 + } +} {10 13 15 70 93 95 97 scan 0 sort 0} +do_test where7-2.835.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=10 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=1059 + OR a=70 + OR a=93 + } +} {10 13 15 70 93 95 97 scan 0 sort 0} +do_test where7-2.836.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=30 + OR a=32 + OR b=1037 + OR b=198 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR a=25 + } +} {13 18 25 30 32 scan 0 sort 0} +do_test where7-2.836.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=30 + OR a=32 + OR b=1037 + OR b=198 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR a=25 + } +} {13 18 25 30 32 scan 0 sort 0} +do_test where7-2.837.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=66 + OR b=322 + OR b=465 + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR (g='lkjihgf' AND f GLOB 'mnopq*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR b=454 + } +} {6 7 38 46 64 77 79 89 scan 0 sort 0} +do_test where7-2.837.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') + OR b=66 + OR b=322 + OR b=465 + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR (d>=7.0 AND d<8.0 AND d NOT NULL) + OR ((a BETWEEN 77 AND 79) AND a!=78) + OR (g='lkjihgf' AND f GLOB 'mnopq*') + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR b=454 + } +} {6 7 38 46 64 77 79 89 scan 0 sort 0} +do_test where7-2.838.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=924 + OR ((a BETWEEN 35 AND 37) AND a!=36) + OR c=15015 + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR (g='onmlkji' AND f GLOB 'abcde*') + OR b=803 + } +} {3 5 35 37 43 44 45 52 73 84 scan 0 sort 0} +do_test where7-2.838.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=924 + OR ((a BETWEEN 35 AND 37) AND a!=36) + OR c=15015 + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR (g='onmlkji' AND f GLOB 'abcde*') + OR b=803 + } +} {3 5 35 37 43 44 45 52 73 84 scan 0 sort 0} +do_test where7-2.839.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1100 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR a=75 + OR a=45 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR a=27 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=850 + OR ((a BETWEEN 55 AND 57) AND a!=56) + } +} {12 27 45 55 57 68 70 72 74 75 77 90 100 scan 0 sort 0} +do_test where7-2.839.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1100 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR ((a BETWEEN 72 AND 74) AND a!=73) + OR ((a BETWEEN 68 AND 70) AND a!=69) + OR a=75 + OR a=45 + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR a=27 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR b=850 + OR ((a BETWEEN 55 AND 57) AND a!=56) + } +} {12 27 45 55 57 68 70 72 74 75 77 90 100 scan 0 sort 0} +do_test where7-2.840.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=751 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR a=89 + OR ((a BETWEEN 36 AND 38) AND a!=37) + } +} {36 38 56 71 89 96 98 scan 0 sort 0} +do_test where7-2.840.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=751 + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR (d>=71.0 AND d<72.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR (d>=56.0 AND d<57.0 AND d NOT NULL) + OR a=89 + OR ((a BETWEEN 36 AND 38) AND a!=37) + } +} {36 38 56 71 89 96 98 scan 0 sort 0} +do_test where7-2.841.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR a=1 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + } +} {1 9 19 scan 0 sort 0} +do_test where7-2.841.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='wvutsrq' AND f GLOB 'jklmn*') + OR (g='yxwvuts' AND f GLOB 'bcdef*') + OR a=1 + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + } +} {1 9 19 scan 0 sort 0} +do_test where7-2.842.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=927 + OR c=15015 + OR f='klmnopqrs' + OR c=8008 + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR b=960 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR b=443 + OR (g='rqponml' AND f GLOB 'ijklm*') + } +} {10 22 23 24 34 36 41 43 44 45 62 76 88 scan 0 sort 0} +do_test where7-2.842.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=927 + OR c=15015 + OR f='klmnopqrs' + OR c=8008 + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR b=960 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR b=443 + OR (g='rqponml' AND f GLOB 'ijklm*') + } +} {10 22 23 24 34 36 41 43 44 45 62 76 88 scan 0 sort 0} +do_test where7-2.843.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=212 + OR f='cdefghijk' + } +} {2 28 37 54 80 scan 0 sort 0} +do_test where7-2.843.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=37.0 AND d<38.0 AND d NOT NULL) + OR b=212 + OR f='cdefghijk' + } +} {2 28 37 54 80 scan 0 sort 0} +do_test where7-2.844.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=685 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR b=520 + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR a=53 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=938 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR c=25025 + } +} {43 53 63 73 74 75 76 91 93 scan 0 sort 0} +do_test where7-2.844.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=685 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR b=520 + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR a=53 + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=938 + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR c=25025 + } +} {43 53 63 73 74 75 76 91 93 scan 0 sort 0} +do_test where7-2.845.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=583 + OR b=894 + OR c=26026 + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + } +} {53 76 77 78 84 scan 0 sort 0} +do_test where7-2.845.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=583 + OR b=894 + OR c=26026 + OR (d>=84.0 AND d<85.0 AND d NOT NULL) + } +} {53 76 77 78 84 scan 0 sort 0} +do_test where7-2.846.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='abcdefghi' + OR (g='edcbazy' AND f GLOB 'wxyza*') + } +} {26 52 78 100 scan 0 sort 0} +do_test where7-2.846.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='abcdefghi' + OR (g='edcbazy' AND f GLOB 'wxyza*') + } +} {26 52 78 100 scan 0 sort 0} +do_test where7-2.847.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1103 + OR b=638 + OR b=792 + OR b=1034 + OR b=308 + OR f='nopqrstuv' + OR b=264 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + } +} {13 24 28 33 35 39 58 65 72 91 94 scan 0 sort 0} +do_test where7-2.847.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1103 + OR b=638 + OR b=792 + OR b=1034 + OR b=308 + OR f='nopqrstuv' + OR b=264 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR (d>=58.0 AND d<59.0 AND d NOT NULL) + } +} {13 24 28 33 35 39 58 65 72 91 94 scan 0 sort 0} +do_test where7-2.848.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='defghijkl' + OR b=814 + OR f='yzabcdefg' + } +} {3 24 29 50 55 74 76 81 scan 0 sort 0} +do_test where7-2.848.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='defghijkl' + OR b=814 + OR f='yzabcdefg' + } +} {3 24 29 50 55 74 76 81 scan 0 sort 0} +do_test where7-2.849.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=209 + OR b=806 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {8 17 19 scan 0 sort 0} +do_test where7-2.849.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=209 + OR b=806 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'rstuv*') + } +} {8 17 19 scan 0 sort 0} +do_test where7-2.850.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='opqrstuvw' + OR b=69 + OR b=366 + } +} {14 40 66 92 scan 0 sort 0} +do_test where7-2.850.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='opqrstuvw' + OR b=69 + OR b=366 + } +} {14 40 66 92 scan 0 sort 0} +do_test where7-2.851.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=4.0 AND d<5.0 AND d NOT NULL) + OR a=45 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR a=69 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {4 45 69 71 72 scan 0 sort 0} +do_test where7-2.851.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=4.0 AND d<5.0 AND d NOT NULL) + OR a=45 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR a=69 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {4 45 69 71 72 scan 0 sort 0} +do_test where7-2.852.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=9009 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + } +} {9 10 25 26 27 67 85 scan 0 sort 0} +do_test where7-2.852.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=9009 + OR (d>=85.0 AND d<86.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR (d>=9.0 AND d<10.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'pqrst*') + } +} {9 10 25 26 27 67 85 scan 0 sort 0} +do_test where7-2.853.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=98 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR a=47 + OR c=24024 + OR a=27 + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + } +} {20 27 45 47 63 70 71 72 98 100 scan 0 sort 0} +do_test where7-2.853.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=98 + OR (d>=100.0 AND d<101.0 AND d NOT NULL) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) + OR a=47 + OR c=24024 + OR a=27 + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + } +} {20 27 45 47 63 70 71 72 98 100 scan 0 sort 0} +do_test where7-2.854.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'wxyza*') + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR a=19 + } +} {19 22 44 scan 0 sort 0} +do_test where7-2.854.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'wxyza*') + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR a=19 + } +} {19 22 44 scan 0 sort 0} +do_test where7-2.855.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=12012 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR (g='edcbazy' AND f GLOB 'uvwxy*') + } +} {16 18 34 35 36 80 98 scan 0 sort 0} +do_test where7-2.855.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=12012 + OR (d>=80.0 AND d<81.0 AND d NOT NULL) + OR ((a BETWEEN 16 AND 18) AND a!=17) + OR (g='edcbazy' AND f GLOB 'uvwxy*') + } +} {16 18 34 35 36 80 98 scan 0 sort 0} +do_test where7-2.856.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 38 AND 40) AND a!=39) + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR b=429 + OR f='jklmnopqr' + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR ((a BETWEEN 77 AND 79) AND a!=78) + } +} {9 12 35 38 39 40 48 61 64 77 79 87 90 scan 0 sort 0} +do_test where7-2.856.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 38 AND 40) AND a!=39) + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR b=429 + OR f='jklmnopqr' + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR ((a BETWEEN 77 AND 79) AND a!=78) + } +} {9 12 35 38 39 40 48 61 64 77 79 87 90 scan 0 sort 0} +do_test where7-2.857.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='lkjihgf' AND f GLOB 'mnopq*') + OR b=190 + } +} {64 scan 0 sort 0} +do_test where7-2.857.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='lkjihgf' AND f GLOB 'mnopq*') + OR b=190 + } +} {64 scan 0 sort 0} +do_test where7-2.858.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'yzabc*') + OR b=674 + OR b=289 + } +} {76 scan 0 sort 0} +do_test where7-2.858.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'yzabc*') + OR b=674 + OR b=289 + } +} {76 scan 0 sort 0} +do_test where7-2.859.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=17 + OR b=539 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + } +} {17 21 47 49 scan 0 sort 0} +do_test where7-2.859.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=17 + OR b=539 + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR (g='utsrqpo' AND f GLOB 'vwxyz*') + } +} {17 21 47 49 scan 0 sort 0} +do_test where7-2.860.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=924 + OR c=27027 + OR ((a BETWEEN 65 AND 67) AND a!=66) + } +} {65 67 79 80 81 84 scan 0 sort 0} +do_test where7-2.860.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=924 + OR c=27027 + OR ((a BETWEEN 65 AND 67) AND a!=66) + } +} {65 67 79 80 81 84 scan 0 sort 0} +do_test where7-2.861.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=564 + OR f='mnopqrstu' + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=1103 + } +} {12 28 30 38 64 90 scan 0 sort 0} +do_test where7-2.861.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=564 + OR f='mnopqrstu' + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=1103 + } +} {12 28 30 38 64 90 scan 0 sort 0} +do_test where7-2.862.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=231 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR a=38 + OR a=4 + OR b=784 + } +} {4 21 24 38 scan 0 sort 0} +do_test where7-2.862.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=231 + OR (d>=24.0 AND d<25.0 AND d NOT NULL) + OR a=38 + OR a=4 + OR b=784 + } +} {4 21 24 38 scan 0 sort 0} +do_test where7-2.863.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='ghijklmno' + OR a=26 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=81 + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=275 + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR b=311 + OR b=894 + OR b=872 + } +} {3 6 25 26 28 30 32 58 68 81 84 87 scan 0 sort 0} +do_test where7-2.863.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='ghijklmno' + OR a=26 + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR a=81 + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + OR ((a BETWEEN 28 AND 30) AND a!=29) + OR b=275 + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR b=311 + OR b=894 + OR b=872 + } +} {3 6 25 26 28 30 32 58 68 81 84 87 scan 0 sort 0} +do_test where7-2.864.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=91 + OR b=619 + } +} {91 scan 0 sort 0} +do_test where7-2.864.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=91 + OR b=619 + } +} {91 scan 0 sort 0} +do_test where7-2.865.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=4.0 AND d<5.0 AND d NOT NULL) + OR a=85 + OR f IS NULL + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=154 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + } +} {4 14 25 40 42 49 51 66 68 85 87 89 scan 0 sort 0} +do_test where7-2.865.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=4.0 AND d<5.0 AND d NOT NULL) + OR a=85 + OR f IS NULL + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=154 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + } +} {4 14 25 40 42 49 51 66 68 85 87 89 scan 0 sort 0} +do_test where7-2.866.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=44 + OR b=55 + OR a=30 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR 1000000=75.0 AND d<76.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'hijkl*') + } +} {5 19 24 30 33 44 45 71 75 97 99 scan 0 sort 0} +do_test where7-2.866.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=44 + OR b=55 + OR a=30 + OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR 1000000=75.0 AND d<76.0 AND d NOT NULL) + OR (g='rqponml' AND f GLOB 'hijkl*') + } +} {5 19 24 30 33 44 45 71 75 97 99 scan 0 sort 0} +do_test where7-2.867.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR b=36 + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {16 33 35 80 82 scan 0 sort 0} +do_test where7-2.867.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) + OR ((a BETWEEN 80 AND 82) AND a!=81) + OR b=36 + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {16 33 35 80 82 scan 0 sort 0} +do_test where7-2.868.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR c=26026 + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR a=56 + OR b=506 + OR b=781 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + } +} {28 35 37 39 46 56 71 76 77 78 97 scan 0 sort 0} +do_test where7-2.868.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR c=26026 + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR a=56 + OR b=506 + OR b=781 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + } +} {28 35 37 39 46 56 71 76 77 78 97 scan 0 sort 0} +do_test where7-2.869.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='edcbazy' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR f='xyzabcdef' + OR b=517 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (g='kjihgfe' AND f GLOB 'qrstu*') + } +} {23 25 27 39 47 49 68 75 76 89 91 98 scan 0 sort 0} +do_test where7-2.869.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='edcbazy' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 25 AND 27) AND a!=26) + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR ((a BETWEEN 89 AND 91) AND a!=90) + OR f='xyzabcdef' + OR b=517 + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR (g='kjihgfe' AND f GLOB 'qrstu*') + } +} {23 25 27 39 47 49 68 75 76 89 91 98 scan 0 sort 0} +do_test where7-2.870.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=54 + OR a=59 + } +} {54 59 scan 0 sort 0} +do_test where7-2.870.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=54 + OR a=59 + } +} {54 59 scan 0 sort 0} +do_test where7-2.871.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='tsrqpon' AND f GLOB 'yzabc*') + OR b=762 + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR a=25 + OR ((a BETWEEN 65 AND 67) AND a!=66) + } +} {24 25 48 65 67 scan 0 sort 0} +do_test where7-2.871.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='tsrqpon' AND f GLOB 'yzabc*') + OR b=762 + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR a=25 + OR ((a BETWEEN 65 AND 67) AND a!=66) + } +} {24 25 48 65 67 scan 0 sort 0} +do_test where7-2.872.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=59.0 AND d<60.0 AND d NOT NULL) + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR b=839 + OR f='defghijkl' + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR b=498 + } +} {3 14 16 29 52 55 59 60 81 85 95 scan 0 sort 0} +do_test where7-2.872.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=59.0 AND d<60.0 AND d NOT NULL) + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR b=839 + OR f='defghijkl' + OR (d>=95.0 AND d<96.0 AND d NOT NULL) + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR (d>=52.0 AND d<53.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR b=498 + } +} {3 14 16 29 52 55 59 60 81 85 95 scan 0 sort 0} +do_test where7-2.873.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=256 + OR c=19019 + OR a=54 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=498 + OR b=77 + } +} {7 46 54 55 56 57 scan 0 sort 0} +do_test where7-2.873.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=256 + OR c=19019 + OR a=54 + OR (d>=46.0 AND d<47.0 AND d NOT NULL) + OR b=498 + OR b=77 + } +} {7 46 54 55 56 57 scan 0 sort 0} +do_test where7-2.874.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=256 + OR b=586 + OR a=74 + OR b=113 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR b=495 + } +} {45 61 74 99 scan 0 sort 0} +do_test where7-2.874.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='mlkjihg' AND f GLOB 'jklmn*') + OR b=256 + OR b=586 + OR a=74 + OR b=113 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR b=495 + } +} {45 61 74 99 scan 0 sort 0} +do_test where7-2.875.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=12 + OR a=50 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR ((a BETWEEN 66 AND 68) AND a!=67) + } +} {12 33 50 66 68 scan 0 sort 0} +do_test where7-2.875.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=12 + OR a=50 + OR (d>=33.0 AND d<34.0 AND d NOT NULL) + OR ((a BETWEEN 66 AND 68) AND a!=67) + } +} {12 33 50 66 68 scan 0 sort 0} +do_test where7-2.876.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=308 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR a=83 + OR c=23023 + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR a=58 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR (g='srqponm' AND f GLOB 'efghi*') + OR c=4004 + } +} {10 11 12 17 19 28 30 53 57 58 65 67 68 69 73 83 scan 0 sort 0} +do_test where7-2.876.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=308 + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR a=83 + OR c=23023 + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR (g='lkjihgf' AND f GLOB 'nopqr*') + OR a=58 + OR ((a BETWEEN 17 AND 19) AND a!=18) + OR (g='srqponm' AND f GLOB 'efghi*') + OR c=4004 + } +} {10 11 12 17 19 28 30 53 57 58 65 67 68 69 73 83 scan 0 sort 0} +do_test where7-2.877.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=476 + OR a=26 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=762 + OR b=157 + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'cdefg*') + } +} {17 26 54 87 scan 0 sort 0} +do_test where7-2.877.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=476 + OR a=26 + OR (d>=87.0 AND d<88.0 AND d NOT NULL) + OR b=762 + OR b=157 + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (g='nmlkjih' AND f GLOB 'cdefg*') + } +} {17 26 54 87 scan 0 sort 0} +do_test where7-2.878.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=77.0 AND d<78.0 AND d NOT NULL) + OR a=1 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=278 + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR f='qrstuvwxy' + OR (g='onmlkji' AND f GLOB 'abcde*') + OR ((a BETWEEN 82 AND 84) AND a!=83) + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + } +} {1 3 16 42 52 68 72 74 77 82 84 93 94 95 98 scan 0 sort 0} +do_test where7-2.878.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=77.0 AND d<78.0 AND d NOT NULL) + OR a=1 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=278 + OR (g='xwvutsr' AND f GLOB 'defgh*') + OR f='qrstuvwxy' + OR (g='onmlkji' AND f GLOB 'abcde*') + OR ((a BETWEEN 82 AND 84) AND a!=83) + OR (g='edcbazy' AND f GLOB 'uvwxy*') + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + } +} {1 3 16 42 52 68 72 74 77 82 84 93 94 95 98 scan 0 sort 0} +do_test where7-2.879.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=124 + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=759 + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR ((a BETWEEN 45 AND 47) AND a!=46) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {12 38 41 43 45 47 64 69 72 90 92 96 scan 0 sort 0} +do_test where7-2.879.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=124 + OR (d>=92.0 AND d<93.0 AND d NOT NULL) + OR ((a BETWEEN 41 AND 43) AND a!=42) + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=759 + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR ((a BETWEEN 45 AND 47) AND a!=46) + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + } +} {12 38 41 43 45 47 64 69 72 90 92 96 scan 0 sort 0} +do_test where7-2.880.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=872 + OR b=267 + OR b=814 + OR b=99 + OR c<=10 + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR b=44 + OR f='zabcdefgh' + OR b=979 + OR (g='rqponml' AND f GLOB 'hijkl*') + } +} {4 8 9 10 25 33 51 74 77 89 scan 0 sort 0} +do_test where7-2.880.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=872 + OR b=267 + OR b=814 + OR b=99 + OR c<=10 + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR b=44 + OR f='zabcdefgh' + OR b=979 + OR (g='rqponml' AND f GLOB 'hijkl*') + } +} {4 8 9 10 25 33 51 74 77 89 scan 0 sort 0} +do_test where7-2.881.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) + OR f='xyzabcdef' + } +} {23 26 49 75 scan 0 sort 0} +do_test where7-2.881.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) + OR f='xyzabcdef' + } +} {23 26 49 75 scan 0 sort 0} +do_test where7-2.882.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=487 + OR b=355 + OR c=9009 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=113 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR a=90 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR f='nopqrstuv' + } +} {8 13 24 25 26 27 32 34 39 65 66 87 90 91 scan 0 sort 0} +do_test where7-2.882.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=487 + OR b=355 + OR c=9009 + OR (d>=8.0 AND d<9.0 AND d NOT NULL) + OR ((a BETWEEN 32 AND 34) AND a!=33) + OR b=113 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR a=90 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR (g='hgfedcb' AND f GLOB 'jklmn*') + OR f='nopqrstuv' + } +} {8 13 24 25 26 27 32 34 39 65 66 87 90 91 scan 0 sort 0} +do_test where7-2.883.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) + OR b=275 + } +} {25 34 scan 0 sort 0} +do_test where7-2.883.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) + OR b=275 + } +} {25 34 scan 0 sort 0} +do_test where7-2.884.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=355 + OR a=44 + OR b=374 + OR c=25025 + OR b=198 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR d<0.0 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR c=9009 + } +} {4 6 18 25 26 27 34 41 44 69 71 73 74 75 scan 0 sort 0} +do_test where7-2.884.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=355 + OR a=44 + OR b=374 + OR c=25025 + OR b=198 + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR d<0.0 + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR c=9009 + } +} {4 6 18 25 26 27 34 41 44 69 71 73 74 75 scan 0 sort 0} +do_test where7-2.885.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR b=814 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + } +} {19 45 54 71 74 97 scan 0 sort 0} +do_test where7-2.885.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?uvwx*' AND f GLOB 'tuvw*') + OR b=814 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + } +} {19 45 54 71 74 97 scan 0 sort 0} +do_test where7-2.886.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='lkjihgf' AND f GLOB 'mnopq*') + OR b=333 + OR b=275 + } +} {25 64 scan 0 sort 0} +do_test where7-2.886.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='lkjihgf' AND f GLOB 'mnopq*') + OR b=333 + OR b=275 + } +} {25 64 scan 0 sort 0} +do_test where7-2.887.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='ihgfedc' AND f GLOB 'efghi*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {33 35 82 scan 0 sort 0} +do_test where7-2.887.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='ihgfedc' AND f GLOB 'efghi*') + OR ((a BETWEEN 33 AND 35) AND a!=34) + } +} {33 35 82 scan 0 sort 0} +do_test where7-2.888.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 11 AND 13) AND a!=12) + OR b=253 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=286 + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + } +} {10 11 13 14 23 26 40 66 92 scan 0 sort 0} +do_test where7-2.888.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 11 AND 13) AND a!=12) + OR b=253 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=286 + OR (d>=10.0 AND d<11.0 AND d NOT NULL) + } +} {10 11 13 14 23 26 40 66 92 scan 0 sort 0} +do_test where7-2.889.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 26 AND 28) AND a!=27) + OR b=421 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR f='ijklmnopq' + OR b=891 + OR b=1056 + } +} {5 8 15 26 28 34 60 81 86 90 96 scan 0 sort 0} +do_test where7-2.889.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR ((a BETWEEN 26 AND 28) AND a!=27) + OR b=421 + OR (g='xwvutsr' AND f GLOB 'fghij*') + OR f='ijklmnopq' + OR b=891 + OR b=1056 + } +} {5 8 15 26 28 34 60 81 86 90 96 scan 0 sort 0} +do_test where7-2.890.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='fghijklmn' + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR b=671 + OR (g='xwvutsr' AND f GLOB 'hijkl*') + } +} {5 7 31 39 57 61 83 99 scan 0 sort 0} +do_test where7-2.890.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='fghijklmn' + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR (g='edcbazy' AND f GLOB 'vwxyz*') + OR b=671 + OR (g='xwvutsr' AND f GLOB 'hijkl*') + } +} {5 7 31 39 57 61 83 99 scan 0 sort 0} +do_test where7-2.891.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='lkjihgf' AND f GLOB 'lmnop*') + OR (g='srqponm' AND f GLOB 'fghij*') + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + } +} {4 6 11 31 63 68 scan 0 sort 0} +do_test where7-2.891.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='lkjihgf' AND f GLOB 'lmnop*') + OR (g='srqponm' AND f GLOB 'fghij*') + OR ((a BETWEEN 4 AND 6) AND a!=5) + OR (g='kjihgfe' AND f GLOB 'qrstu*') + OR (d>=11.0 AND d<12.0 AND d NOT NULL) + } +} {4 6 11 31 63 68 scan 0 sort 0} +do_test where7-2.892.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=11011 + OR a=20 + OR b=432 + OR b=410 + OR a=86 + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=638 + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR b=190 + } +} {20 31 32 33 58 60 86 89 scan 0 sort 0} +do_test where7-2.892.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=11011 + OR a=20 + OR b=432 + OR b=410 + OR a=86 + OR (d>=89.0 AND d<90.0 AND d NOT NULL) + OR b=638 + OR ((a BETWEEN 58 AND 60) AND a!=59) + OR b=190 + } +} {20 31 32 33 58 60 86 89 scan 0 sort 0} +do_test where7-2.893.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=88 + OR ((a BETWEEN 42 AND 44) AND a!=43) + OR a=76 + OR b=69 + OR b=847 + OR b=275 + } +} {8 25 42 44 76 77 scan 0 sort 0} +do_test where7-2.893.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=88 + OR ((a BETWEEN 42 AND 44) AND a!=43) + OR a=76 + OR b=69 + OR b=847 + OR b=275 + } +} {8 25 42 44 76 77 scan 0 sort 0} +do_test where7-2.894.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=781 + OR b=77 + OR b=58 + OR ((a BETWEEN 67 AND 69) AND a!=68) + } +} {7 67 69 71 scan 0 sort 0} +do_test where7-2.894.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=781 + OR b=77 + OR b=58 + OR ((a BETWEEN 67 AND 69) AND a!=68) + } +} {7 67 69 71 scan 0 sort 0} +do_test where7-2.895.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 67 AND 69) AND a!=68) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR a=46 + OR b=187 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='onmlkji' AND f GLOB 'yzabc*') + } +} {17 20 46 50 67 69 71 scan 0 sort 0} +do_test where7-2.895.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 67 AND 69) AND a!=68) + OR (d>=69.0 AND d<70.0 AND d NOT NULL) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR a=46 + OR b=187 + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR (g='onmlkji' AND f GLOB 'yzabc*') + } +} {17 20 46 50 67 69 71 scan 0 sort 0} +do_test where7-2.896.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR a=99 + OR c=3003 + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR b=300 + OR b=718 + OR c>=34035 + OR b=264 + } +} {7 8 9 24 57 97 99 scan 0 sort 0} +do_test where7-2.896.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR a=99 + OR c=3003 + OR (d>=57.0 AND d<58.0 AND d NOT NULL) + OR b=300 + OR b=718 + OR c>=34035 + OR b=264 + } +} {7 8 9 24 57 97 99 scan 0 sort 0} +do_test where7-2.897.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=872 + OR b=209 + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR b=355 + OR b=729 + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR a=58 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=608 + } +} {14 19 40 58 65 66 67 81 83 92 scan 0 sort 0} +do_test where7-2.897.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=872 + OR b=209 + OR ((a BETWEEN 65 AND 67) AND a!=66) + OR b=355 + OR b=729 + OR ((a BETWEEN 81 AND 83) AND a!=82) + OR a=58 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR b=608 + } +} {14 19 40 58 65 66 67 81 83 92 scan 0 sort 0} +do_test where7-2.898.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=29029 + OR f='efghijklm' + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR a=26 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + } +} {3 4 26 29 30 48 55 56 81 82 85 86 87 scan 0 sort 0} +do_test where7-2.898.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=29029 + OR f='efghijklm' + OR (d>=48.0 AND d<49.0 AND d NOT NULL) + OR a=26 + OR (f GLOB '?efgh*' AND f GLOB 'defg*') + } +} {3 4 26 29 30 48 55 56 81 82 85 86 87 scan 0 sort 0} +do_test where7-2.899.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=59 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR a=7 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=762 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + } +} {7 12 14 26 40 59 66 92 scan 0 sort 0} +do_test where7-2.899.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=59 + OR (g='wvutsrq' AND f GLOB 'mnopq*') + OR a=7 + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=762 + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + } +} {7 12 14 26 40 59 66 92 scan 0 sort 0} +do_test where7-2.900.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='gfedcba' AND f GLOB 'nopqr*') + OR b=539 + OR b=399 + } +} {49 91 scan 0 sort 0} +do_test where7-2.900.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='gfedcba' AND f GLOB 'nopqr*') + OR b=539 + OR b=399 + } +} {49 91 scan 0 sort 0} +do_test where7-2.901.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR a=92 + } +} {71 73 92 96 98 scan 0 sort 0} +do_test where7-2.901.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 71 AND 73) AND a!=72) + OR ((a BETWEEN 96 AND 98) AND a!=97) + OR a=92 + } +} {71 73 92 96 98 scan 0 sort 0} +do_test where7-2.902.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (g='rqponml' AND f GLOB 'klmno*') + OR f='lmnopqrst' + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {9 11 35 36 37 57 61 63 87 89 scan 0 sort 0} +do_test where7-2.902.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR (g='rqponml' AND f GLOB 'klmno*') + OR f='lmnopqrst' + OR (g='nmlkjih' AND f GLOB 'fghij*') + } +} {9 11 35 36 37 57 61 63 87 89 scan 0 sort 0} +do_test where7-2.903.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 69 AND 71) AND a!=70) + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=652 + } +} {69 71 91 93 scan 0 sort 0} +do_test where7-2.903.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 69 AND 71) AND a!=70) + OR ((a BETWEEN 91 AND 93) AND a!=92) + OR b=652 + } +} {69 71 91 93 scan 0 sort 0} +do_test where7-2.904.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1067 + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=520 + OR b=399 + OR b=209 + OR a=68 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + } +} {18 19 53 54 55 68 73 94 97 scan 0 sort 0} +do_test where7-2.904.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1067 + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR (g='jihgfed' AND f GLOB 'vwxyz*') + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=520 + OR b=399 + OR b=209 + OR a=68 + OR (g='fedcbaz' AND f GLOB 'qrstu*') + } +} {18 19 53 54 55 68 73 94 97 scan 0 sort 0} +do_test where7-2.905.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) + OR a=57 + OR b=55 + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR ((a BETWEEN 0 AND 2) AND a!=1) + OR ((a BETWEEN 21 AND 23) AND a!=22) + } +} {2 5 20 21 22 23 34 37 57 79 scan 0 sort 0} +do_test where7-2.905.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) + OR a=57 + OR b=55 + OR (d>=34.0 AND d<35.0 AND d NOT NULL) + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR (g='rqponml' AND f GLOB 'lmnop*') + OR ((a BETWEEN 0 AND 2) AND a!=1) + OR ((a BETWEEN 21 AND 23) AND a!=22) + } +} {2 5 20 21 22 23 34 37 57 79 scan 0 sort 0} +do_test where7-2.906.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 21 AND 23) AND a!=22) + OR a=2 + OR b=784 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR b=850 + } +} {2 21 23 81 scan 0 sort 0} +do_test where7-2.906.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 21 AND 23) AND a!=22) + OR a=2 + OR b=784 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='ihgfedc' AND f GLOB 'defgh*') + OR b=850 + } +} {2 21 23 81 scan 0 sort 0} +do_test where7-2.907.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=748 + OR b=209 + OR a=100 + } +} {19 45 51 68 100 scan 0 sort 0} +do_test where7-2.907.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=748 + OR b=209 + OR a=100 + } +} {19 45 51 68 100 scan 0 sort 0} +do_test where7-2.908.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR a=18 + OR a=30 + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR b=792 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR c=26026 + OR (g='rqponml' AND f GLOB 'hijkl*') + } +} {8 9 10 11 18 19 21 30 33 37 63 72 76 77 78 84 86 89 scan 0 sort 0} +do_test where7-2.908.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'zabcd*') + OR a=18 + OR a=30 + OR ((a BETWEEN 9 AND 11) AND a!=10) + OR ((a BETWEEN 84 AND 86) AND a!=85) + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR b=792 + OR (f GLOB '?mnop*' AND f GLOB 'lmno*') + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR c=26026 + OR (g='rqponml' AND f GLOB 'hijkl*') + } +} {8 9 10 11 18 19 21 30 33 37 63 72 76 77 78 84 86 89 scan 0 sort 0} +do_test where7-2.909.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=968 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR a=78 + OR ((a BETWEEN 90 AND 92) AND a!=91) + } +} {16 22 48 63 65 72 74 78 88 90 92 100 scan 0 sort 0} +do_test where7-2.909.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=968 + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR (d>=72.0 AND d<73.0 AND d NOT NULL) + OR a=78 + OR ((a BETWEEN 90 AND 92) AND a!=91) + } +} {16 22 48 63 65 72 74 78 88 90 92 100 scan 0 sort 0} +do_test where7-2.910.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=10010 + OR f='pqrstuvwx' + } +} {15 28 29 30 41 67 93 scan 0 sort 0} +do_test where7-2.910.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=10010 + OR f='pqrstuvwx' + } +} {15 28 29 30 41 67 93 scan 0 sort 0} +do_test where7-2.911.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=86 + OR a=10 + OR b=528 + OR b=253 + OR a=80 + OR a=87 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + } +} {10 23 37 48 80 86 87 scan 0 sort 0} +do_test where7-2.911.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=86 + OR a=10 + OR b=528 + OR b=253 + OR a=80 + OR a=87 + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + } +} {10 23 37 48 80 86 87 scan 0 sort 0} +do_test where7-2.912.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) + OR b=825 + OR a=100 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR a=60 + } +} {42 60 75 77 100 scan 0 sort 0} +do_test where7-2.912.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) + OR b=825 + OR a=100 + OR (d>=77.0 AND d<78.0 AND d NOT NULL) + OR a=60 + } +} {42 60 75 77 100 scan 0 sort 0} +do_test where7-2.913.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=883 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR a=81 + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR f='mnopqrstu' + } +} {3 4 12 30 35 38 45 56 64 78 81 82 90 94 scan 0 sort 0} +do_test where7-2.913.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) + OR b=883 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR (d>=3.0 AND d<4.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR a=81 + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR f='mnopqrstu' + } +} {3 4 12 30 35 38 45 56 64 78 81 82 90 94 scan 0 sort 0} +do_test where7-2.914.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=443 + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR b=663 + OR b=905 + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=883 + OR c=22022 + OR b=638 + } +} {14 16 58 64 65 66 96 scan 0 sort 0} +do_test where7-2.914.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=443 + OR ((a BETWEEN 14 AND 16) AND a!=15) + OR b=663 + OR b=905 + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR b=883 + OR c=22022 + OR b=638 + } +} {14 16 58 64 65 66 96 scan 0 sort 0} +do_test where7-2.915.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR b=234 + OR a=53 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR b=319 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 20 22 27 29 40 53 84 86 scan 0 sort 0} +do_test where7-2.915.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 84 AND 86) AND a!=85) + OR b=234 + OR a=53 + OR ((a BETWEEN 20 AND 22) AND a!=21) + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR b=319 + OR (g='qponmlk' AND f GLOB 'opqrs*') + OR ((a BETWEEN 14 AND 16) AND a!=15) + } +} {14 16 20 22 27 29 40 53 84 86 scan 0 sort 0} +do_test where7-2.916.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=179 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR a=46 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR a=25 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR f='opqrstuvw' + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=938 + } +} {5 13 14 25 40 46 53 55 66 72 92 95 97 scan 0 sort 0} +do_test where7-2.916.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=179 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR a=46 + OR (g='kjihgfe' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 53 AND 55) AND a!=54) + OR a=25 + OR (d>=5.0 AND d<6.0 AND d NOT NULL) + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR f='opqrstuvw' + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=938 + } +} {5 13 14 25 40 46 53 55 66 72 92 95 97 scan 0 sort 0} +do_test where7-2.917.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + } +} {15 57 scan 0 sort 0} +do_test where7-2.917.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + } +} {15 57 scan 0 sort 0} +do_test where7-2.918.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=748 + OR (g='utsrqpo' AND f GLOB 'wxyza*') + OR a=32 + OR b=110 + OR b=297 + OR (d>=13.0 AND d<14.0 AND d NOT NULL) + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR f='ghijklmno' + OR b=473 + OR b=135 + } +} {6 10 13 22 27 32 43 58 60 62 68 84 scan 0 sort 0} +do_test where7-2.918.2 { + count_steps_sort { 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 a=32 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 + OR b=135 } -} {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} +} {6 10 13 22 27 32 43 58 60 62 68 84 scan 0 sort 0} do_test where7-2.919.1 { - count_steps { + count_steps_sort { 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 + WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=905 + OR a=97 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR c=27027 + OR f='bcdefghij' + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') } -} {21 60 62 63 97 99 scan 0 sort 0} +} {1 4 25 27 30 33 38 40 53 54 56 79 80 81 82 85 97 scan 0 sort 0} do_test where7-2.919.2 { - count_steps { + count_steps_sort { 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 + WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) + OR b=905 + OR a=97 + OR (g='hgfedcb' AND f GLOB 'hijkl*') + OR c=27027 + OR f='bcdefghij' + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR (d>=25.0 AND d<26.0 AND d NOT NULL) + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') } -} {21 60 62 63 97 99 scan 0 sort 0} +} {1 4 25 27 30 33 38 40 53 54 56 79 80 81 82 85 97 scan 0 sort 0} do_test where7-2.920.1 { - count_steps { + count_steps_sort { SELECT a FROM t2 - WHERE a=16 - OR b=685 - ORDER BY a + WHERE ((a BETWEEN 64 AND 66) AND a!=65) + OR ((a BETWEEN 90 AND 92) AND a!=91) } -} {16 scan 0 sort 0} +} {64 66 90 92 scan 0 sort 0} do_test where7-2.920.2 { - count_steps { + count_steps_sort { SELECT a FROM t3 - WHERE a=16 - OR b=685 - ORDER BY a + WHERE ((a BETWEEN 64 AND 66) AND a!=65) + OR ((a BETWEEN 90 AND 92) AND a!=91) } -} {16 scan 0 sort 0} +} {64 66 90 92 scan 0 sort 0} do_test where7-2.921.1 { - count_steps { + count_steps_sort { 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 + WHERE b=594 + OR b=80 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=421 + OR b=418 + OR b=828 + OR a=88 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=60.0 AND d<61.0 AND d NOT NULL) } -} {2 28 54 58 59 60 80 98 scan 0 sort 0} +} {23 27 38 54 60 88 scan 0 sort 0} do_test where7-2.921.2 { - count_steps { + count_steps_sort { 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 + WHERE b=594 + OR b=80 + OR (g='tsrqpon' AND f GLOB 'bcdef*') + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=421 + OR b=418 + OR b=828 + OR a=88 + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR (d>=60.0 AND d<61.0 AND d NOT NULL) } -} {2 28 54 58 59 60 80 98 scan 0 sort 0} +} {23 27 38 54 60 88 scan 0 sort 0} do_test where7-2.922.1 { - count_steps { + count_steps_sort { SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'hijkl*') - OR b=561 - ORDER BY a + WHERE (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR b=366 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR c=16016 + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR c=9009 } -} {51 85 scan 0 sort 0} +} {17 25 26 27 28 46 47 48 75 100 scan 0 sort 0} do_test where7-2.922.2 { - count_steps { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'xyzab*') + OR b=366 + OR (d>=28.0 AND d<29.0 AND d NOT NULL) + OR c=16016 + OR (g='edcbazy' AND f GLOB 'wxyza*') + OR c=9009 + } +} {17 25 26 27 28 46 47 48 75 100 scan 0 sort 0} +do_test where7-2.923.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=33 + OR f='qrstuvwxy' + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR b=858 + } +} {3 16 20 42 68 78 94 scan 0 sort 0} +do_test where7-2.923.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=33 + OR f='qrstuvwxy' + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR b=858 + } +} {3 16 20 42 68 78 94 scan 0 sort 0} +do_test where7-2.924.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=861 + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR b=682 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=286 + } +} {22 26 29 48 62 74 93 95 100 scan 0 sort 0} +do_test where7-2.924.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=861 + OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') + OR (d>=29.0 AND d<30.0 AND d NOT NULL) + OR b=682 + OR ((a BETWEEN 93 AND 95) AND a!=94) + OR b=286 + } +} {22 26 29 48 62 74 93 95 100 scan 0 sort 0} +do_test where7-2.925.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=740 + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR a=88 + } +} {27 29 88 scan 0 sort 0} +do_test where7-2.925.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=740 + OR ((a BETWEEN 27 AND 29) AND a!=28) + OR a=88 + } +} {27 29 88 scan 0 sort 0} +do_test where7-2.926.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='abcdefghi' + OR c=9009 + OR b=663 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR b=91 + } +} {10 25 26 27 52 78 scan 0 sort 0} +do_test where7-2.926.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='abcdefghi' + OR c=9009 + OR b=663 + OR (g='wvutsrq' AND f GLOB 'klmno*') + OR b=91 + } +} {10 25 26 27 52 78 scan 0 sort 0} +do_test where7-2.927.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='kjihgfe' AND f GLOB 'qrstu*') + OR ((a BETWEEN 29 AND 31) AND a!=30) + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=1015 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR b=916 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=69 + OR (g='hgfedcb' AND f GLOB 'fghij*') + } +} {13 29 31 39 42 65 68 83 91 scan 0 sort 0} +do_test where7-2.927.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='kjihgfe' AND f GLOB 'qrstu*') + OR ((a BETWEEN 29 AND 31) AND a!=30) + OR (f GLOB '?opqr*' AND f GLOB 'nopq*') + OR b=1015 + OR (g='qponmlk' AND f GLOB 'qrstu*') + OR b=916 + OR (d>=31.0 AND d<32.0 AND d NOT NULL) + OR b=69 + OR (g='hgfedcb' AND f GLOB 'fghij*') + } +} {13 29 31 39 42 65 68 83 91 scan 0 sort 0} +do_test where7-2.928.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=88 + OR a=1 + OR f='uvwxyzabc' + OR b=498 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR a=63 + OR f='mnopqrstu' + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR b=495 + OR a=35 + OR a=22 + } +} {1 12 20 22 35 38 45 46 60 63 64 72 88 90 98 scan 0 sort 0} +do_test where7-2.928.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=88 + OR a=1 + OR f='uvwxyzabc' + OR b=498 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR a=63 + OR f='mnopqrstu' + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR b=495 + OR a=35 + OR a=22 + } +} {1 12 20 22 35 38 45 46 60 63 64 72 88 90 98 scan 0 sort 0} +do_test where7-2.929.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=869 + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=289 + OR a=62 + OR ((a BETWEEN 9 AND 11) AND a!=10) + } +} {9 11 35 62 79 scan 0 sort 0} +do_test where7-2.929.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=869 + OR (g='rqponml' AND f GLOB 'jklmn*') + OR b=289 + OR a=62 + OR ((a BETWEEN 9 AND 11) AND a!=10) + } +} {9 11 35 62 79 scan 0 sort 0} +do_test where7-2.930.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 22 AND 24) AND a!=23) + OR b=542 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR a=7 + OR f='klmnopqrs' + } +} {7 10 19 21 22 24 36 62 88 scan 0 sort 0} +do_test where7-2.930.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 22 AND 24) AND a!=23) + OR b=542 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR a=7 + OR f='klmnopqrs' + } +} {7 10 19 21 22 24 36 62 88 scan 0 sort 0} +do_test where7-2.931.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 57 AND 59) AND a!=58) + OR b=1078 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR b=429 + } +} {20 21 23 39 57 59 60 98 scan 0 sort 0} +do_test where7-2.931.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 57 AND 59) AND a!=58) + OR b=1078 + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (g='mlkjihg' AND f GLOB 'ijklm*') + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR b=429 + } +} {20 21 23 39 57 59 60 98 scan 0 sort 0} +do_test where7-2.932.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=82.0 AND d<83.0 AND d NOT NULL) + OR b=264 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=1048 + OR a=15 + } +} {15 24 82 85 87 scan 0 sort 0} +do_test where7-2.932.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=82.0 AND d<83.0 AND d NOT NULL) + OR b=264 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR b=1048 + OR a=15 + } +} {15 24 82 85 87 scan 0 sort 0} +do_test where7-2.933.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=93 + OR f='ijklmnopq' + OR f='mnopqrstu' + OR ((a BETWEEN 67 AND 69) AND a!=68) + } +} {8 12 34 38 60 64 67 69 86 90 93 scan 0 sort 0} +do_test where7-2.933.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=93 + OR f='ijklmnopq' + OR f='mnopqrstu' + OR ((a BETWEEN 67 AND 69) AND a!=68) + } +} {8 12 34 38 60 64 67 69 86 90 93 scan 0 sort 0} +do_test where7-2.934.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) + OR b=858 + OR a=58 + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR c=21021 + OR ((a BETWEEN 45 AND 47) AND a!=46) + OR b=616 + OR b=784 + OR b=55 + } +} {5 45 47 49 56 58 61 62 63 78 scan 0 sort 0} +do_test where7-2.934.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) + OR b=858 + OR a=58 + OR (g='onmlkji' AND f GLOB 'xyzab*') + OR c=21021 + OR ((a BETWEEN 45 AND 47) AND a!=46) + OR b=616 + OR b=784 + OR b=55 + } +} {5 45 47 49 56 58 61 62 63 78 scan 0 sort 0} +do_test where7-2.935.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=682 + OR b=99 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR b=531 + } +} {2 9 28 54 62 80 scan 0 sort 0} +do_test where7-2.935.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=682 + OR b=99 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR b=531 + } +} {2 9 28 54 62 80 scan 0 sort 0} +do_test where7-2.936.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 56 AND 58) AND a!=57) + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR b=726 + OR a=79 + OR a=47 + OR b=212 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR c=8008 + } +} {8 22 23 24 26 34 47 52 56 58 60 66 70 78 79 86 scan 0 sort 0} +do_test where7-2.936.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 56 AND 58) AND a!=57) + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') + OR b=726 + OR a=79 + OR a=47 + OR b=212 + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + OR c=8008 + } +} {8 22 23 24 26 34 47 52 56 58 60 66 70 78 79 86 scan 0 sort 0} +do_test where7-2.937.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='uvwxyzabc' + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR a=5 + OR b=33 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR a=59 + OR b=44 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + } +} {3 4 5 14 20 23 46 49 59 60 62 72 75 98 scan 0 sort 0} +do_test where7-2.937.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='uvwxyzabc' + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR a=5 + OR b=33 + OR (f GLOB '?yzab*' AND f GLOB 'xyza*') + OR a=59 + OR b=44 + OR (d>=14.0 AND d<15.0 AND d NOT NULL) + OR (d>=59.0 AND d<60.0 AND d NOT NULL) + } +} {3 4 5 14 20 23 46 49 59 60 62 72 75 98 scan 0 sort 0} +do_test where7-2.938.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=564 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR b=451 + OR b=330 + OR a=47 + OR ((a BETWEEN 17 AND 19) AND a!=18) + } +} {17 19 30 41 47 93 scan 0 sort 0} +do_test where7-2.938.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=564 + OR (d>=93.0 AND d<94.0 AND d NOT NULL) + OR b=451 + OR b=330 + OR a=47 + OR ((a BETWEEN 17 AND 19) AND a!=18) + } +} {17 19 30 41 47 93 scan 0 sort 0} +do_test where7-2.939.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=40 + OR b=333 + } +} {40 scan 0 sort 0} +do_test where7-2.939.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=40 + OR b=333 + } +} {40 scan 0 sort 0} +do_test where7-2.940.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=924 + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR a=100 + OR c=15015 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + } +} {2 6 8 36 40 43 44 45 82 84 100 scan 0 sort 0} +do_test where7-2.940.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=924 + OR ((a BETWEEN 6 AND 8) AND a!=7) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (d>=40.0 AND d<41.0 AND d NOT NULL) + OR a=100 + OR c=15015 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + OR (d>=2.0 AND d<3.0 AND d NOT NULL) + } +} {2 6 8 36 40 43 44 45 82 84 100 scan 0 sort 0} +do_test where7-2.941.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + } +} {36 44 63 scan 0 sort 0} +do_test where7-2.941.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + } +} {36 44 63 scan 0 sort 0} +do_test where7-2.942.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=58 + OR ((a BETWEEN 7 AND 9) AND a!=8) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=31 + OR f='tuvwxyzab' + OR b=341 + OR b=47 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR a=49 + OR b=223 + OR f='qrstuvwxy' + } +} {7 9 16 19 31 42 45 49 63 65 68 71 94 95 97 scan 0 sort 0} +do_test where7-2.942.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=58 + OR ((a BETWEEN 7 AND 9) AND a!=8) + OR ((a BETWEEN 63 AND 65) AND a!=64) + OR a=31 + OR f='tuvwxyzab' + OR b=341 + OR b=47 + OR ((a BETWEEN 95 AND 97) AND a!=96) + OR a=49 + OR b=223 + OR f='qrstuvwxy' + } +} {7 9 16 19 31 42 45 49 63 65 68 71 94 95 97 scan 0 sort 0} +do_test where7-2.943.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=96 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR a=85 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR c=11011 + OR b=641 + OR f='vwxyzabcd' + OR b=286 + } +} {4 10 12 21 23 26 30 31 32 33 37 39 47 56 73 82 85 96 99 scan 0 sort 0} +do_test where7-2.943.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=96 + OR (d>=23.0 AND d<24.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'vwxyz*') + OR (f GLOB '?fghi*' AND f GLOB 'efgh*') + OR ((a BETWEEN 37 AND 39) AND a!=38) + OR a=85 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR c=11011 + OR b=641 + OR f='vwxyzabcd' + OR b=286 + } +} {4 10 12 21 23 26 30 31 32 33 37 39 47 56 73 82 85 96 99 scan 0 sort 0} +do_test where7-2.944.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 3 AND 5) AND a!=4) + OR b=1012 + OR a=7 + OR b=773 + OR a=1 + OR b=726 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR b=110 + } +} {1 3 5 7 10 66 87 89 92 99 scan 0 sort 0} +do_test where7-2.944.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 3 AND 5) AND a!=4) + OR b=1012 + OR a=7 + OR b=773 + OR a=1 + OR b=726 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR ((a BETWEEN 87 AND 89) AND a!=88) + OR b=110 + } +} {1 3 5 7 10 66 87 89 92 99 scan 0 sort 0} +do_test where7-2.945.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'hijkl*') + OR a=60 + OR a=4 + OR b=520 + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR a=44 + OR a=36 + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=715 + OR (g='vutsrqp' AND f GLOB 'qrstu*') + } +} {4 7 16 36 44 60 65 76 79 scan 0 sort 0} +do_test where7-2.945.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'hijkl*') + OR a=60 + OR a=4 + OR b=520 + OR (g='ihgfedc' AND f GLOB 'bcdef*') + OR a=44 + OR a=36 + OR (d>=76.0 AND d<77.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=715 + OR (g='vutsrqp' AND f GLOB 'qrstu*') + } +} {4 7 16 36 44 60 65 76 79 scan 0 sort 0} +do_test where7-2.946.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 3 AND 5) AND a!=4) + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR a=24 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + } +} {3 5 15 24 26 52 55 56 58 76 78 99 scan 0 sort 0} +do_test where7-2.946.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 3 AND 5) AND a!=4) + OR ((a BETWEEN 56 AND 58) AND a!=57) + OR (d>=15.0 AND d<16.0 AND d NOT NULL) + OR (d>=55.0 AND d<56.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'yzabc*') + OR a=24 + OR (d>=99.0 AND d<100.0 AND d NOT NULL) + OR (f GLOB '?bcde*' AND f GLOB 'abcd*') + } +} {3 5 15 24 26 52 55 56 58 76 78 99 scan 0 sort 0} +do_test where7-2.947.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=132 + OR f='ghijklmno' + OR b=740 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=1059 + } +} {6 12 21 26 32 38 58 84 scan 0 sort 0} +do_test where7-2.947.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='utsrqpo' AND f GLOB 'vwxyz*') + OR b=132 + OR f='ghijklmno' + OR b=740 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=1059 + } +} {6 12 21 26 32 38 58 84 scan 0 sort 0} +do_test where7-2.948.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=28 + OR b=927 + OR b=520 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=638 + OR f='vwxyzabcd' + } +} {21 28 47 53 58 73 99 scan 0 sort 0} +do_test where7-2.948.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=28 + OR b=927 + OR b=520 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + OR b=638 + OR f='vwxyzabcd' + } +} {21 28 47 53 58 73 99 scan 0 sort 0} +do_test where7-2.949.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=1026 + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'lmnop*') + OR b=355 + OR b=641 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {1 11 53 54 scan 0 sort 0} +do_test where7-2.949.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=1026 + OR (d>=1.0 AND d<2.0 AND d NOT NULL) + OR (g='wvutsrq' AND f GLOB 'lmnop*') + OR b=355 + OR b=641 + OR (d>=53.0 AND d<54.0 AND d NOT NULL) + } +} {1 11 53 54 scan 0 sort 0} +do_test where7-2.950.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 46 AND 48) AND a!=47) + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR b=641 + OR a=3 + OR a=35 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR f='opqrstuvw' + OR a=41 + OR a=83 + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=751 + } +} {3 14 35 40 41 46 48 54 60 62 66 81 83 92 scan 0 sort 0} +do_test where7-2.950.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 46 AND 48) AND a!=47) + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR b=641 + OR a=3 + OR a=35 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR f='opqrstuvw' + OR a=41 + OR a=83 + OR (g='nmlkjih' AND f GLOB 'cdefg*') + OR b=751 + } +} {3 14 35 40 41 46 48 54 60 62 66 81 83 92 scan 0 sort 0} +do_test where7-2.951.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 3 AND 5) AND a!=4) + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR c=15015 + OR b=146 + OR b=1092 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + } +} {3 5 43 44 45 60 62 scan 0 sort 0} +do_test where7-2.951.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 3 AND 5) AND a!=4) + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR c=15015 + OR b=146 + OR b=1092 + OR (d>=60.0 AND d<61.0 AND d NOT NULL) + } +} {3 5 43 44 45 60 62 scan 0 sort 0} +do_test where7-2.952.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'qrstu*') + OR f='bcdefghij' + OR f='hijklmnop' + OR a=65 + OR f='ijklmnopq' + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR g IS NULL + OR a=26 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR a=9 + OR (d>=32.0 AND d<33.0 AND d NOT NULL) + } +} {1 7 8 9 26 27 32 33 34 38 40 42 53 59 60 65 79 85 86 scan 0 sort 0} +do_test where7-2.952.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'qrstu*') + OR f='bcdefghij' + OR f='hijklmnop' + OR a=65 + OR f='ijklmnopq' + OR (d>=79.0 AND d<80.0 AND d NOT NULL) + OR g IS NULL + OR a=26 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR a=9 + OR (d>=32.0 AND d<33.0 AND d NOT NULL) + } +} {1 7 8 9 26 27 32 33 34 38 40 42 53 59 60 65 79 85 86 scan 0 sort 0} +do_test where7-2.953.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='jihgfed' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR b=1100 + OR c=6006 + OR c=4004 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR c=33033 + } +} {10 11 12 16 17 18 24 26 41 70 73 79 81 97 98 99 100 scan 0 sort 0} +do_test where7-2.953.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='jihgfed' AND f GLOB 'vwxyz*') + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR ((a BETWEEN 79 AND 81) AND a!=80) + OR (g='kjihgfe' AND f GLOB 'stuvw*') + OR (g='qponmlk' AND f GLOB 'pqrst*') + OR b=1100 + OR c=6006 + OR c=4004 + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR c=33033 + } +} {10 11 12 16 17 18 24 26 41 70 73 79 81 97 98 99 100 scan 0 sort 0} +do_test where7-2.954.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=17 + OR ((a BETWEEN 95 AND 97) AND a!=96) + } +} {17 95 97 scan 0 sort 0} +do_test where7-2.954.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=17 + OR ((a BETWEEN 95 AND 97) AND a!=96) + } +} {17 95 97 scan 0 sort 0} +do_test where7-2.955.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=3003 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR a=93 + } +} {7 8 9 67 93 scan 0 sort 0} +do_test where7-2.955.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=3003 + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR a=93 + } +} {7 8 9 67 93 scan 0 sort 0} +do_test where7-2.956.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=737 + } +} {12 21 23 42 44 67 scan 0 sort 0} +do_test where7-2.956.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR ((a BETWEEN 21 AND 23) AND a!=22) + OR (d>=12.0 AND d<13.0 AND d NOT NULL) + OR b=737 + } +} {12 21 23 42 44 67 scan 0 sort 0} +do_test where7-2.957.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='rqponml' AND f GLOB 'klmno*') + OR ((a BETWEEN 5 AND 7) AND a!=6) + } +} {5 7 36 scan 0 sort 0} +do_test where7-2.957.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='rqponml' AND f GLOB 'klmno*') + OR ((a BETWEEN 5 AND 7) AND a!=6) + } +} {5 7 36 scan 0 sort 0} +do_test where7-2.958.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='hgfedcb' AND f GLOB 'hijkl*') + OR c=32032 + OR f='opqrstuvw' + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR ((a BETWEEN 49 AND 51) AND a!=50) + OR b=993 + } +} {14 40 49 51 66 68 85 92 94 95 96 scan 0 sort 0} +do_test where7-2.958.2 { + count_steps_sort { 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 c=32032 + OR f='opqrstuvw' + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR ((a BETWEEN 49 AND 51) AND a!=50) 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} +} {14 40 49 51 66 68 85 92 94 95 96 scan 0 sort 0} do_test where7-2.959.1 { - count_steps { + count_steps_sort { 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 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR b=245 + OR b=528 + OR b=366 + OR a=73 + OR a=49 + OR b=421 + OR a=58 } -} {12 14 19 21 23 25 45 62 71 97 98 scan 0 sort 0} +} {12 38 48 49 58 59 61 73 86 88 scan 0 sort 0} do_test where7-2.959.2 { - count_steps { + count_steps_sort { 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 + WHERE (d>=12.0 AND d<13.0 AND d NOT NULL) + OR ((a BETWEEN 59 AND 61) AND a!=60) + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR b=245 + OR b=528 + OR b=366 + OR a=73 + OR a=49 + OR b=421 + OR a=58 } -} {12 14 19 21 23 25 45 62 71 97 98 scan 0 sort 0} +} {12 38 48 49 58 59 61 73 86 88 scan 0 sort 0} do_test where7-2.960.1 { - count_steps { + count_steps_sort { 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 + WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR b=146 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=704 } -} {4 5 7 18 19 20 21 31 32 33 46 57 59 66 68 83 85 88 91 94 scan 0 sort 0} +} {8 10 20 43 60 62 64 73 75 82 86 88 100 scan 0 sort 0} do_test where7-2.960.2 { - count_steps { + count_steps_sort { 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 + WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR ((a BETWEEN 86 AND 88) AND a!=87) + OR b=146 + OR (g='ponmlkj' AND f GLOB 'rstuv*') + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR ((a BETWEEN 60 AND 62) AND a!=61) + OR (g='ihgfedc' AND f GLOB 'efghi*') + OR b=704 } -} {4 5 7 18 19 20 21 31 32 33 46 57 59 66 68 83 85 88 91 94 scan 0 sort 0} +} {8 10 20 43 60 62 64 73 75 82 86 88 100 scan 0 sort 0} do_test where7-2.961.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 65 AND 67) AND a!=66) + OR b=14 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR a=49 + OR b=333 } -} {4 9 14 15 17 30 41 42 46 52 56 82 scan 0 sort 0} +} {3 5 49 65 67 scan 0 sort 0} do_test where7-2.961.2 { - count_steps { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 65 AND 67) AND a!=66) + OR b=14 + OR ((a BETWEEN 3 AND 5) AND a!=4) + OR a=49 + OR b=333 + } +} {3 5 49 65 67 scan 0 sort 0} +do_test where7-2.962.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=17017 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=971 + OR a=37 + OR a=7 + OR b=641 + OR a=13 + OR b=597 + } +} {7 13 37 38 49 50 51 scan 0 sort 0} +do_test where7-2.962.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=17017 + OR (g='qponmlk' AND f GLOB 'mnopq*') + OR b=971 + OR a=37 + OR a=7 + OR b=641 + OR a=13 + OR b=597 + } +} {7 13 37 38 49 50 51 scan 0 sort 0} +do_test where7-2.963.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='tuvwxyzab' + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + } +} {17 19 43 45 69 71 95 97 scan 0 sort 0} +do_test where7-2.963.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='tuvwxyzab' + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + } +} {17 19 43 45 69 71 95 97 scan 0 sort 0} +do_test where7-2.964.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=638 + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR b=165 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR f='stuvwxyza' + OR b=652 + OR b=66 + OR b=770 + OR b=91 + } +} {6 10 12 15 18 44 58 70 89 96 scan 0 sort 0} +do_test where7-2.964.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=638 + OR (d>=44.0 AND d<45.0 AND d NOT NULL) + OR (g='gfedcba' AND f GLOB 'lmnop*') + OR b=165 + OR ((a BETWEEN 10 AND 12) AND a!=11) + OR f='stuvwxyza' + OR b=652 + OR b=66 + OR b=770 + OR b=91 + } +} {6 10 12 15 18 44 58 70 89 96 scan 0 sort 0} +do_test where7-2.965.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=52.0 AND d<53.0 AND d NOT NULL) + OR f='opqrstuvw' + OR a=83 + OR a=93 + OR b=858 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'vwxyz*') + } +} {14 18 40 52 66 73 78 83 92 93 scan 0 sort 0} +do_test where7-2.965.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=52.0 AND d<53.0 AND d NOT NULL) + OR f='opqrstuvw' + OR a=83 + OR a=93 + OR b=858 + OR (d>=18.0 AND d<19.0 AND d NOT NULL) + OR (g='jihgfed' AND f GLOB 'vwxyz*') + } +} {14 18 40 52 66 73 78 83 92 93 scan 0 sort 0} +do_test where7-2.966.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE c=3003 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR a=38 + } +} {7 8 9 38 40 42 scan 0 sort 0} +do_test where7-2.966.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE c=3003 + OR ((a BETWEEN 40 AND 42) AND a!=41) + OR a=38 + } +} {7 8 9 38 40 42 scan 0 sort 0} +do_test where7-2.967.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR ((a BETWEEN 50 AND 52) AND a!=51) + } +} {50 52 60 scan 0 sort 0} +do_test where7-2.967.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) + OR ((a BETWEEN 50 AND 52) AND a!=51) + } +} {50 52 60 scan 0 sort 0} +do_test where7-2.968.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='qponmlk' AND f GLOB 'mnopq*') + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR a=5 + OR b=396 + OR a=13 + } +} {5 13 24 26 36 38 scan 0 sort 0} +do_test where7-2.968.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='qponmlk' AND f GLOB 'mnopq*') + OR ((a BETWEEN 24 AND 26) AND a!=25) + OR a=5 + OR b=396 + OR a=13 + } +} {5 13 24 26 36 38 scan 0 sort 0} +do_test where7-2.969.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=748 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR b=531 + OR b=1092 + OR b=418 + } +} {38 68 69 71 95 97 scan 0 sort 0} +do_test where7-2.969.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR b=748 + OR (d>=97.0 AND d<98.0 AND d NOT NULL) + OR ((a BETWEEN 69 AND 71) AND a!=70) + OR b=531 + OR b=1092 + OR b=418 + } +} {38 68 69 71 95 97 scan 0 sort 0} +do_test where7-2.970.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR a=50 + OR a=46 + OR ((a BETWEEN 38 AND 40) AND a!=39) + } +} {8 10 14 30 38 40 46 50 66 92 scan 0 sort 0} +do_test where7-2.970.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) + OR ((a BETWEEN 8 AND 10) AND a!=9) + OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') + OR a=50 + OR a=46 + OR ((a BETWEEN 38 AND 40) AND a!=39) + } +} {8 10 14 30 38 40 46 50 66 92 scan 0 sort 0} +do_test where7-2.971.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=24 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR b=487 + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=132 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=795 + OR b=737 + } +} {12 13 15 22 24 54 67 96 scan 0 sort 0} +do_test where7-2.971.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=24 + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR b=487 + OR (d>=96.0 AND d<97.0 AND d NOT NULL) + OR ((a BETWEEN 13 AND 15) AND a!=14) + OR b=132 + OR (d>=54.0 AND d<55.0 AND d NOT NULL) + OR b=795 + OR b=737 + } +} {12 13 15 22 24 54 67 96 scan 0 sort 0} +do_test where7-2.972.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=34 + OR c=16016 + OR b=1078 + OR b=960 + OR (g='hgfedcb' AND f GLOB 'jklmn*') + } +} {34 46 47 48 87 88 98 scan 0 sort 0} +do_test where7-2.972.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=88.0 AND d<89.0 AND d NOT NULL) + OR a=34 + OR c=16016 + OR b=1078 + OR b=960 + OR (g='hgfedcb' AND f GLOB 'jklmn*') + } +} {34 46 47 48 87 88 98 scan 0 sort 0} +do_test where7-2.973.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=1081 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR a=6 + } +} {6 19 21 38 45 73 75 scan 0 sort 0} +do_test where7-2.973.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=1081 + OR ((a BETWEEN 19 AND 21) AND a!=20) + OR (g='ponmlkj' AND f GLOB 'tuvwx*') + OR ((a BETWEEN 73 AND 75) AND a!=74) + OR (d>=38.0 AND d<39.0 AND d NOT NULL) + OR a=6 + } +} {6 19 21 38 45 73 75 scan 0 sort 0} +do_test where7-2.974.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR (g='rqponml' AND f GLOB 'lmnop*') + OR a=92 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR f='fghijklmn' + OR a=100 + OR b=209 + OR c=9009 + OR ((a BETWEEN 52 AND 54) AND a!=53) + OR a=73 + OR b=902 + } +} {5 9 19 25 26 27 31 35 37 52 54 57 61 73 82 83 87 92 95 100 scan 0 sort 0} +do_test where7-2.974.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='fedcbaz' AND f GLOB 'rstuv*') + OR (g='rqponml' AND f GLOB 'lmnop*') + OR a=92 + OR (f GLOB '?klmn*' AND f GLOB 'jklm*') + OR f='fghijklmn' + OR a=100 + OR b=209 + OR c=9009 + OR ((a BETWEEN 52 AND 54) AND a!=53) + OR a=73 + OR b=902 + } +} {5 9 19 25 26 27 31 35 37 52 54 57 61 73 82 83 87 92 95 100 scan 0 sort 0} +do_test where7-2.975.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=110 + OR f='ghijklmno' + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + } +} {6 10 21 32 40 58 84 scan 0 sort 0} +do_test where7-2.975.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) + OR b=110 + OR f='ghijklmno' + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + } +} {6 10 21 32 40 58 84 scan 0 sort 0} +do_test where7-2.976.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 51 AND 53) AND a!=52) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=91 + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=77 + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR (g='vutsrqp' AND f GLOB 'pqrst*') + } +} {1 7 15 20 27 45 46 51 53 79 scan 0 sort 0} +do_test where7-2.976.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 51 AND 53) AND a!=52) + OR (g='utsrqpo' AND f GLOB 'uvwxy*') + OR (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR b=91 + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR b=77 + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR (g='vutsrqp' AND f GLOB 'pqrst*') + } +} {1 7 15 20 27 45 46 51 53 79 scan 0 sort 0} +do_test where7-2.977.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=693 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR a=52 + OR b=377 + } +} {21 26 42 52 56 63 78 scan 0 sort 0} +do_test where7-2.977.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR b=693 + OR (d>=21.0 AND d<22.0 AND d NOT NULL) + OR (d>=26.0 AND d<27.0 AND d NOT NULL) + OR (d>=42.0 AND d<43.0 AND d NOT NULL) + OR a=52 + OR b=377 + } +} {21 26 42 52 56 63 78 scan 0 sort 0} +do_test where7-2.978.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE a=99 + OR a=36 + OR b=297 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=1004 + OR b=872 + OR a=95 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=176 + OR b=300 + } +} {16 27 36 66 68 95 99 scan 0 sort 0} +do_test where7-2.978.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE a=99 + OR a=36 + OR b=297 + OR ((a BETWEEN 66 AND 68) AND a!=67) + OR b=1004 + OR b=872 + OR a=95 + OR (d>=27.0 AND d<28.0 AND d NOT NULL) + OR b=176 + OR b=300 + } +} {16 27 36 66 68 95 99 scan 0 sort 0} +do_test where7-2.979.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=737 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR a=40 + OR f='uvwxyzabc' + OR b=311 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=927 + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + } +} {5 6 8 20 31 32 40 46 50 53 57 58 67 72 83 84 98 scan 0 sort 0} +do_test where7-2.979.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=737 + OR (g='wvutsrq' AND f GLOB 'ijklm*') + OR (f GLOB '?ghij*' AND f GLOB 'fghi*') + OR a=40 + OR f='uvwxyzabc' + OR b=311 + OR (g='nmlkjih' AND f GLOB 'bcdef*') + OR (f GLOB '?hijk*' AND f GLOB 'ghij*') + OR b=927 + OR (d>=50.0 AND d<51.0 AND d NOT NULL) + } +} {5 6 8 20 31 32 40 46 50 53 57 58 67 72 83 84 98 scan 0 sort 0} +do_test where7-2.980.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE f='fghijklmn' + OR b=1078 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR f='fghijklmn' + } +} {5 31 35 57 83 98 scan 0 sort 0} +do_test where7-2.980.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE f='fghijklmn' + OR b=1078 + OR (d>=35.0 AND d<36.0 AND d NOT NULL) + OR f='fghijklmn' + } +} {5 31 35 57 83 98 scan 0 sort 0} +do_test where7-2.981.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR b=487 + OR f='tuvwxyzab' + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR b=971 + OR c=19019 + OR a=39 + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR b=550 + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=660 + } +} {6 12 19 38 39 45 48 50 55 56 57 60 64 71 90 97 scan 0 sort 0} +do_test where7-2.981.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='xwvutsr' AND f GLOB 'ghijk*') + OR b=487 + OR f='tuvwxyzab' + OR (g='onmlkji' AND f GLOB 'wxyza*') + OR b=971 + OR c=19019 + OR a=39 + OR (f GLOB '?nopq*' AND f GLOB 'mnop*') + OR b=550 + OR (g='kjihgfe' AND f GLOB 'tuvwx*') + OR b=660 + } +} {6 12 19 38 39 45 48 50 55 56 57 60 64 71 90 97 scan 0 sort 0} +do_test where7-2.982.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=80 + OR b=839 + } +} { scan 0 sort 0} +do_test where7-2.982.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=80 + OR b=839 + } +} { scan 0 sort 0} +do_test where7-2.983.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=363 + OR b=630 + OR b=935 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR f='yzabcdefg' + OR ((a BETWEEN 37 AND 39) AND a!=38) + } +} {20 24 29 33 37 39 50 76 85 scan 0 sort 0} +do_test where7-2.983.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=363 + OR b=630 + OR b=935 + OR (d>=20.0 AND d<21.0 AND d NOT NULL) + OR (g='srqponm' AND f GLOB 'defgh*') + OR f='yzabcdefg' + OR ((a BETWEEN 37 AND 39) AND a!=38) + } +} {20 24 29 33 37 39 50 76 85 scan 0 sort 0} +do_test where7-2.984.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR a=40 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR f='abcdefghi' + OR b=696 + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=682 + OR a=32 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR b=671 + OR a=15 + } +} {15 16 26 32 34 36 40 52 61 62 78 86 97 scan 0 sort 0} +do_test where7-2.984.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=97.0 AND d<98.0 AND d NOT NULL) + OR a=40 + OR (d>=86.0 AND d<87.0 AND d NOT NULL) + OR f='abcdefghi' + OR b=696 + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=682 + OR a=32 + OR ((a BETWEEN 34 AND 36) AND a!=35) + OR b=671 + OR a=15 + } +} {15 16 26 32 34 36 40 52 61 62 78 86 97 scan 0 sort 0} +do_test where7-2.985.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (g='gfedcba' AND f GLOB 'lmnop*') + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR b=311 + } +} {7 33 59 85 89 scan 0 sort 0} +do_test where7-2.985.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (g='gfedcba' AND f GLOB 'lmnop*') + OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') + OR b=311 + } +} {7 33 59 85 89 scan 0 sort 0} +do_test where7-2.986.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=96.0 AND d<97.0 AND d NOT NULL) + OR a=73 + OR b=729 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR a=32 + } +} {32 67 73 81 96 scan 0 sort 0} +do_test where7-2.986.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=96.0 AND d<97.0 AND d NOT NULL) + OR a=73 + OR b=729 + OR (d>=81.0 AND d<82.0 AND d NOT NULL) + OR (d>=67.0 AND d<68.0 AND d NOT NULL) + OR a=32 + } +} {32 67 73 81 96 scan 0 sort 0} +do_test where7-2.987.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE ((a BETWEEN 98 AND 100) AND a!=99) + OR b=110 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR b=484 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + } +} {10 23 38 40 44 82 98 100 scan 0 sort 0} +do_test where7-2.987.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE ((a BETWEEN 98 AND 100) AND a!=99) + OR b=110 + OR ((a BETWEEN 38 AND 40) AND a!=39) + OR (g='tsrqpon' AND f GLOB 'xyzab*') + OR b=484 + OR (d>=82.0 AND d<83.0 AND d NOT NULL) + } +} {10 23 38 40 44 82 98 100 scan 0 sort 0} +do_test where7-2.988.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=99.0 AND d<100.0 AND d NOT NULL) + OR b=135 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=209 + OR b=363 + OR c=27027 + OR b=1026 + OR c=6006 + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + } +} {16 17 18 19 33 46 66 73 79 80 81 99 scan 0 sort 0} +do_test where7-2.988.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=99.0 AND d<100.0 AND d NOT NULL) + OR b=135 + OR (d>=66.0 AND d<67.0 AND d NOT NULL) + OR b=209 + OR b=363 + OR c=27027 + OR b=1026 + OR c=6006 + OR (g='ponmlkj' AND f GLOB 'uvwxy*') + OR (d>=73.0 AND d<74.0 AND d NOT NULL) + } +} {16 17 18 19 33 46 66 73 79 80 81 99 scan 0 sort 0} +do_test where7-2.989.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR a=97 + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR b=674 + OR c=14014 + OR b=69 + } +} {18 20 22 24 39 40 41 42 45 58 79 97 scan 0 sort 0} +do_test where7-2.989.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) + OR ((a BETWEEN 18 AND 20) AND a!=19) + OR (g='qponmlk' AND f GLOB 'nopqr*') + OR a=97 + OR (d>=45.0 AND d<46.0 AND d NOT NULL) + OR ((a BETWEEN 22 AND 24) AND a!=23) + OR (g='mlkjihg' AND f GLOB 'ghijk*') + OR b=674 + OR c=14014 + OR b=69 + } +} {18 20 22 24 39 40 41 42 45 58 79 97 scan 0 sort 0} +do_test where7-2.990.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=297 + OR a=83 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR ((a BETWEEN 16 AND 18) AND a!=17) + } +} {16 18 27 78 83 scan 0 sort 0} +do_test where7-2.990.2 { + count_steps_sort { + SELECT a FROM t3 + WHERE b=297 + OR a=83 + OR (d>=78.0 AND d<79.0 AND d NOT NULL) + OR ((a BETWEEN 16 AND 18) AND a!=17) + } +} {16 18 27 78 83 scan 0 sort 0} +do_test where7-2.991.1 { + count_steps_sort { + SELECT a FROM t2 + WHERE b=451 + OR ((a BETWEEN 11 AND 13) AND a!=12) + OR (g='tsrqpon' AND f GLOB 'abcde*') + OR b=539 + OR a=26 + OR (g='srqponm' AND f GLOB 'efghi*') + OR b=465 + OR (g='jihgfed' AND f GLOB 'wxyza*') + } +} {11 13 26 30 41 49 74 scan 0 sort 0} +do_test where7-2.991.2 { + count_steps_sort { 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 ((a BETWEEN 11 AND 13) AND a!=12) + OR (g='tsrqpon' AND f GLOB 'abcde*') 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 + OR a=26 + OR (g='srqponm' AND f GLOB 'efghi*') + OR b=465 + OR (g='jihgfed' AND f GLOB 'wxyza*') } -} {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} +} {11 13 26 30 41 49 74 scan 0 sort 0} do_test where7-2.992.1 { - count_steps { + count_steps_sort { 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 + WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) } -} {3 20 28 29 38 40 46 55 72 81 98 scan 0 sort 0} +} {45 63 scan 0 sort 0} do_test where7-2.992.2 { - count_steps { + count_steps_sort { 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 + WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) + OR (d>=63.0 AND d<64.0 AND d NOT NULL) } -} {3 20 28 29 38 40 46 55 72 81 98 scan 0 sort 0} +} {45 63 scan 0 sort 0} do_test where7-2.993.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 16 AND 18) AND a!=17) + OR b=872 + OR c=31031 } -} {44 96 98 scan 0 sort 0} +} {16 18 91 92 93 scan 0 sort 0} do_test where7-2.993.2 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 16 AND 18) AND a!=17) + OR b=872 + OR c=31031 } -} {44 96 98 scan 0 sort 0} +} {16 18 91 92 93 scan 0 sort 0} do_test where7-2.994.1 { - count_steps { + count_steps_sort { 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 + WHERE (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR a=13 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR b=322 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR b=377 + OR f='cdefghijk' + OR b=286 + OR ((a BETWEEN 61 AND 63) AND a!=62) } -} {9 67 69 93 95 scan 0 sort 0} +} {1 2 13 17 26 27 28 33 35 43 53 54 61 63 69 79 80 95 scan 0 sort 0} do_test where7-2.994.2 { - count_steps { + count_steps_sort { 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 + WHERE (f GLOB '?cdef*' AND f GLOB 'bcde*') + OR a=13 + OR (f GLOB '?stuv*' AND f GLOB 'rstu*') + OR b=322 + OR ((a BETWEEN 33 AND 35) AND a!=34) + OR b=377 + OR f='cdefghijk' + OR b=286 + OR ((a BETWEEN 61 AND 63) AND a!=62) } -} {9 67 69 93 95 scan 0 sort 0} +} {1 2 13 17 26 27 28 33 35 43 53 54 61 63 69 79 80 95 scan 0 sort 0} do_test where7-2.995.1 { - count_steps { + count_steps_sort { 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 + WHERE a=41 + OR b=990 + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR b=605 + OR (g='srqponm' AND f GLOB 'cdefg*') + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=968 + OR a=66 } -} {4 6 79 scan 0 sort 0} +} {16 28 36 41 55 66 88 90 scan 0 sort 0} do_test where7-2.995.2 { - count_steps { + count_steps_sort { 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 + WHERE a=41 + OR b=990 + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR b=605 + OR (g='srqponm' AND f GLOB 'cdefg*') + OR (d>=36.0 AND d<37.0 AND d NOT NULL) + OR (g='vutsrqp' AND f GLOB 'qrstu*') + OR b=968 + OR a=66 } -} {4 6 79 scan 0 sort 0} +} {16 28 36 41 55 66 88 90 scan 0 sort 0} do_test where7-2.996.1 { - count_steps { + count_steps_sort { 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 + WHERE b=1059 + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (g='onmlkji' AND f GLOB 'abcde*') + OR ((a BETWEEN 39 AND 41) AND a!=40) } -} {28 29 30 37 38 39 41 45 94 99 scan 0 sort 0} +} {17 19 32 37 39 41 52 57 scan 0 sort 0} do_test where7-2.996.2 { - count_steps { + count_steps_sort { 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 + WHERE b=1059 + OR (g='srqponm' AND f GLOB 'ghijk*') + OR (g='utsrqpo' AND f GLOB 'tuvwx*') + OR (g='nmlkjih' AND f GLOB 'fghij*') + OR (d>=17.0 AND d<18.0 AND d NOT NULL) + OR (d>=37.0 AND d<38.0 AND d NOT NULL) + OR (g='onmlkji' AND f GLOB 'abcde*') + OR ((a BETWEEN 39 AND 41) AND a!=40) } -} {28 29 30 37 38 39 41 45 94 99 scan 0 sort 0} +} {17 19 32 37 39 41 52 57 scan 0 sort 0} do_test where7-2.997.1 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 41 AND 43) AND a!=42) + OR f='nopqrstuv' + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR a=42 + OR b=729 + OR b=297 + OR a=77 + OR b=781 + OR ((a BETWEEN 36 AND 38) AND a!=37) } -} {1 23 33 54 56 68 71 90 scan 0 sort 0} +} {13 27 36 38 39 41 42 43 44 65 71 77 91 scan 0 sort 0} do_test where7-2.997.2 { - count_steps { + count_steps_sort { 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 + WHERE ((a BETWEEN 41 AND 43) AND a!=42) + OR f='nopqrstuv' + OR (g='ponmlkj' AND f GLOB 'stuvw*') + OR a=42 + OR b=729 + OR b=297 + OR a=77 + OR b=781 + OR ((a BETWEEN 36 AND 38) AND a!=37) } -} {1 23 33 54 56 68 71 90 scan 0 sort 0} +} {13 27 36 38 39 41 42 43 44 65 71 77 91 scan 0 sort 0} do_test where7-2.998.1 { - count_steps { + count_steps_sort { 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 + WHERE a=12 + OR f='qrstuvwxy' + OR a=47 + OR b=135 + OR a=25 } -} {5 7 21 29 39 41 47 72 73 79 81 82 99 scan 0 sort 0} +} {12 16 25 42 47 68 94 scan 0 sort 0} do_test where7-2.998.2 { - count_steps { + count_steps_sort { 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 + WHERE a=12 + OR f='qrstuvwxy' + OR a=47 + OR b=135 + OR a=25 } -} {5 7 21 29 39 41 47 72 73 79 81 82 99 scan 0 sort 0} +} {12 16 25 42 47 68 94 scan 0 sort 0} do_test where7-2.999.1 { - count_steps { + count_steps_sort { 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 + WHERE b=451 + OR b=660 + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR b=781 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=198 + OR b=1023 + OR a=98 + OR d<0.0 + OR ((a BETWEEN 79 AND 81) AND a!=80) } -} {10 20 22 50 scan 0 sort 0} +} {18 41 50 60 71 74 79 81 93 98 scan 0 sort 0} do_test where7-2.999.2 { - count_steps { + count_steps_sort { 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 + WHERE b=451 + OR b=660 + OR (g='onmlkji' AND f GLOB 'yzabc*') + OR b=781 + OR (g='jihgfed' AND f GLOB 'wxyza*') + OR b=198 + OR b=1023 + OR a=98 + OR d<0.0 + OR ((a BETWEEN 79 AND 81) AND a!=80) } -} {10 20 22 50 scan 0 sort 0} +} {18 41 50 60 71 74 79 81 93 98 scan 0 sort 0} do_test where7-2.1000.1 { - count_steps { + count_steps_sort { SELECT a FROM t2 - WHERE b=388 - OR ((a BETWEEN 4 AND 6) AND a!=5) - ORDER BY a + WHERE b=685 + OR a=86 + OR c=17017 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR a=80 + OR b=773 } -} {4 6 scan 0 sort 0} +} {49 50 51 80 85 86 87 90 scan 0 sort 0} do_test where7-2.1000.2 { - count_steps { + count_steps_sort { SELECT a FROM t3 - WHERE b=388 - OR ((a BETWEEN 4 AND 6) AND a!=5) - ORDER BY a + WHERE b=685 + OR a=86 + OR c=17017 + OR ((a BETWEEN 85 AND 87) AND a!=86) + OR (g='gfedcba' AND f GLOB 'mnopq*') + OR a=80 + OR b=773 } -} {4 6 scan 0 sort 0} +} {49 50 51 80 85 86 87 90 scan 0 sort 0} do_test where7-2.1001.1 { - count_steps { + count_steps_sort { 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 + WHERE b=1092 + OR a=23 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR d<0.0 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR a=91 } -} {6 7 15 39 54 66 89 90 94 scan 0 sort 0} +} {2 22 23 28 54 80 91 scan 0 sort 0} do_test where7-2.1001.2 { - count_steps { + count_steps_sort { 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 + WHERE b=1092 + OR a=23 + OR (f GLOB '?defg*' AND f GLOB 'cdef*') + OR d<0.0 + OR (d>=22.0 AND d<23.0 AND d NOT NULL) + OR a=91 } -} {6 7 15 39 54 66 89 90 94 scan 0 sort 0} +} {2 22 23 28 54 80 91 scan 0 sort 0} +finish_test + finish_test diff --git a/test/where8.test b/test/where8.test index 59136dd..b5bfa2b 100644 --- a/test/where8.test +++ b/test/where8.test @@ -12,7 +12,7 @@ # 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 $ +# $Id: where8.test,v 1.6 2009/04/21 09:02:47 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -63,19 +63,19 @@ do_test where8-1.2 { do_test where8-1.3 { execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b = 'two' } -} {II IX X 0 0 6} +} {IX X II 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} +} {IX X III II 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} +} {IX X V IV 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} +} {I III 0 1} do_test where8-1.7 { execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY a } @@ -88,13 +88,13 @@ do_test where8-1.8 { do_test where8-1.9 { execsql_status2 { SELECT c FROM t1 WHERE a >= 9 OR b <= 'eight' } -} {VIII IX X 0 0 6} +} {IX X VIII 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} +} {IX VIII 0 0 6} do_test where8-1.11 { execsql_status2 { @@ -120,7 +120,7 @@ do_test where8-1.13 { 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} +} {II III IV V VI 0 1 18} do_test where8-1.14 { execsql_status2 { SELECT c FROM t1 @@ -129,7 +129,7 @@ do_test where8-1.14 { 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} +} {II III IV V VI VII VIII IX X 0 1 33} do_test where8-1.15 { execsql_status2 { @@ -137,8 +137,7 @@ do_test where8-1.15 { a BETWEEN 2 AND 4 OR b = 'nine' ORDER BY rowid } -} {II III IV IX 0 0 10} - +} {II III IV IX 0 1 12} #-------------------------------------------------------------------------- @@ -242,7 +241,7 @@ do_test where8-3.8 { 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} +} {2 2 2 4 3 3 3 4 0 1} do_test where8-3.9 { # The "OR c = 'IX'" term forces a linear scan. @@ -252,13 +251,13 @@ do_test where8-3.9 { 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} +} {2 2 2 4 3 3 3 4 9 9 9 4 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} +} {1 3 5 10 2 0 0} do_test where8-3.11 { execsql_status { diff --git a/test/where8m.test b/test/where8m.test index f573579..bf44024 100644 --- a/test/where8m.test +++ b/test/where8m.test @@ -12,7 +12,7 @@ # 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 $ +# $Id: where8m.test,v 1.2 2009/04/21 09:02:47 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -37,5 +37,22 @@ do_malloc_test where8m-1 -sqlprep { a BETWEEN 1 AND 3 AND b < 5 AND b > 2 AND c = 4; } +do_malloc_test where8m-2 -tclprep { + db eval { + BEGIN; + CREATE TABLE t1(a, b, c); + CREATE INDEX i1 ON t1(a); + CREATE INDEX i2 ON t1(b); + } + for {set i 0} {$i < 1000} {incr i} { + set ii [expr $i*$i] + set iii [expr $i*$i] + db eval { INSERT INTO t1 VALUES($i, $ii, $iii) } + } + db eval COMMIT +} -sqlbody { + SELECT count(*) FROM t1 WHERE a BETWEEN 5 AND 995 OR b BETWEEN 5 AND 900000; +} + finish_test diff --git a/test/where9.test b/test/where9.test index 020fb63..18055e8 100644 --- a/test/where9.test +++ b/test/where9.test @@ -11,7 +11,7 @@ # 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.7 2009/02/24 10:01:52 danielk1977 Exp $ +# $Id: where9.test,v 1.8 2009/04/21 09:02:47 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -166,7 +166,7 @@ do_test where9-1.2.1 { OR d IS NULL ORDER BY a } -} {90 91 92 96 97 99 scan 0 sort 0} +} {90 91 92 96 97 99 scan 0 sort 1} do_test where9-1.2.2 { count_steps { SELECT a FROM t1 @@ -213,7 +213,7 @@ do_test where9-1.3.1 { OR (b NOT NULL AND c NOT NULL AND d IS NULL) ORDER BY a } -} {90 91 92 97 scan 0 sort 0} +} {90 91 92 97 scan 0 sort 1} do_test where9-1.3.2 { count_steps { SELECT a FROM t4 @@ -248,20 +248,26 @@ do_test where9-1.4 { 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} +} {87 88 89 90 91 scan 0 sort 1} do_test where9-1.5 { + # When this test was originally written, SQLite used a rowset object + # to optimize the "ORDER BY a" clause. Now that it is using a rowhash, + # this is not possible. So we have to comment out one term of the OR + # expression in order to prevent SQLite from deeming a full-table + # scan to be a better strategy than using multiple indexes, which would + # defeat the point of the test. 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 (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} +} {5 31 57 82 83 84 85 86 87 scan 0 sort 1} do_test where9-1.6 { count_steps { SELECT a FROM t1 @@ -323,7 +329,7 @@ do_test where9-2.5 { 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} +} {80 80 80 2 80 28 80 54 scan 0 sort 1} do_test where9-2.6 { count_steps { SELECT t1.a, coalesce(t2.a,9999) @@ -331,7 +337,7 @@ do_test where9-2.6 { 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} +} {80 9999 scan 0 sort 1} do_test where9-2.7 { count_steps { SELECT t3.x, t1.a, coalesce(t2.a,9999) @@ -347,7 +353,7 @@ do_test where9-2.8 { 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 + ORDER BY 1, 2, 3 } } {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} diff --git a/tool/genfkey.test b/tool/genfkey.test index 422de83..e1011d6 100644 --- a/tool/genfkey.test +++ b/tool/genfkey.test @@ -261,3 +261,34 @@ Error in table t6: foreign key is not unique Error in table t7: foreign key is not unique }]}" +# Test that ticket #3800 has been resolved. +# +do_test genfkey-5.1 { + execsql { + DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; + DROP TABLE t4; DROP TABLE t5; DROP TABLE t6; + DROP TABLE t7; DROP TABLE t8; + } +} {} +do_test genfkey-5.2 { + execsql { + CREATE TABLE "t.3" (c1 PRIMARY KEY); + CREATE TABLE t13 (c1, foreign key(c1) references "t.3"(c1)); + } +} {} +do_test genfkey-5.3 { + set rc [catch {exec ./sqlite3 test.db .genfkey} msg] +} {0} +do_test genfkey-5.4 { + db eval $msg +} {} +do_test genfkey-5.5 { + catchsql { INSERT INTO t13 VALUES(1) } +} {1 {constraint failed}} +do_test genfkey-5.5 { + catchsql { + INSERT INTO "t.3" VALUES(1); + INSERT INTO t13 VALUES(1); + } +} {0 {}} +