tkt3419.test 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # 2008 October 06
  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. # This file implements regression tests for SQLite library. The
  13. # focus of this file is testing the fix for ticket #3419.
  14. # Ticket #3419 is really a duplication of #3408 and had already
  15. # been fixed by the time it was reported. But it never hurts to
  16. # add new test cases.
  17. #
  18. # $Id: tkt3419.test,v 1.1 2008/10/06 15:31:13 drh Exp $
  19. set testdir [file dirname $argv0]
  20. source $testdir/tester.tcl
  21. do_test tkt3419-1.1 {
  22. execsql {
  23. create table a(id integer primary key);
  24. create table b(id integer primary key, a_id integer);
  25. create table c(id integer primary key, b_id integer);
  26. insert into a values (1);
  27. insert into a values (2);
  28. insert into b values (3, 1);
  29. insert into b values (4, 1);
  30. insert into b values (5, 1);
  31. insert into b values (6, 1);
  32. insert into b values (9, 2);
  33. insert into c values (4, 3);
  34. insert into c values (5, 5);
  35. insert into c values (6, 4);
  36. insert into c values (7, 6);
  37. insert into c values (8, 9);
  38. select * FROM a, b, c WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
  39. }
  40. } {2 9 2 8 9}
  41. do_test tkt3419-1.2 {
  42. execsql {
  43. select * FROM a, c, b WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
  44. }
  45. } {2 8 9 9 2}
  46. do_test tkt3419-1.3 {
  47. execsql {
  48. select * FROM b, a, c WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
  49. }
  50. } {9 2 2 8 9}
  51. do_test tkt3419-1.4 {
  52. execsql {
  53. select * FROM b, c, a WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
  54. }
  55. } {9 2 8 9 2}
  56. do_test tkt3419-1.5 {
  57. execsql {
  58. select * FROM c, a, b WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
  59. }
  60. } {8 9 2 9 2}
  61. do_test tkt3419-1.6 {
  62. execsql {
  63. select * FROM c, b, a WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
  64. }
  65. } {8 9 9 2 2}
  66. finish_test