Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(445)

Unified Diff: third_party/sqlite/src/ext/rtree/rtree1.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/ext/rtree/rtree.c ('k') | third_party/sqlite/src/ext/rtree/rtree6.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/ext/rtree/rtree1.test
diff --git a/third_party/sqlite/src/ext/rtree/rtree1.test b/third_party/sqlite/src/ext/rtree/rtree1.test
index 0beb16cc9494468168c6c9b26c4ebbbc09a78770..c9192de192edd4a7c5db0c3eaf6b1d30685338b2 100644
--- a/third_party/sqlite/src/ext/rtree/rtree1.test
+++ b/third_party/sqlite/src/ext/rtree/rtree1.test
@@ -34,6 +34,11 @@ set testprefix rtree1
#
# rtree-12.*: Test that on-conflict clauses are supported.
# rtree-13.*: Test that bug [d2889096e7bdeac6d] has been fixed.
+# rtree-14.*: Test if a non-integer is inserted into the PK column of an
+# r-tree table, it is converted to an integer before being
+# inserted. Also that if a non-numeric is inserted into one
+# of the min/max dimension columns, it is converted to the
+# required type before being inserted.
#
ifcapable !rtree {
@@ -535,4 +540,54 @@ do_execsql_test 13.2 {
SELECT * FROM r CROSS JOIN t9 WHERE id=x;
} {1 1 0.0 0.0 2 2 0.0 0.0}
+#-------------------------------------------------------------------------
+# Test if a non-integer is inserted into the PK column of an r-tree
+# table, it is converted to an integer before being inserted. Also
+# that if a non-numeric is inserted into one of the min/max dimension
+# columns, it is converted to the required type before being inserted.
+#
+do_execsql_test 14.1 {
+ CREATE VIRTUAL TABLE t10 USING rtree(ii, x1, x2);
+}
+
+do_execsql_test 14.2 {
+ INSERT INTO t10 VALUES(NULL, 1, 2);
+ INSERT INTO t10 VALUES(NULL, 2, 3);
+ INSERT INTO t10 VALUES('4xxx', 3, 4);
+ INSERT INTO t10 VALUES(5.0, 4, 5);
+ INSERT INTO t10 VALUES(6.4, 5, 6);
+}
+do_execsql_test 14.3 {
+ SELECT * FROM t10;
+} {
+ 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
+}
+
+do_execsql_test 14.4 {
+ DELETE FROM t10;
+ INSERT INTO t10 VALUES(1, 'one', 'two');
+ INSERT INTO t10 VALUES(2, '52xyz', '81...');
+}
+do_execsql_test 14.5 {
+ SELECT * FROM t10;
+} {
+ 1 0.0 0.0
+ 2 52.0 81.0
+}
+
+do_execsql_test 14.4 {
+ DROP TABLE t10;
+ CREATE VIRTUAL TABLE t10 USING rtree_i32(ii, x1, x2);
+ INSERT INTO t10 VALUES(1, 'one', 'two');
+ INSERT INTO t10 VALUES(2, '52xyz', '81...');
+ INSERT INTO t10 VALUES(3, 42.3, 49.9);
+}
+do_execsql_test 14.5 {
+ SELECT * FROM t10;
+} {
+ 1 0 0
+ 2 52 81
+ 3 42 49
+}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/ext/rtree/rtree.c ('k') | third_party/sqlite/src/ext/rtree/rtree6.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698