/ Check-in [8ea3601c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add some rtree tests to the backcompat.test script.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8ea3601cd11088ae4d62bd4a05d1675301b26ace
User & Date: dan 2011-04-08 18:47:24
Context
2011-04-08
21:35
Always make sure the left-hand side of the IS NOT NULL operator is a simple column, not a general expression, before applying the IS NOT NULL query optimization. check-in: 543f75a6 user: drh tags: trunk
18:47
Add some rtree tests to the backcompat.test script. check-in: 8ea3601c user: dan tags: trunk
17:22
Fix incrvacuum2.test so that it works with the inmemory_journal permutation. check-in: 7b8e1761 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/backcompat.test.

   362    362   
   363    363         6    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'aa'"
   364    364         7    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH '44'"
   365    365         8    "SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'a*'"
   366    366       } {
   367    367         do_test backcompat-3.7 [list sql1 $q] [sql2 $q]
   368    368       }
          369  +  }
          370  +}
          371  +
          372  +#-------------------------------------------------------------------------
          373  +# Test that Rtree tables may be read/written by different versions of 
          374  +# SQLite. 
          375  +#
          376  +set contents {
          377  +  CREATE VIRTUAL TABLE t1 USING rtree(id, x1, x2, y1, y2);
          378  +}
          379  +foreach {id x1 x2 y1 y2} {
          380  +  1    -47.64 43.87    33.86 34.42        2    -21.51 17.32    2.05 31.04
          381  +  3    -43.67 -38.33    -19.79 3.43       4    32.41 35.16    9.12 19.82
          382  +  5    33.28 34.87    14.78 28.26         6    49.31 116.59    -9.87 75.09
          383  +  7    -14.93 34.51    -17.64 64.09       8    -43.05 23.43    -1.19 69.44
          384  +  9    44.79 133.56    28.09 80.30        10    -2.66 81.47    -41.38 -10.46
          385  +  11    -42.89 -3.54    15.76 71.63       12    -3.50 84.96    -11.64 64.95
          386  +  13    -45.69 26.25    11.14 55.06       14    -44.09 11.23    17.52 44.45
          387  +  15    36.23 133.49    -19.38 53.67      16    -17.89 81.54    14.64 50.61
          388  +  17    -41.97 -24.04    -39.43 28.95     18    -5.85 7.76    -6.38 47.02
          389  +  19    18.82 27.10    42.82 100.09       20    39.17 113.45    26.14 73.47
          390  +  21    22.31 103.17    49.92 106.05      22    -43.06 40.38    -1.75 76.08
          391  +  23    2.43 57.27    -14.19 -3.83        24    -47.57 -4.35    8.93 100.06
          392  +  25    -37.47 49.14    -29.11 8.81       26    -7.86 75.72    49.34 107.42
          393  +  27    1.53 45.49    20.36 49.74         28    -48.48 32.54    28.81 54.45
          394  +  29    2.67 39.77    -4.05 13.67         30    4.11 62.88    -47.44 -5.72
          395  +  31    -21.47 51.75    37.25 116.09      32    45.59 111.37    -6.43 43.64
          396  +  33    35.23 48.29    23.54 113.33       34    16.61 68.35    -14.69 65.97
          397  +  35    13.98 16.60    48.66 102.87       36    19.74 23.84    31.15 77.27
          398  +  37    -27.61 24.43    7.96 94.91        38    -34.77 12.05    -22.60 -6.29
          399  +  39    -25.83 8.71    -13.48 -12.53      40    -17.11 -1.01    18.06 67.89
          400  +  41    14.13 71.72    -3.78 39.25        42    23.75 76.00    -16.30 8.23
          401  +  43    -39.15 28.63    38.12 125.88      44    48.62 86.09    36.49 102.95
          402  +  45    -31.39 -21.98    2.52 89.78       46    5.65 56.04    15.94 89.10
          403  +  47    18.28 95.81    46.46 143.08       48    30.93 102.82    -20.08 37.36
          404  +  49    -20.78 -3.48    -5.58 35.46       50    49.85 90.58    -24.48 46.29
          405  +} {
          406  +if {$x1 >= $x2 || $y1 >= $y2} { error "$x1 $x2 $y1 $y2" }
          407  +  append contents "INSERT INTO t1 VALUES($id, $x1, $x2, $y1, $y2);"
          408  +}
          409  +set queries {
          410  +  1    "SELECT id FROM t1 WHERE x1>10 AND x2<44"
          411  +  2    "SELECT id FROM t1 WHERE y1<100"
          412  +  3    "SELECT id FROM t1 WHERE y1<100 AND x1>0"
          413  +  4    "SELECT id FROM t1 WHERE y1>10 AND x1>0 AND x2<50 AND y2<550"
          414  +}
          415  +do_allbackcompat_test {
          416  +  if {[code1 {set ::sqlite_options(fts3)}]
          417  +   && [code2 {set ::sqlite_options(fts3)}]
          418  +  } {
          419  +
          420  +    do_test backcompat-4.1 { sql1 $contents } {}
          421  +
          422  +    foreach {n q} $::queries {
          423  +      do_test backcompat-4.2.$n [list sql1 $q] [sql2 $q]
          424  +    }
          425  +
          426  +    do_test backcompat-4.3 { sql1 {
          427  +      INSERT INTO t1 SELECT id+100, x1+10.0, x2+10.0, y1-10.0, y2-10.0 FROM t1;
          428  +    } } {}
          429  +
          430  +    foreach {n q} $::queries {
          431  +      do_test backcompat-4.4.$n [list sql1 $q] [sql2 $q]
          432  +    }
          433  +
          434  +    do_test backcompat-4.5 { sql2 {
          435  +      INSERT INTO t1 SELECT id+200, x1+20.0, x2+20.0, y1-20.0, y2-20.0 FROM t1;
          436  +    } } {}
          437  +
          438  +    foreach {n q} $::queries {
          439  +      do_test backcompat-4.6.$n [list sql1 $q] [sql2 $q]
          440  +    }
          441  +
   369    442     }
   370    443   }
   371    444   
   372    445   finish_test