sl@0: # 2008 August 12 sl@0: # sl@0: # The author disclaims copyright to this source code. In place of sl@0: # a legal notice, here is a blessing: sl@0: # sl@0: # May you do good and not evil. sl@0: # May you find forgiveness for yourself and forgive others. sl@0: # May you share freely, never taking more than you give. sl@0: # sl@0: #*********************************************************************** sl@0: # This file implements regression tests for SQLite library. sl@0: # Specifically, it tests the behavior of the sqlite3VdbeRecordCompare() sl@0: # routine in cases where the rowid is 0 or 1 in file format 4 sl@0: # (meaning that the rowid has type code 8 or 9 with zero bytes of sl@0: # data). Ticket #3292. sl@0: # sl@0: # $Id: tkt3292.test,v 1.1 2008/08/13 14:07:41 drh Exp $ sl@0: sl@0: set testdir [file dirname $argv0] sl@0: source $testdir/tester.tcl sl@0: sl@0: do_test tkt3292-1.1 { sl@0: execsql { sl@0: PRAGMA legacy_file_format=OFF; sl@0: CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT); sl@0: INSERT INTO t1 VALUES(0, 1); sl@0: INSERT INTO t1 VALUES(1, 1); sl@0: INSERT INTO t1 VALUES(2, 1); sl@0: CREATE INDEX i1 ON t1(b); sl@0: SELECT * FROM t1 WHERE b>=1; sl@0: } sl@0: } {0 1 1 1 2 1} sl@0: do_test tkt3292-1.2 { sl@0: execsql { sl@0: INSERT INTO t1 VALUES(3, 0); sl@0: INSERT INTO t1 VALUES(4, 2); sl@0: SELECT * FROM t1 WHERE b>=1; sl@0: } sl@0: } {0 1 1 1 2 1 4 2} sl@0: sl@0: sl@0: do_test tkt3292-2.1 { sl@0: execsql { sl@0: CREATE TABLE t2(a INTEGER PRIMARY KEY, b, c, d); sl@0: INSERT INTO t2 VALUES(0, 1, 'hello', x'012345'); sl@0: INSERT INTO t2 VALUES(1, 1, 'hello', x'012345'); sl@0: INSERT INTO t2 VALUES(2, 1, 'hello', x'012345'); sl@0: CREATE INDEX i2 ON t2(b,c,d); sl@0: SELECT a FROM t2 WHERE b=1 AND c='hello' AND d>=x'012345'; sl@0: } sl@0: } {0 1 2} sl@0: do_test tkt3292-2.2 { sl@0: execsql { sl@0: INSERT INTO t2 VALUES(3, 1, 'hello', x'012344'); sl@0: INSERT INTO t2 VALUES(4, 1, 'hello', x'012346'); sl@0: SELECT a FROM t2 WHERE b=1 AND c='hello' AND d>=x'012345'; sl@0: } sl@0: } {0 1 2 4} sl@0: sl@0: sl@0: finish_test