3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library.
13 # This file implements tests to verify that ticket #3442 has been
17 # $Id: tkt3442.test,v 1.2 2009/06/05 17:09:12 drh Exp $
20 set testdir [file dirname $argv0]
21 source $testdir/tester.tcl
24 # Create a schema with some indexes.
28 CREATE TABLE listhash(
29 key INTEGER PRIMARY KEY,
33 CREATE UNIQUE INDEX ididx ON listhash(id);
41 uplevel "execsql {EXPLAIN QUERY PLAN $sql}"
45 # These tests perform an EXPLAIN QUERY PLAN on both versions of the
46 # SELECT referenced in ticket #3442 (both '5000' and "5000")
47 # and verify that the query plan is the same.
51 EQP { SELECT node FROM listhash WHERE id='5000' LIMIT 1; }
52 } {0 0 0 {SEARCH TABLE listhash USING INDEX ididx (id=?) (~1 rows)}}
54 EQP { SELECT node FROM listhash WHERE id="5000" LIMIT 1; }
55 } {0 0 0 {SEARCH TABLE listhash USING INDEX ididx (id=?) (~1 rows)}}
59 # Some extra tests testing other permutations of 5000.
63 EQP { SELECT node FROM listhash WHERE id=5000 LIMIT 1; }
64 } {0 0 0 {SEARCH TABLE listhash USING INDEX ididx (id=?) (~1 rows)}}
68 SELECT node FROM listhash WHERE id=[5000] LIMIT 1;
70 } {1 {no such column: 5000}}