PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/src/sqlite/test/tkt3879.test

#
Unknown | 52 lines | 45 code | 7 blank | 0 comment | 0 complexity | 5b1349dcd90ad7ffc5df9bcdbc120234 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. # 2009 May 25
  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. #
  12. # Tests to verify ticket #3879 is fixed.
  13. #
  14. # $Id: tkt3879.test,v 1.2 2009/06/05 17:09:12 drh Exp $
  15. set testdir [file dirname $argv0]
  16. source $testdir/tester.tcl
  17. do_test tkt3879.1.1 {
  18. execsql {
  19. CREATE TABLE t1 (a PRIMARY KEY, b);
  20. INSERT INTO t1 VALUES ('w', 1);
  21. INSERT INTO t1 VALUES ('z', -1);
  22. CREATE TABLE t2 (m INTEGER PRIMARY KEY, n, a, p);
  23. INSERT INTO t2 VALUES (25, 13, 'w', 1);
  24. INSERT INTO t2 VALUES (26, 25, 'z', 153);
  25. INSERT INTO t2 VALUES (27, 25, 'z', 68);
  26. CREATE TABLE t3 (m);
  27. INSERT INTO t3 VALUES (25);
  28. }
  29. } {}
  30. do_test tkt3879.1.2 {
  31. execsql {
  32. SELECT 111, t1.b*123
  33. FROM t3, t2 AS j0, t2 AS j1, t1
  34. WHERE j0.m=t3.m AND t1.a=j0.a AND j1.n=j0.m;
  35. }
  36. } {111 123 111 123}
  37. do_test tkt3879.1.3 {
  38. execsql {
  39. SELECT 222, t1.b*123
  40. FROM t3, t2 AS j0, t2 AS j1, t1
  41. WHERE j0.m=t3.m AND t1.a=j0.a AND j1.n=j0.m
  42. ORDER BY t1.b;
  43. }
  44. } {222 123 222 123}
  45. finish_test