From 42e3e574260dc6ccfe161f8c0d8e8af41e599353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 12 Oct 2017 16:21:21 +0300 Subject: MDEV-13626: Merge InnoDB test cases from MySQL 5.7 Add missing innodb_gis tests. --- mysql-test/suite/innodb_gis/t/bug16236208.test | 64 ++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 mysql-test/suite/innodb_gis/t/bug16236208.test (limited to 'mysql-test/suite/innodb_gis/t/bug16236208.test') diff --git a/mysql-test/suite/innodb_gis/t/bug16236208.test b/mysql-test/suite/innodb_gis/t/bug16236208.test new file mode 100644 index 00000000000..5f51c414fed --- /dev/null +++ b/mysql-test/suite/innodb_gis/t/bug16236208.test @@ -0,0 +1,64 @@ +#******************************************************** +# Bug 16236208 - GEOMETRY : SERVER CRASHES IN +# SEL_TREES_CAN_BE_ORED WHEN THE QUERY USES GIS COLS. +#******************************************************** + +--source include/have_geometry.inc +--source include/not_embedded.inc + +--disable_warnings +DROP TABLE IF EXISTS linestring; +--enable_warnings + +CREATE TABLE linestring (pk INTEGER NOT NULL PRIMARY KEY, linestring_key +GEOMETRY NOT NULL, linestring_nokey GEOMETRY NOT NULL) ENGINE=InnoDB ; + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (1, +ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) ')); + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (2, +ST_GeomFromText('LINESTRING(10 10,20 20,30 30)'), ST_GeomFromText('LINESTRING(10 +10,20 20,30 30)')); + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (3, +ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 40,10 +10))'), ST_GeomFromText('POLYGON((0 0,5 5,10 10,15 15,0 0),(10 10,20 20,30 30,40 +40,10 10))')); + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (4, +ST_GeomFromText('MULTIPOINT(0 0,5 5,10 10,20 20) '), ST_GeomFromText('MULTIPOINT(0 +0,5 5,10 10,20 20) ')); + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (5, +ST_GeomFromText('MULTILINESTRING((1 1,2 2,3 3),(10 10,20 20,30 30))'), +ST_GeomFromText('MULTILINESTRING((1 1,2 2,3 3),(10 10,20 20,30 30))')); + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (6, +ST_GeomFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 +9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))'), +ST_GeomFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 +9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')); + +INSERT INTO linestring (pk, linestring_key, linestring_nokey) VALUES (7, +ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))'), +ST_GeomFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')); + +CREATE INDEX linestring_index ON linestring(linestring_nokey(5)); +ALTER TABLE linestring ADD KEY (linestring_key(5)); + +--error ER_GIS_INVALID_DATA +SELECT ST_AsText(linestring_nokey) FROM linestring FORCE KEY ( +linestring_key ) WHERE ST_CONTAINS( ST_GeomFromText('POLYGON( ( 3923 2815 , 4246 +2122 , 4028 2971 , 4017 3019 , 3923 2815 ) )') , linestring_key ) AND +ST_WITHIN( ST_GeomFromText('POLYGON( ( 4135 3009 , 4914 3087 , 4236 3194 , 4091 +3036 , 4022 3004 , 4087 3004 , 3853 2825 , 3490 3118 , 3784 3141 , 4052 3072 +, 4205 2787 , 4024 2951 , 4076 3036 , 4041 3053 , 3789 3401 , 4080 3100 , +4169 2867 , 4056 3029 , 4715 3943 , 4052 3098 , 4035 3080 , 4013 3077 , 4218 +2915 , 3789 2980 , 4058 3046 , 4042 3043 , 4135 3009 ) )') , linestring_nokey +) AND ST_CONTAINS( ST_GeomFromText('POLYGON( ( 4082 2842 , 3678 3647 , 3420 3068 +, 4018 3030 , 4082 2842 ) )') , linestring_key ) OR ST_INTERSECTS( +ST_GeomFromText('MULTILINESTRING( ( 4147 2871 , 4072 3042 , 4081 3099 , 3796 +3021 , 4007 3463 ) , ( 4042 2808 , 4109 2816 , 3730 3673 ) )') , +linestring_key ) AND ST_Length( linestring_nokey ) > 1; + +DROP TABLE linestring; -- cgit v1.2.1 From a6a4c25bf7d943ff5a429fbf32fe04fdaca25b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 12 Oct 2017 17:21:04 +0300 Subject: MariaDB adjustments to innodb_gis tests. Some test are still disabled as they provide different results, fail on different error or crash. Fixes also MDEV-14060 InnoDB: Foreign key constraint to geometry type does not work where test intentionally tried incorrect cases. --- mysql-test/suite/innodb_gis/t/bug16236208.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/suite/innodb_gis/t/bug16236208.test') diff --git a/mysql-test/suite/innodb_gis/t/bug16236208.test b/mysql-test/suite/innodb_gis/t/bug16236208.test index 5f51c414fed..ef2da6f2ab1 100644 --- a/mysql-test/suite/innodb_gis/t/bug16236208.test +++ b/mysql-test/suite/innodb_gis/t/bug16236208.test @@ -5,6 +5,7 @@ --source include/have_geometry.inc --source include/not_embedded.inc +--source include/have_innodb.inc --disable_warnings DROP TABLE IF EXISTS linestring; -- cgit v1.2.1