1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/tkt3292.test Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,61 @@
1.4 +# 2008 August 12
1.5 +#
1.6 +# The author disclaims copyright to this source code. In place of
1.7 +# a legal notice, here is a blessing:
1.8 +#
1.9 +# May you do good and not evil.
1.10 +# May you find forgiveness for yourself and forgive others.
1.11 +# May you share freely, never taking more than you give.
1.12 +#
1.13 +#***********************************************************************
1.14 +# This file implements regression tests for SQLite library.
1.15 +# Specifically, it tests the behavior of the sqlite3VdbeRecordCompare()
1.16 +# routine in cases where the rowid is 0 or 1 in file format 4
1.17 +# (meaning that the rowid has type code 8 or 9 with zero bytes of
1.18 +# data). Ticket #3292.
1.19 +#
1.20 +# $Id: tkt3292.test,v 1.1 2008/08/13 14:07:41 drh Exp $
1.21 +
1.22 +set testdir [file dirname $argv0]
1.23 +source $testdir/tester.tcl
1.24 +
1.25 +do_test tkt3292-1.1 {
1.26 + execsql {
1.27 + PRAGMA legacy_file_format=OFF;
1.28 + CREATE TABLE t1(a INTEGER PRIMARY KEY, b INT);
1.29 + INSERT INTO t1 VALUES(0, 1);
1.30 + INSERT INTO t1 VALUES(1, 1);
1.31 + INSERT INTO t1 VALUES(2, 1);
1.32 + CREATE INDEX i1 ON t1(b);
1.33 + SELECT * FROM t1 WHERE b>=1;
1.34 + }
1.35 +} {0 1 1 1 2 1}
1.36 +do_test tkt3292-1.2 {
1.37 + execsql {
1.38 + INSERT INTO t1 VALUES(3, 0);
1.39 + INSERT INTO t1 VALUES(4, 2);
1.40 + SELECT * FROM t1 WHERE b>=1;
1.41 + }
1.42 +} {0 1 1 1 2 1 4 2}
1.43 +
1.44 +
1.45 +do_test tkt3292-2.1 {
1.46 + execsql {
1.47 + CREATE TABLE t2(a INTEGER PRIMARY KEY, b, c, d);
1.48 + INSERT INTO t2 VALUES(0, 1, 'hello', x'012345');
1.49 + INSERT INTO t2 VALUES(1, 1, 'hello', x'012345');
1.50 + INSERT INTO t2 VALUES(2, 1, 'hello', x'012345');
1.51 + CREATE INDEX i2 ON t2(b,c,d);
1.52 + SELECT a FROM t2 WHERE b=1 AND c='hello' AND d>=x'012345';
1.53 + }
1.54 +} {0 1 2}
1.55 +do_test tkt3292-2.2 {
1.56 + execsql {
1.57 + INSERT INTO t2 VALUES(3, 1, 'hello', x'012344');
1.58 + INSERT INTO t2 VALUES(4, 1, 'hello', x'012346');
1.59 + SELECT a FROM t2 WHERE b=1 AND c='hello' AND d>=x'012345';
1.60 + }
1.61 +} {0 1 2 4}
1.62 +
1.63 +
1.64 +finish_test