tkt3581.test 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # 2008 January 13
  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 #3581 has been
  14. # fixed.
  15. #
  16. # $Id: tkt3581.test,v 1.1 2009/01/14 01:10:40 drh Exp $
  17. set testdir [file dirname $argv0]
  18. source $testdir/tester.tcl
  19. do_test tkt3581-1.1 {
  20. db eval {
  21. CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
  22. INSERT INTO t1 VALUES(0,544,846);
  23. INSERT INTO t1 VALUES(1,345,51);
  24. CREATE TABLE t2(a INTEGER PRIMARY KEY, b, c);
  25. INSERT INTO t2 SELECT * FROM t1;
  26. CREATE INDEX i2 on t2(c);
  27. }
  28. } {}
  29. do_test tkt3581-1.2 {
  30. db eval {
  31. SELECT a FROM t1
  32. WHERE (b > 45 AND c < 356)
  33. OR b <= 733
  34. OR b >= 557
  35. OR (b >= 614 AND c < 251)
  36. ORDER BY b;
  37. }
  38. } {1 0}
  39. do_test tkt3581-1.3 {
  40. db eval {
  41. SELECT a FROM t2
  42. WHERE (b > 45 AND c < 356)
  43. OR b <= 733
  44. OR b >= 557
  45. OR (b >= 614 AND c < 251)
  46. ORDER BY b;
  47. }
  48. } {1 0}
  49. finish_test