summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-07-10 11:55:16 +0400
committerAlexander Barkov <bar@mariadb.com>2019-07-10 11:55:16 +0400
commit265a7d1613d29e2bdd4c91a5a75971b331519dbe (patch)
treeb053ea8bc389ff1bd7a6a8d9a750cdc71c0d8f43 /mysql-test
parente37d7a37151f1aa53e102d24af5d234c2ccfa392 (diff)
downloadmariadb-git-265a7d1613d29e2bdd4c91a5a75971b331519dbe.tar.gz
MDEV-20009 Add CAST(expr AS pluggable_type)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/gis-debug.result8
-rw-r--r--mysql-test/main/gis-debug.test9
-rw-r--r--mysql-test/main/gis.result35
-rw-r--r--mysql-test/main/gis.test40
-rw-r--r--mysql-test/suite/compat/oracle/r/gis-debug.result8
-rw-r--r--mysql-test/suite/compat/oracle/r/gis.result35
-rw-r--r--mysql-test/suite/compat/oracle/t/gis-debug.test8
-rw-r--r--mysql-test/suite/compat/oracle/t/gis.test40
8 files changed, 183 insertions, 0 deletions
diff --git a/mysql-test/main/gis-debug.result b/mysql-test/main/gis-debug.result
index 8935c256068..f490a720ecf 100644
--- a/mysql-test/main/gis-debug.result
+++ b/mysql-test/main/gis-debug.result
@@ -502,5 +502,13 @@ SELECT WITHIN(POINT(1,1),POINT(1,1));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(POINT(1,1),POINT(1,1))' at line 1
SET SESSION debug_dbug="-d,make_item_func_call_native_simulate_not_found";
#
+# MDEV-20009 Add CAST(expr AS pluggable_type)
+#
+SET SESSION debug_dbug="+d,emulate_geometry_create_typecast_item";
+SELECT AsText(CAST('POINT(0 0)' AS GEOMETRY));
+AsText(CAST('POINT(0 0)' AS GEOMETRY))
+POINT(0 0)
+SET SESSION debug_dbug="-d,emulate_geometry_create_typecast_item";
+#
# End of 10.5 tests
#
diff --git a/mysql-test/main/gis-debug.test b/mysql-test/main/gis-debug.test
index 47eda47c7ff..dd1cbd0b932 100644
--- a/mysql-test/main/gis-debug.test
+++ b/mysql-test/main/gis-debug.test
@@ -171,5 +171,14 @@ SELECT WITHIN(POINT(1,1),POINT(1,1));
SET SESSION debug_dbug="-d,make_item_func_call_native_simulate_not_found";
--echo #
+--echo # MDEV-20009 Add CAST(expr AS pluggable_type)
+--echo #
+
+SET SESSION debug_dbug="+d,emulate_geometry_create_typecast_item";
+SELECT AsText(CAST('POINT(0 0)' AS GEOMETRY));
+SET SESSION debug_dbug="-d,emulate_geometry_create_typecast_item";
+
+
+--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/main/gis.result b/mysql-test/main/gis.result
index 2ba2a9d71c5..c01eda308ba 100644
--- a/mysql-test/main/gis.result
+++ b/mysql-test/main/gis.result
@@ -5056,5 +5056,40 @@ ERROR 42000: Incorrect parameter count in the call to native function 'WITHIN(PO
SELECT WITHIN(POINT(1,1), POINT(1,1), POINT(1,1));
ERROR 42000: Incorrect parameter count in the call to native function 'WITHIN(POINT(1,1), POINT(1,1), POINT(1,1))'
#
+# MDEV-20009 Add CAST(expr AS pluggable_type)
+#
+SELECT CAST(1 AS GEOMETRY);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)'
+SELECT CAST(1 AS GEOMETRYCOLLECTION);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)'
+SELECT CAST(1 AS POINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS point)'
+SELECT CAST(1 AS LINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)'
+SELECT CAST(1 AS POLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)'
+SELECT CAST(1 AS MULTIPOINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)'
+SELECT CAST(1 AS MULTILINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)'
+SELECT CAST(1 AS MULTIPOLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)'
+SELECT CONVERT(1, GEOMETRY);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)'
+SELECT CONVERT(1, GEOMETRYCOLLECTION);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)'
+SELECT CONVERT(1, POINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS point)'
+SELECT CONVERT(1, LINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)'
+SELECT CONVERT(1, POLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)'
+SELECT CONVERT(1, MULTIPOINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)'
+SELECT CONVERT(1, MULTILINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)'
+SELECT CONVERT(1, MULTIPOLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)'
+#
# End of 10.5 tests
#
diff --git a/mysql-test/main/gis.test b/mysql-test/main/gis.test
index a48fd8cf019..48f2803b27d 100644
--- a/mysql-test/main/gis.test
+++ b/mysql-test/main/gis.test
@@ -3141,5 +3141,45 @@ SELECT WITHIN(POINT(1,1));
SELECT WITHIN(POINT(1,1), POINT(1,1), POINT(1,1));
--echo #
+--echo # MDEV-20009 Add CAST(expr AS pluggable_type)
+--echo #
+
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS GEOMETRY);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS GEOMETRYCOLLECTION);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS POINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS LINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS POLYGON);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS MULTIPOINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS MULTILINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS MULTIPOLYGON);
+
+
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, GEOMETRY);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, GEOMETRYCOLLECTION);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, POINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, LINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, POLYGON);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, MULTIPOINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, MULTILINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, MULTIPOLYGON);
+
+
+--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/suite/compat/oracle/r/gis-debug.result b/mysql-test/suite/compat/oracle/r/gis-debug.result
index cf686ba4d34..9ab74e6e579 100644
--- a/mysql-test/suite/compat/oracle/r/gis-debug.result
+++ b/mysql-test/suite/compat/oracle/r/gis-debug.result
@@ -12,5 +12,13 @@ SELECT WITHIN(POINT(1,1),POINT(1,1));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(POINT(1,1),POINT(1,1))' at line 1
SET SESSION debug_dbug="-d,make_item_func_call_native_simulate_not_found";
#
+# MDEV-20009 Add CAST(expr AS pluggable_type)
+#
+SET SESSION debug_dbug="+d,emulate_geometry_create_typecast_item";
+SELECT AsText(CAST('POINT(0 0)' AS GEOMETRY));
+AsText(CAST('POINT(0 0)' AS GEOMETRY))
+POINT(0 0)
+SET SESSION debug_dbug="-d,emulate_geometry_create_typecast_item";
+#
# End of 10.5 tests
#
diff --git a/mysql-test/suite/compat/oracle/r/gis.result b/mysql-test/suite/compat/oracle/r/gis.result
index f8d5ff994cd..113cb0ea402 100644
--- a/mysql-test/suite/compat/oracle/r/gis.result
+++ b/mysql-test/suite/compat/oracle/r/gis.result
@@ -30,5 +30,40 @@ ERROR 42000: Incorrect parameter count in the call to native function 'WITHIN(PO
SELECT WITHIN(POINT(1,1), POINT(1,1), POINT(1,1));
ERROR 42000: Incorrect parameter count in the call to native function 'WITHIN(POINT(1,1), POINT(1,1), POINT(1,1))'
#
+# MDEV-20009 Add CAST(expr AS pluggable_type)
+#
+SELECT CAST(1 AS GEOMETRY);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)'
+SELECT CAST(1 AS GEOMETRYCOLLECTION);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)'
+SELECT CAST(1 AS POINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS point)'
+SELECT CAST(1 AS LINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)'
+SELECT CAST(1 AS POLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)'
+SELECT CAST(1 AS MULTIPOINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)'
+SELECT CAST(1 AS MULTILINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)'
+SELECT CAST(1 AS MULTIPOLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)'
+SELECT CONVERT(1, GEOMETRY);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometry)'
+SELECT CONVERT(1, GEOMETRYCOLLECTION);
+ERROR HY000: Operator does not exists: 'CAST(expr AS geometrycollection)'
+SELECT CONVERT(1, POINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS point)'
+SELECT CONVERT(1, LINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS linestring)'
+SELECT CONVERT(1, POLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS polygon)'
+SELECT CONVERT(1, MULTIPOINT);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipoint)'
+SELECT CONVERT(1, MULTILINESTRING);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multilinestring)'
+SELECT CONVERT(1, MULTIPOLYGON);
+ERROR HY000: Operator does not exists: 'CAST(expr AS multipolygon)'
+#
# End of 10.5 tests
#
diff --git a/mysql-test/suite/compat/oracle/t/gis-debug.test b/mysql-test/suite/compat/oracle/t/gis-debug.test
index ba01449b2cf..6053e546211 100644
--- a/mysql-test/suite/compat/oracle/t/gis-debug.test
+++ b/mysql-test/suite/compat/oracle/t/gis-debug.test
@@ -19,5 +19,13 @@ SELECT WITHIN(POINT(1,1),POINT(1,1));
SET SESSION debug_dbug="-d,make_item_func_call_native_simulate_not_found";
--echo #
+--echo # MDEV-20009 Add CAST(expr AS pluggable_type)
+--echo #
+
+SET SESSION debug_dbug="+d,emulate_geometry_create_typecast_item";
+SELECT AsText(CAST('POINT(0 0)' AS GEOMETRY));
+SET SESSION debug_dbug="-d,emulate_geometry_create_typecast_item";
+
+--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/suite/compat/oracle/t/gis.test b/mysql-test/suite/compat/oracle/t/gis.test
index 74d0f7f6ee5..cb1b869035a 100644
--- a/mysql-test/suite/compat/oracle/t/gis.test
+++ b/mysql-test/suite/compat/oracle/t/gis.test
@@ -32,5 +32,45 @@ SELECT WITHIN(POINT(1,1));
SELECT WITHIN(POINT(1,1), POINT(1,1), POINT(1,1));
--echo #
+--echo # MDEV-20009 Add CAST(expr AS pluggable_type)
+--echo #
+
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS GEOMETRY);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS GEOMETRYCOLLECTION);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS POINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS LINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS POLYGON);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS MULTIPOINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS MULTILINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CAST(1 AS MULTIPOLYGON);
+
+
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, GEOMETRY);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, GEOMETRYCOLLECTION);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, POINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, LINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, POLYGON);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, MULTIPOINT);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, MULTILINESTRING);
+--error ER_UNKNOWN_OPERATOR
+SELECT CONVERT(1, MULTIPOLYGON);
+
+
+--echo #
--echo # End of 10.5 tests
--echo #