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 #3461 has been
16 # $Id: tkt3461.test,v 1.4 2009/06/05 17:09:12 drh Exp $
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
21 ####################################
22 ####################################
23 # REMOVE THESE TWO LINES:
24 ####################################
25 ####################################
31 CREATE TABLE t1(a, b);
32 INSERT INTO t1 VALUES(1, 2);
37 execsql { SELECT a, b+1 AS b_plus_one FROM t1 WHERE a=1 }
41 # explain { SELECT a, b+1 AS b_plus_one FROM t1 WHERE a=1 OR b_plus_one }
42 # execsql { PRAGMA vdbe_trace = 1; PRAGMA vdbe_listing=1 }
43 execsql { SELECT a, b+1 AS b_plus_one FROM t1 WHERE a=1 OR b_plus_one }
48 SELECT a, b+1 AS b_plus_one
50 WHERE CASE WHEN a=1 THEN 1 ELSE b_plus_one END
56 CREATE TABLE t2(c, d);
57 INSERT INTO t2 VALUES(3, 4);
59 # execsql { PRAGMA vdbe_trace = 1; PRAGMA vdbe_listing=1 }
61 SELECT a, b+1 AS b_plus_one, c, d
63 ON (a=c AND d=b_plus_one)