You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-10-31 18:30:33 +03:00
fix(plugin): MCOL 5675 - fix error message for null-safe equal (#3754)
This commit is contained in:
@@ -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();
|
||||
|
||||
10
mysql-test/columnstore/basic/r/mcol-5675.result
Normal file
10
mysql-test/columnstore/basic/r/mcol-5675.result
Normal file
@@ -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;
|
||||
@@ -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
|
||||
|
||||
19
mysql-test/columnstore/basic/t/mcol-5675.test
Normal file
19
mysql-test/columnstore/basic/t/mcol-5675.test
Normal file
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user