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 #3935 has been fixed.
15 # $Id: tkt3935.test,v 1.2 2009/07/01 16:12:08 danielk1977 Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
22 CREATE TABLE t1(a, b);
23 CREATE TABLE t2(c, d);
28 execsql { SELECT j1.b FROM ( SELECT * FROM t1 INNER JOIN t2 ON a=c ) AS j1 }
31 execsql { SELECT j1.b FROM (t1 INNER JOIN t2 ON a=c) AS j1 }
36 catchsql { SELECT a FROM (t1) AS t ON b USING(a) }
37 } {1 {a JOIN clause is required before ON}}
39 catchsql { SELECT a FROM (t1) AS t ON b }
40 } {1 {a JOIN clause is required before ON}}
42 catchsql { SELECT a FROM (SELECT * FROM t1) AS t ON b USING(a) }
43 } {1 {a JOIN clause is required before ON}}
45 catchsql { SELECT a FROM (SELECT * FROM t1) AS t ON b }
46 } {1 {a JOIN clause is required before ON}}
48 catchsql { SELECT a FROM t1 AS t ON b }
49 } {1 {a JOIN clause is required before ON}}
51 catchsql { SELECT a FROM t1 AS t ON b USING(a) }
52 } {1 {a JOIN clause is required before ON}}
54 catchsql { SELECT a FROM t1 AS t USING(a) }
55 } {1 {a JOIN clause is required before USING}}