tkt3363.test 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # 2008 Sep 08
  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. # The focus of this file is testing that ticket #3363 is fixed.
  13. #
  14. if {![info exists testdir]} {
  15. set testdir [file join [file dirname [info script]] .. .. test]
  16. }
  17. source [file join [file dirname [info script]] rtree_util.tcl]
  18. source $testdir/tester.tcl
  19. ifcapable !rtree {
  20. finish_test
  21. return
  22. }
  23. do_test tkt3363.1.1 {
  24. execsql { CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2) }
  25. } {}
  26. do_test tkt3363.1.2 {
  27. for {set ii 1} {$ii < 50} {incr ii} {
  28. set x 1000000
  29. set y [expr 4000000 + $ii*10]
  30. execsql { INSERT INTO t1 VALUES($ii, $x, $x, $y, $y) }
  31. }
  32. } {}
  33. do_test tkt3363.1.3 {
  34. execsql {
  35. SELECT count(*) FROM t1 WHERE +y2>4000425.0;
  36. }
  37. } {7}
  38. do_test tkt3363.1.4 {
  39. execsql {
  40. SELECT count(*) FROM t1 WHERE y2>4000425.0;
  41. }
  42. } {7}
  43. finish_test