summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorram@gw.mysql.r18.ru <>2004-08-26 16:51:26 +0500
committerram@gw.mysql.r18.ru <>2004-08-26 16:51:26 +0500
commit2133721ac65839fe34e8547a5664c01bc752e789 (patch)
tree1ca065ee635d6154b908894cf44330dbd59194e6 /mysql-test
parent9a6b76aa90aa2392b3ae79fc5240a22064a9b890 (diff)
downloadmariadb-git-2133721ac65839fe34e8547a5664c01bc752e789.tar.gz
A fix (Bug#5219: Cannot use '||' with MBRContains(..)).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/gis.result19
-rw-r--r--mysql-test/t/gis.test18
2 files changed, 37 insertions, 0 deletions
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index c2fd7855c85..9f5dd286cf9 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -466,3 +466,22 @@ insert IGNORE into t1 values ('Garbage');
ERROR HY000: Unknown error
alter table t1 add spatial index(a);
drop table t1;
+create table t1(a geometry not null, spatial index(a));
+insert into t1 values
+(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
+(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
+select AsText(a) from t1 where
+MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
+or
+MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
+AsText(a)
+POINT(1 1)
+POINT(3 3)
+POINT(4 4)
+select AsText(a) from t1 where
+MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
+and
+MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
+AsText(a)
+POINT(1 1)
+drop table t1;
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index 590007caba1..e35b9996a44 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -172,3 +172,21 @@ insert IGNORE into t1 values ('Garbage');
alter table t1 add spatial index(a);
drop table t1;
+
+#
+# Bug #5219: problem with range optimizer
+#
+
+create table t1(a geometry not null, spatial index(a));
+insert into t1 values
+(GeomFromText('POINT(1 1)')), (GeomFromText('POINT(3 3)')),
+(GeomFromText('POINT(4 4)')), (GeomFromText('POINT(6 6)'));
+select AsText(a) from t1 where
+ MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
+ or
+ MBRContains(GeomFromText('Polygon((2 2, 2 5, 5 5, 5 2, 2 2))'), a);
+select AsText(a) from t1 where
+ MBRContains(GeomFromText('Polygon((0 0, 0 2, 2 2, 2 0, 0 0))'), a)
+ and
+ MBRContains(GeomFromText('Polygon((0 0, 0 7, 7 7, 7 0, 0 0))'), a);
+drop table t1;