OLD | NEW |
1 # 2008 Feb 19 | 1 # 2008 Feb 19 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 16 matching lines...) Expand all Loading... |
27 # automatic assigning of rowid values. | 27 # automatic assigning of rowid values. |
28 # rtree-3.*: Linear scans of r-tree data. | 28 # rtree-3.*: Linear scans of r-tree data. |
29 # rtree-4.*: Test INSERT | 29 # rtree-4.*: Test INSERT |
30 # rtree-5.*: Test DELETE | 30 # rtree-5.*: Test DELETE |
31 # rtree-6.*: Test UPDATE | 31 # rtree-6.*: Test UPDATE |
32 # rtree-7.*: Test renaming an r-tree table. | 32 # rtree-7.*: Test renaming an r-tree table. |
33 # rtree-8.*: Test constrained scans of r-tree data. | 33 # rtree-8.*: Test constrained scans of r-tree data. |
34 # | 34 # |
35 # rtree-12.*: Test that on-conflict clauses are supported. | 35 # rtree-12.*: Test that on-conflict clauses are supported. |
36 # rtree-13.*: Test that bug [d2889096e7bdeac6d] has been fixed. | 36 # rtree-13.*: Test that bug [d2889096e7bdeac6d] has been fixed. |
| 37 # rtree-14.*: Test if a non-integer is inserted into the PK column of an |
| 38 # r-tree table, it is converted to an integer before being |
| 39 # inserted. Also that if a non-numeric is inserted into one |
| 40 # of the min/max dimension columns, it is converted to the |
| 41 # required type before being inserted. |
37 # | 42 # |
38 | 43 |
39 ifcapable !rtree { | 44 ifcapable !rtree { |
40 finish_test | 45 finish_test |
41 return | 46 return |
42 } | 47 } |
43 | 48 |
44 #---------------------------------------------------------------------------- | 49 #---------------------------------------------------------------------------- |
45 # Test cases rtree-1.* test CREATE and DROP table statements. | 50 # Test cases rtree-1.* test CREATE and DROP table statements. |
46 # | 51 # |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 533 |
529 do_execsql_test 13.2 { | 534 do_execsql_test 13.2 { |
530 WITH r(x) AS ( | 535 WITH r(x) AS ( |
531 SELECT 1 UNION ALL | 536 SELECT 1 UNION ALL |
532 SELECT 2 UNION ALL | 537 SELECT 2 UNION ALL |
533 SELECT 3 | 538 SELECT 3 |
534 ) | 539 ) |
535 SELECT * FROM r CROSS JOIN t9 WHERE id=x; | 540 SELECT * FROM r CROSS JOIN t9 WHERE id=x; |
536 } {1 1 0.0 0.0 2 2 0.0 0.0} | 541 } {1 1 0.0 0.0 2 2 0.0 0.0} |
537 | 542 |
| 543 #------------------------------------------------------------------------- |
| 544 # Test if a non-integer is inserted into the PK column of an r-tree |
| 545 # table, it is converted to an integer before being inserted. Also |
| 546 # that if a non-numeric is inserted into one of the min/max dimension |
| 547 # columns, it is converted to the required type before being inserted. |
| 548 # |
| 549 do_execsql_test 14.1 { |
| 550 CREATE VIRTUAL TABLE t10 USING rtree(ii, x1, x2); |
| 551 } |
| 552 |
| 553 do_execsql_test 14.2 { |
| 554 INSERT INTO t10 VALUES(NULL, 1, 2); |
| 555 INSERT INTO t10 VALUES(NULL, 2, 3); |
| 556 INSERT INTO t10 VALUES('4xxx', 3, 4); |
| 557 INSERT INTO t10 VALUES(5.0, 4, 5); |
| 558 INSERT INTO t10 VALUES(6.4, 5, 6); |
| 559 } |
| 560 do_execsql_test 14.3 { |
| 561 SELECT * FROM t10; |
| 562 } { |
| 563 1 1.0 2.0 2 2.0 3.0 4 3.0 4.0 5 4.0 5.0 6 5.0 6.0 |
| 564 } |
| 565 |
| 566 do_execsql_test 14.4 { |
| 567 DELETE FROM t10; |
| 568 INSERT INTO t10 VALUES(1, 'one', 'two'); |
| 569 INSERT INTO t10 VALUES(2, '52xyz', '81...'); |
| 570 } |
| 571 do_execsql_test 14.5 { |
| 572 SELECT * FROM t10; |
| 573 } { |
| 574 1 0.0 0.0 |
| 575 2 52.0 81.0 |
| 576 } |
| 577 |
| 578 do_execsql_test 14.4 { |
| 579 DROP TABLE t10; |
| 580 CREATE VIRTUAL TABLE t10 USING rtree_i32(ii, x1, x2); |
| 581 INSERT INTO t10 VALUES(1, 'one', 'two'); |
| 582 INSERT INTO t10 VALUES(2, '52xyz', '81...'); |
| 583 INSERT INTO t10 VALUES(3, 42.3, 49.9); |
| 584 } |
| 585 do_execsql_test 14.5 { |
| 586 SELECT * FROM t10; |
| 587 } { |
| 588 1 0 0 |
| 589 2 52 81 |
| 590 3 42 49 |
| 591 } |
| 592 |
538 finish_test | 593 finish_test |
OLD | NEW |