2009-07-01 18:56:39 +04:00
|
|
|
# 2009 July 1
|
|
|
|
#
|
|
|
|
# The author disclaims copyright to this source code. In place of
|
|
|
|
# a legal notice, here is a blessing:
|
|
|
|
#
|
|
|
|
# May you do good and not evil.
|
|
|
|
# May you find forgiveness for yourself and forgive others.
|
|
|
|
# May you share freely, never taking more than you give.
|
|
|
|
#
|
|
|
|
#***********************************************************************
|
|
|
|
# This file implements regression tests for SQLite library.
|
|
|
|
#
|
|
|
|
# This file implements tests to verify that ticket #3935 has been fixed.
|
|
|
|
#
|
2009-07-01 20:12:07 +04:00
|
|
|
# $Id: tkt3935.test,v 1.2 2009/07/01 16:12:08 danielk1977 Exp $
|
2009-07-01 18:56:39 +04:00
|
|
|
|
|
|
|
set testdir [file dirname $argv0]
|
|
|
|
source $testdir/tester.tcl
|
|
|
|
|
|
|
|
do_test tkt3935.1 {
|
|
|
|
execsql {
|
|
|
|
CREATE TABLE t1(a, b);
|
|
|
|
CREATE TABLE t2(c, d);
|
|
|
|
}
|
|
|
|
} {}
|
|
|
|
|
|
|
|
do_test tkt3935.2 {
|
|
|
|
execsql { SELECT j1.b FROM ( SELECT * FROM t1 INNER JOIN t2 ON a=c ) AS j1 }
|
|
|
|
} {}
|
|
|
|
do_test tkt3935.3 {
|
|
|
|
execsql { SELECT j1.b FROM (t1 INNER JOIN t2 ON a=c) AS j1 }
|
|
|
|
} {}
|
|
|
|
|
|
|
|
|
|
|
|
do_test tkt3935.4 {
|
2009-07-01 20:12:07 +04:00
|
|
|
catchsql { SELECT a FROM (t1) AS t ON b USING(a) }
|
2022-04-07 04:11:13 +03:00
|
|
|
} {1 {near "USING": syntax error}}
|
2009-07-01 18:56:39 +04:00
|
|
|
do_test tkt3935.5 {
|
2009-07-01 20:12:07 +04:00
|
|
|
catchsql { SELECT a FROM (t1) AS t ON b }
|
|
|
|
} {1 {a JOIN clause is required before ON}}
|
2009-07-01 18:56:39 +04:00
|
|
|
do_test tkt3935.6 {
|
2009-07-01 20:12:07 +04:00
|
|
|
catchsql { SELECT a FROM (SELECT * FROM t1) AS t ON b USING(a) }
|
2022-04-07 04:11:13 +03:00
|
|
|
} {1 {near "USING": syntax error}}
|
2009-07-01 18:56:39 +04:00
|
|
|
do_test tkt3935.7 {
|
2009-07-01 20:12:07 +04:00
|
|
|
catchsql { SELECT a FROM (SELECT * FROM t1) AS t ON b }
|
|
|
|
} {1 {a JOIN clause is required before ON}}
|
2009-07-01 18:56:39 +04:00
|
|
|
do_test tkt3935.8 {
|
2009-07-01 20:12:07 +04:00
|
|
|
catchsql { SELECT a FROM t1 AS t ON b }
|
|
|
|
} {1 {a JOIN clause is required before ON}}
|
2009-07-01 18:56:39 +04:00
|
|
|
do_test tkt3935.9 {
|
2009-07-01 20:12:07 +04:00
|
|
|
catchsql { SELECT a FROM t1 AS t ON b USING(a) }
|
2022-04-07 04:11:13 +03:00
|
|
|
} {1 {near "USING": syntax error}}
|
2009-07-01 20:12:07 +04:00
|
|
|
do_test tkt3935.10 {
|
|
|
|
catchsql { SELECT a FROM t1 AS t USING(a) }
|
|
|
|
} {1 {a JOIN clause is required before USING}}
|
2009-07-01 18:56:39 +04:00
|
|
|
|
|
|
|
finish_test
|