rtree1.test 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. # 2008 Feb 19
  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 the r-tree extension.
  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. set testprefix rtree1
  20. # Test plan:
  21. #
  22. # rtree-1.*: Creating/destroying r-tree tables.
  23. # rtree-2.*: Test the implicit constraints - unique rowid and
  24. # (coord[N]<=coord[N+1]) for even values of N. Also
  25. # automatic assigning of rowid values.
  26. # rtree-3.*: Linear scans of r-tree data.
  27. # rtree-4.*: Test INSERT
  28. # rtree-5.*: Test DELETE
  29. # rtree-6.*: Test UPDATE
  30. # rtree-7.*: Test renaming an r-tree table.
  31. # rtree-8.*: Test constrained scans of r-tree data.
  32. #
  33. # rtree-12.*: Test that on-conflict clauses are supported.
  34. #
  35. ifcapable !rtree {
  36. finish_test
  37. return
  38. }
  39. #----------------------------------------------------------------------------
  40. # Test cases rtree-1.* test CREATE and DROP table statements.
  41. #
  42. # Test creating and dropping an rtree table.
  43. #
  44. do_test rtree-1.1.1 {
  45. execsql { CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2) }
  46. } {}
  47. do_test rtree-1.1.2 {
  48. execsql { SELECT name FROM sqlite_master ORDER BY name }
  49. } {t1 t1_node t1_parent t1_rowid}
  50. do_test rtree-1.1.3 {
  51. execsql {
  52. DROP TABLE t1;
  53. SELECT name FROM sqlite_master ORDER BY name;
  54. }
  55. } {}
  56. # Test creating and dropping an rtree table with an odd name in
  57. # an attached database.
  58. #
  59. do_test rtree-1.2.1 {
  60. file delete -force test2.db
  61. execsql {
  62. ATTACH 'test2.db' AS aux;
  63. CREATE VIRTUAL TABLE aux.'a" "b' USING rtree(ii, x1, x2, y1, y2);
  64. }
  65. } {}
  66. do_test rtree-1.2.2 {
  67. execsql { SELECT name FROM sqlite_master ORDER BY name }
  68. } {}
  69. do_test rtree-1.2.3 {
  70. execsql { SELECT name FROM aux.sqlite_master ORDER BY name }
  71. } {{a" "b} {a" "b_node} {a" "b_parent} {a" "b_rowid}}
  72. do_test rtree-1.2.4 {
  73. execsql {
  74. DROP TABLE aux.'a" "b';
  75. SELECT name FROM aux.sqlite_master ORDER BY name;
  76. }
  77. } {}
  78. # Test that the logic for checking the number of columns specified
  79. # for an rtree table. Acceptable values are odd numbers between 3 and
  80. # 11, inclusive.
  81. #
  82. set cols [list i1 i2 i3 i4 i5 i6 i7 i8 i9 iA iB iC iD iE iF iG iH iI iJ iK]
  83. for {set nCol 1} {$nCol<[llength $cols]} {incr nCol} {
  84. set columns [join [lrange $cols 0 [expr {$nCol-1}]] ,]
  85. set X {0 {}}
  86. if {$nCol%2 == 0} { set X {1 {Wrong number of columns for an rtree table}} }
  87. if {$nCol < 3} { set X {1 {Too few columns for an rtree table}} }
  88. if {$nCol > 11} { set X {1 {Too many columns for an rtree table}} }
  89. do_test rtree-1.3.$nCol {
  90. catchsql "
  91. CREATE VIRTUAL TABLE t1 USING rtree($columns);
  92. "
  93. } $X
  94. catchsql { DROP TABLE t1 }
  95. }
  96. # Like execsql except display output as integer where that can be
  97. # done without loss of information.
  98. #
  99. proc execsql_intout {sql} {
  100. set out {}
  101. foreach term [execsql $sql] {
  102. regsub {\.0$} $term {} term
  103. lappend out $term
  104. }
  105. return $out
  106. }
  107. # Test that it is possible to open an existing database that contains
  108. # r-tree tables.
  109. #
  110. do_test rtree-1.4.1 {
  111. execsql {
  112. CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2);
  113. INSERT INTO t1 VALUES(1, 5.0, 10.0);
  114. INSERT INTO t1 VALUES(2, 15.0, 20.0);
  115. }
  116. } {}
  117. do_test rtree-1.4.2 {
  118. db close
  119. sqlite3 db test.db
  120. execsql_intout { SELECT * FROM t1 ORDER BY ii }
  121. } {1 5 10 2 15 20}
  122. do_test rtree-1.4.3 {
  123. execsql { DROP TABLE t1 }
  124. } {}
  125. # Test that it is possible to create an r-tree table with ridiculous
  126. # column names.
  127. #
  128. do_test rtree-1.5.1 {
  129. execsql_intout {
  130. CREATE VIRTUAL TABLE t1 USING rtree("the key", "x dim.", "x2'dim");
  131. INSERT INTO t1 VALUES(1, 2, 3);
  132. SELECT "the key", "x dim.", "x2'dim" FROM t1;
  133. }
  134. } {1 2 3}
  135. do_test rtree-1.5.1 {
  136. execsql { DROP TABLE t1 }
  137. } {}
  138. # Force the r-tree constructor to fail.
  139. #
  140. do_test rtree-1.6.1 {
  141. execsql { CREATE TABLE t1_rowid(a); }
  142. catchsql {
  143. CREATE VIRTUAL TABLE t1 USING rtree("the key", "x dim.", "x2'dim");
  144. }
  145. } {1 {table "t1_rowid" already exists}}
  146. do_test rtree-1.6.1 {
  147. execsql { DROP TABLE t1_rowid }
  148. } {}
  149. #----------------------------------------------------------------------------
  150. # Test cases rtree-2.*
  151. #
  152. do_test rtree-2.1.1 {
  153. execsql {
  154. CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2);
  155. SELECT * FROM t1;
  156. }
  157. } {}
  158. do_test rtree-2.1.2 {
  159. execsql { INSERT INTO t1 VALUES(NULL, 1, 3, 2, 4) }
  160. execsql_intout { SELECT * FROM t1 }
  161. } {1 1 3 2 4}
  162. do_test rtree-2.1.3 {
  163. execsql { INSERT INTO t1 VALUES(NULL, 1, 3, 2, 4) }
  164. execsql { SELECT rowid FROM t1 ORDER BY rowid }
  165. } {1 2}
  166. do_test rtree-2.1.3 {
  167. execsql { INSERT INTO t1 VALUES(NULL, 1, 3, 2, 4) }
  168. execsql { SELECT ii FROM t1 ORDER BY ii }
  169. } {1 2 3}
  170. do_test rtree-2.2.1 {
  171. catchsql { INSERT INTO t1 VALUES(2, 1, 3, 2, 4) }
  172. } {1 {constraint failed}}
  173. do_test rtree-2.2.2 {
  174. catchsql { INSERT INTO t1 VALUES(4, 1, 3, 4, 2) }
  175. } {1 {constraint failed}}
  176. do_test rtree-2.2.3 {
  177. catchsql { INSERT INTO t1 VALUES(4, 3, 1, 2, 4) }
  178. } {1 {constraint failed}}
  179. do_test rtree-2.2.4 {
  180. execsql { SELECT ii FROM t1 ORDER BY ii }
  181. } {1 2 3}
  182. do_test rtree-2.X {
  183. execsql { DROP TABLE t1 }
  184. } {}
  185. #----------------------------------------------------------------------------
  186. # Test cases rtree-3.* test linear scans of r-tree table data. To test
  187. # this we have to insert some data into an r-tree, but that is not the
  188. # focus of these tests.
  189. #
  190. do_test rtree-3.1.1 {
  191. execsql {
  192. CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2);
  193. SELECT * FROM t1;
  194. }
  195. } {}
  196. do_test rtree-3.1.2 {
  197. execsql_intout {
  198. INSERT INTO t1 VALUES(5, 1, 3, 2, 4);
  199. SELECT * FROM t1;
  200. }
  201. } {5 1 3 2 4}
  202. do_test rtree-3.1.3 {
  203. execsql_intout {
  204. INSERT INTO t1 VALUES(6, 2, 6, 4, 8);
  205. SELECT * FROM t1;
  206. }
  207. } {5 1 3 2 4 6 2 6 4 8}
  208. # Test the constraint on the coordinates (c[i]<=c[i+1] where (i%2==0)):
  209. do_test rtree-3.2.1 {
  210. catchsql { INSERT INTO t1 VALUES(7, 2, 6, 4, 3) }
  211. } {1 {constraint failed}}
  212. do_test rtree-3.2.2 {
  213. catchsql { INSERT INTO t1 VALUES(8, 2, 6, 3, 3) }
  214. } {0 {}}
  215. #----------------------------------------------------------------------------
  216. # Test cases rtree-5.* test DELETE operations.
  217. #
  218. do_test rtree-5.1.1 {
  219. execsql { CREATE VIRTUAL TABLE t2 USING rtree(ii, x1, x2) }
  220. } {}
  221. do_test rtree-5.1.2 {
  222. execsql_intout {
  223. INSERT INTO t2 VALUES(1, 10, 20);
  224. INSERT INTO t2 VALUES(2, 30, 40);
  225. INSERT INTO t2 VALUES(3, 50, 60);
  226. SELECT * FROM t2 ORDER BY ii;
  227. }
  228. } {1 10 20 2 30 40 3 50 60}
  229. do_test rtree-5.1.3 {
  230. execsql_intout {
  231. DELETE FROM t2 WHERE ii=2;
  232. SELECT * FROM t2 ORDER BY ii;
  233. }
  234. } {1 10 20 3 50 60}
  235. do_test rtree-5.1.4 {
  236. execsql_intout {
  237. DELETE FROM t2 WHERE ii=1;
  238. SELECT * FROM t2 ORDER BY ii;
  239. }
  240. } {3 50 60}
  241. do_test rtree-5.1.5 {
  242. execsql {
  243. DELETE FROM t2 WHERE ii=3;
  244. SELECT * FROM t2 ORDER BY ii;
  245. }
  246. } {}
  247. do_test rtree-5.1.6 {
  248. execsql { SELECT * FROM t2_rowid }
  249. } {}
  250. #----------------------------------------------------------------------------
  251. # Test cases rtree-5.* test UPDATE operations.
  252. #
  253. do_test rtree-6.1.1 {
  254. execsql { CREATE VIRTUAL TABLE t3 USING rtree(ii, x1, x2, y1, y2) }
  255. } {}
  256. do_test rtree-6.1.2 {
  257. execsql_intout {
  258. INSERT INTO t3 VALUES(1, 2, 3, 4, 5);
  259. UPDATE t3 SET x2=5;
  260. SELECT * FROM t3;
  261. }
  262. } {1 2 5 4 5}
  263. do_test rtree-6.1.3 {
  264. execsql { UPDATE t3 SET ii = 2 }
  265. execsql_intout { SELECT * FROM t3 }
  266. } {2 2 5 4 5}
  267. #----------------------------------------------------------------------------
  268. # Test cases rtree-7.* test rename operations.
  269. #
  270. do_test rtree-7.1.1 {
  271. execsql {
  272. CREATE VIRTUAL TABLE t4 USING rtree(ii, x1, x2, y1, y2, z1, z2);
  273. INSERT INTO t4 VALUES(1, 2, 3, 4, 5, 6, 7);
  274. }
  275. } {}
  276. do_test rtree-7.1.2 {
  277. execsql { ALTER TABLE t4 RENAME TO t5 }
  278. execsql_intout { SELECT * FROM t5 }
  279. } {1 2 3 4 5 6 7}
  280. do_test rtree-7.1.3 {
  281. db close
  282. sqlite3 db test.db
  283. execsql_intout { SELECT * FROM t5 }
  284. } {1 2 3 4 5 6 7}
  285. do_test rtree-7.1.4 {
  286. execsql { ALTER TABLE t5 RENAME TO 'raisara "one"'''}
  287. execsql_intout { SELECT * FROM "raisara ""one""'" }
  288. } {1 2 3 4 5 6 7}
  289. do_test rtree-7.1.5 {
  290. execsql_intout { SELECT * FROM 'raisara "one"''' }
  291. } {1 2 3 4 5 6 7}
  292. do_test rtree-7.1.6 {
  293. execsql { ALTER TABLE "raisara ""one""'" RENAME TO "abc 123" }
  294. execsql_intout { SELECT * FROM "abc 123" }
  295. } {1 2 3 4 5 6 7}
  296. do_test rtree-7.1.7 {
  297. db close
  298. sqlite3 db test.db
  299. execsql_intout { SELECT * FROM "abc 123" }
  300. } {1 2 3 4 5 6 7}
  301. # An error midway through a rename operation.
  302. do_test rtree-7.2.1 {
  303. execsql {
  304. CREATE TABLE t4_node(a);
  305. }
  306. catchsql { ALTER TABLE "abc 123" RENAME TO t4 }
  307. } {1 {SQL logic error or missing database}}
  308. do_test rtree-7.2.2 {
  309. execsql_intout { SELECT * FROM "abc 123" }
  310. } {1 2 3 4 5 6 7}
  311. do_test rtree-7.2.3 {
  312. execsql {
  313. DROP TABLE t4_node;
  314. CREATE TABLE t4_rowid(a);
  315. }
  316. catchsql { ALTER TABLE "abc 123" RENAME TO t4 }
  317. } {1 {SQL logic error or missing database}}
  318. do_test rtree-7.2.4 {
  319. db close
  320. sqlite3 db test.db
  321. execsql_intout { SELECT * FROM "abc 123" }
  322. } {1 2 3 4 5 6 7}
  323. do_test rtree-7.2.5 {
  324. execsql { DROP TABLE t4_rowid }
  325. execsql { ALTER TABLE "abc 123" RENAME TO t4 }
  326. execsql_intout { SELECT * FROM t4 }
  327. } {1 2 3 4 5 6 7}
  328. #----------------------------------------------------------------------------
  329. # Test cases rtree-8.*
  330. #
  331. # Test that the function to determine if a leaf cell is part of the
  332. # result set works.
  333. do_test rtree-8.1.1 {
  334. execsql {
  335. CREATE VIRTUAL TABLE t6 USING rtree(ii, x1, x2);
  336. INSERT INTO t6 VALUES(1, 3, 7);
  337. INSERT INTO t6 VALUES(2, 4, 6);
  338. }
  339. } {}
  340. do_test rtree-8.1.2 { execsql { SELECT ii FROM t6 WHERE x1>2 } } {1 2}
  341. do_test rtree-8.1.3 { execsql { SELECT ii FROM t6 WHERE x1>3 } } {2}
  342. do_test rtree-8.1.4 { execsql { SELECT ii FROM t6 WHERE x1>4 } } {}
  343. do_test rtree-8.1.5 { execsql { SELECT ii FROM t6 WHERE x1>5 } } {}
  344. do_test rtree-8.1.6 { execsql { SELECT ii FROM t6 WHERE x1<3 } } {}
  345. do_test rtree-8.1.7 { execsql { SELECT ii FROM t6 WHERE x1<4 } } {1}
  346. do_test rtree-8.1.8 { execsql { SELECT ii FROM t6 WHERE x1<5 } } {1 2}
  347. #----------------------------------------------------------------------------
  348. # Test cases rtree-9.*
  349. #
  350. # Test that ticket #3549 is fixed.
  351. do_test rtree-9.1 {
  352. execsql {
  353. CREATE TABLE foo (id INTEGER PRIMARY KEY);
  354. CREATE VIRTUAL TABLE bar USING rtree (id, minX, maxX, minY, maxY);
  355. INSERT INTO foo VALUES (null);
  356. INSERT INTO foo SELECT null FROM foo;
  357. INSERT INTO foo SELECT null FROM foo;
  358. INSERT INTO foo SELECT null FROM foo;
  359. INSERT INTO foo SELECT null FROM foo;
  360. INSERT INTO foo SELECT null FROM foo;
  361. INSERT INTO foo SELECT null FROM foo;
  362. DELETE FROM foo WHERE id > 40;
  363. INSERT INTO bar SELECT NULL, 0, 0, 0, 0 FROM foo;
  364. }
  365. } {}
  366. # This used to crash.
  367. do_test rtree-9.2 {
  368. execsql {
  369. SELECT count(*) FROM bar b1, bar b2, foo s1 WHERE s1.id = b1.id;
  370. }
  371. } {1600}
  372. do_test rtree-9.3 {
  373. execsql {
  374. SELECT count(*) FROM bar b1, bar b2, foo s1
  375. WHERE b1.minX <= b2.maxX AND s1.id = b1.id;
  376. }
  377. } {1600}
  378. #-------------------------------------------------------------------------
  379. # Ticket #3970: Check that the error message is meaningful when a
  380. # keyword is used as a column name.
  381. #
  382. do_test rtree-10.1 {
  383. catchsql { CREATE VIRTUAL TABLE t7 USING rtree(index, x1, y1, x2, y2) }
  384. } {1 {near "index": syntax error}}
  385. #-------------------------------------------------------------------------
  386. # Test last_insert_rowid().
  387. #
  388. do_test rtree-11.1 {
  389. execsql {
  390. CREATE VIRTUAL TABLE t8 USING rtree(idx, x1, x2, y1, y2);
  391. INSERT INTO t8 VALUES(1, 1.0, 1.0, 2.0, 2.0);
  392. SELECT last_insert_rowid();
  393. }
  394. } {1}
  395. do_test rtree-11.2 {
  396. execsql {
  397. INSERT INTO t8 VALUES(NULL, 1.0, 1.0, 2.0, 2.0);
  398. SELECT last_insert_rowid();
  399. }
  400. } {2}
  401. #-------------------------------------------------------------------------
  402. # Test on-conflict clause handling.
  403. #
  404. db_delete_and_reopen
  405. do_execsql_test 12.0 {
  406. CREATE VIRTUAL TABLE t1 USING rtree_i32(idx, x1, x2, y1, y2);
  407. INSERT INTO t1 VALUES(1, 1, 2, 3, 4);
  408. INSERT INTO t1 VALUES(2, 2, 3, 4, 5);
  409. INSERT INTO t1 VALUES(3, 3, 4, 5, 6);
  410. CREATE TABLE source(idx, x1, x2, y1, y2);
  411. INSERT INTO source VALUES(5, 8, 8, 8, 8);
  412. INSERT INTO source VALUES(2, 7, 7, 7, 7);
  413. }
  414. db_save_and_close
  415. foreach {tn sql_template testdata} {
  416. 1 "INSERT %CONF% INTO t1 VALUES(2, 7, 7, 7, 7)" {
  417. ROLLBACK 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6}
  418. ABORT 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  419. IGNORE 0 0 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  420. FAIL 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  421. REPLACE 0 0 {1 1 2 3 4 2 7 7 7 7 3 3 4 5 6 4 4 5 6 7}
  422. }
  423. 2 "INSERT %CONF% INTO t1 SELECT * FROM source" {
  424. ROLLBACK 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6}
  425. ABORT 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  426. IGNORE 1 0 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7 5 8 8 8 8}
  427. FAIL 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7 5 8 8 8 8}
  428. REPLACE 1 0 {1 1 2 3 4 2 7 7 7 7 3 3 4 5 6 4 4 5 6 7 5 8 8 8 8}
  429. }
  430. 3 "UPDATE %CONF% t1 SET idx = 2 WHERE idx = 4" {
  431. ROLLBACK 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6}
  432. ABORT 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  433. IGNORE 1 0 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  434. FAIL 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  435. REPLACE 1 0 {1 1 2 3 4 2 4 5 6 7 3 3 4 5 6}
  436. }
  437. 3 "UPDATE %CONF% t1 SET idx = ((idx+1)%5)+1 WHERE idx > 2" {
  438. ROLLBACK 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6}
  439. ABORT 1 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  440. IGNORE 1 0 {1 1 2 3 4 2 2 3 4 5 4 4 5 6 7 5 3 4 5 6}
  441. FAIL 1 1 {1 1 2 3 4 2 2 3 4 5 4 4 5 6 7 5 3 4 5 6}
  442. REPLACE 1 0 {1 4 5 6 7 2 2 3 4 5 5 3 4 5 6}
  443. }
  444. 4 "INSERT %CONF% INTO t1 VALUES(2, 7, 6, 7, 7)" {
  445. ROLLBACK 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6}
  446. ABORT 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  447. IGNORE 0 0 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  448. FAIL 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  449. REPLACE 0 1 {1 1 2 3 4 2 2 3 4 5 3 3 4 5 6 4 4 5 6 7}
  450. }
  451. } {
  452. foreach {mode uses error data} $testdata {
  453. db_restore_and_reopen
  454. set sql [string map [list %CONF% "OR $mode"] $sql_template]
  455. set testname "12.$tn.[string tolower $mode]"
  456. execsql {
  457. BEGIN;
  458. INSERT INTO t1 VALUES(4, 4, 5, 6, 7);
  459. }
  460. set res(0) {0 {}}
  461. set res(1) {1 {constraint failed}}
  462. do_catchsql_test $testname.1 $sql $res($error)
  463. do_test $testname.2 [list sql_uses_stmt db $sql] $uses
  464. do_execsql_test $testname.3 { SELECT * FROM t1 ORDER BY idx } $data
  465. do_test $testname.4 { rtree_check db t1 } 0
  466. db close
  467. }
  468. }
  469. finish_test