diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 01ab0e52c..76ef89cc0 100644 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -1692,6 +1692,12 @@ bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip) { // Convert "a <=> b" to (a = b OR (a IS NULL AND b IS NULL))" idbassert(gwip->rcWorkStack.size() >= 2); + if(std::strcmp(ifp->func_name(), "<=>") == 0) + { + gwip->fatalParseError= true; + gwip->parseErrorText = "<=> (null-safe equal) is not supported in Columnstore"; + return false; + } ReturnedColumn* rhs = gwip->rcWorkStack.top(); gwip->rcWorkStack.pop(); ReturnedColumn* lhs = gwip->rcWorkStack.top(); diff --git a/mysql-test/columnstore/basic/r/mcol-5675.result b/mysql-test/columnstore/basic/r/mcol-5675.result new file mode 100644 index 000000000..a5c6fffc1 --- /dev/null +++ b/mysql-test/columnstore/basic/r/mcol-5675.result @@ -0,0 +1,10 @@ +DROP DATABASE IF EXISTS test_mcol5675; +CREATE DATABASE test_mcol5675; +USE test_mcol5675; +CREATE TABLE person (name varchar(100) NOT NULL, surname varchar(100) DEFAULT NULL ) +ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci ; +insert into person (name, surname) values ('Warren', NULL), ('Charlie', 'Peterson'); +SELECT * FROM person WHERE surname <=> 1; +ERROR HY000: Internal error: <=> (null-safe equal) is not supported in Columnstore +DROP TABLE person; +DROP DATABASE test_mcol5675; diff --git a/mysql-test/columnstore/basic/r/mcs111_comparison_operators.result b/mysql-test/columnstore/basic/r/mcs111_comparison_operators.result index 25cd86f98..62f54a00d 100644 --- a/mysql-test/columnstore/basic/r/mcs111_comparison_operators.result +++ b/mysql-test/columnstore/basic/r/mcs111_comparison_operators.result @@ -62,7 +62,7 @@ t1_INT t1_DECIMAL 103 1234.56990 9913 98765.43210 SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT <=> t1_DECIMAL ORDER BY 1; -t1_INT t1_DECIMAL +ERROR HY000: Internal error: <=> (null-safe equal) is not supported in Columnstore SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT <> t1_DECIMAL ORDER BY 1; t1_INT t1_DECIMAL -7299 111.99000 diff --git a/mysql-test/columnstore/basic/t/mcol-5675.test b/mysql-test/columnstore/basic/t/mcol-5675.test new file mode 100644 index 000000000..406be6791 --- /dev/null +++ b/mysql-test/columnstore/basic/t/mcol-5675.test @@ -0,0 +1,19 @@ +--disable_warnings +DROP DATABASE IF EXISTS test_mcol5675; +--enable_warnings + +CREATE DATABASE test_mcol5675; +USE test_mcol5675; + +CREATE TABLE person (name varchar(100) NOT NULL, surname varchar(100) DEFAULT NULL ) + ENGINE=Columnstore DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci ; + +insert into person (name, surname) values ('Warren', NULL), ('Charlie', 'Peterson'); + +--error 1815 +SELECT * FROM person WHERE surname <=> 1; + +DROP TABLE person; + +#clear +DROP DATABASE test_mcol5675; \ No newline at end of file diff --git a/mysql-test/columnstore/basic/t/mcs111_comparison_operators.test b/mysql-test/columnstore/basic/t/mcs111_comparison_operators.test index 59ecfe3c4..ea6e3d257 100644 --- a/mysql-test/columnstore/basic/t/mcs111_comparison_operators.test +++ b/mysql-test/columnstore/basic/t/mcs111_comparison_operators.test @@ -50,6 +50,7 @@ SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT != t1_DECIMAL ORDER BY 1; SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT = t1_DECIMAL ORDER BY 1; SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT >= t1_DECIMAL ORDER BY 1; SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT <= t1_DECIMAL ORDER BY 1; +--error 1815 SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT <=> t1_DECIMAL ORDER BY 1; SELECT t1_INT, t1_DECIMAL from t1 WHERE t1_INT <> t1_DECIMAL ORDER BY 1;