diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-05-31 18:52:32 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-05-31 18:52:32 +0400 |
commit | ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (patch) | |
tree | 065bfa8c2afb2dcb2096e40d18c2e56a61eae47f /mysql-test/main/gis.test | |
parent | 3ceb4a54a178d3e92529b4be16e866e18fd15218 (diff) | |
download | mariadb-git-ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44.tar.gz |
MDEV-16351 JSON_OBJECT() treats hybrid functions with boolean arguments as numbers
Now the boolean data type is preserved in hybrid functions and MIN/MAX,
so COALESCE(bool_expr,bool_expr) and MAX(bool_expr) are correctly
detected by JSON_OBJECT() as being boolean rather than numeric expressions.
Diffstat (limited to 'mysql-test/main/gis.test')
-rw-r--r-- | mysql-test/main/gis.test | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/mysql-test/main/gis.test b/mysql-test/main/gis.test index ca806778f0e..1bac831ac22 100644 --- a/mysql-test/main/gis.test +++ b/mysql-test/main/gis.test @@ -2595,7 +2595,6 @@ SELECT ST_SRID(1); --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION SELECT ST_SRID('test'); - --echo # Item_bool_func_args_geometry --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION @@ -2990,3 +2989,30 @@ SELECT IS_USED_LOCK(POINT(1,1)); --echo # --echo # End of 10.3 tests --echo # + +--echo # +--echo # Start of 10.4 tests +--echo # + +--echo # +--echo # MDEV-16351 JSON_OBJECT() treats hybrid functions with boolean arguments as numbers +--echo # + +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +SELECT ST_SRID(TRUE); +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +SELECT ST_SRID(COALESCE(TRUE,TRUE)); + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3); +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +SELECT ST_SRID((SELECT MAX(a)>3 FROM t1)); +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +SELECT ST_SRID(MAX(a>3)) FROM t1; +--error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION +SELECT ST_SRID((SELECT MAX(a>3) FROM t1)); +DROP TABLE t1; + +--echo # +--echo # End of 10.4 tests +--echo # |