tkt3935.test 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # 2009 July 1
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  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.
  9. #
  10. #***********************************************************************
  11. # This file implements regression tests for SQLite library.
  12. #
  13. # This file implements tests to verify that ticket #3935 has been fixed.
  14. #
  15. # $Id: tkt3935.test,v 1.2 2009/07/01 16:12:08 danielk1977 Exp $
  16. set testdir [file dirname $argv0]
  17. source $testdir/tester.tcl
  18. do_test tkt3935.1 {
  19. execsql {
  20. CREATE TABLE t1(a, b);
  21. CREATE TABLE t2(c, d);
  22. }
  23. } {}
  24. do_test tkt3935.2 {
  25. execsql { SELECT j1.b FROM ( SELECT * FROM t1 INNER JOIN t2 ON a=c ) AS j1 }
  26. } {}
  27. do_test tkt3935.3 {
  28. execsql { SELECT j1.b FROM (t1 INNER JOIN t2 ON a=c) AS j1 }
  29. } {}
  30. do_test tkt3935.4 {
  31. catchsql { SELECT a FROM (t1) AS t ON b USING(a) }
  32. } {1 {a JOIN clause is required before ON}}
  33. do_test tkt3935.5 {
  34. catchsql { SELECT a FROM (t1) AS t ON b }
  35. } {1 {a JOIN clause is required before ON}}
  36. do_test tkt3935.6 {
  37. catchsql { SELECT a FROM (SELECT * FROM t1) AS t ON b USING(a) }
  38. } {1 {a JOIN clause is required before ON}}
  39. do_test tkt3935.7 {
  40. catchsql { SELECT a FROM (SELECT * FROM t1) AS t ON b }
  41. } {1 {a JOIN clause is required before ON}}
  42. do_test tkt3935.8 {
  43. catchsql { SELECT a FROM t1 AS t ON b }
  44. } {1 {a JOIN clause is required before ON}}
  45. do_test tkt3935.9 {
  46. catchsql { SELECT a FROM t1 AS t ON b USING(a) }
  47. } {1 {a JOIN clause is required before ON}}
  48. do_test tkt3935.10 {
  49. catchsql { SELECT a FROM t1 AS t USING(a) }
  50. } {1 {a JOIN clause is required before USING}}
  51. finish_test