You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
fix(plugin) MCOL-5699: throw error for unimplemented INTERSECT and EXCEPT
This commit is contained in:
committed by
Leonid Fedorov
parent
a8d3fff79e
commit
904ac415e4
@ -6742,6 +6742,21 @@ int processFrom(bool& isUnion, SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP&
|
|||||||
// Existed pushdown handlers won't get in this scope
|
// Existed pushdown handlers won't get in this scope
|
||||||
// MDEV-25080 Union pushdown would enter this scope
|
// MDEV-25080 Union pushdown would enter this scope
|
||||||
// is_unit_op() give a segv for derived_handler's SELECT_LEX
|
// is_unit_op() give a segv for derived_handler's SELECT_LEX
|
||||||
|
|
||||||
|
// check INTERSECT or EXCEPT, that are not implemented
|
||||||
|
auto * nextSelect = select_lex.master_unit()->first_select()->next_select();
|
||||||
|
if (nextSelect)
|
||||||
|
{
|
||||||
|
if (nextSelect->get_linkage() == INTERSECT_TYPE)
|
||||||
|
{
|
||||||
|
setError(gwi.thd, ER_INTERNAL_ERROR, "INTERSECT is not supported by Columnstore engine", gwi);
|
||||||
|
}
|
||||||
|
else if (nextSelect->get_linkage() == EXCEPT_TYPE)
|
||||||
|
{
|
||||||
|
setError(gwi.thd, ER_INTERNAL_ERROR, "EXCEPT is not supported by Columnstore engine", gwi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!isUnion && (!isSelectHandlerTop || isSelectLexUnit) && select_lex.master_unit()->is_unit_op())
|
if (!isUnion && (!isSelectHandlerTop || isSelectLexUnit) && select_lex.master_unit()->is_unit_op())
|
||||||
{
|
{
|
||||||
// MCOL-2178 isUnion member only assigned, never used
|
// MCOL-2178 isUnion member only assigned, never used
|
||||||
|
33
mysql-test/columnstore/bugfixes/MCOL-5699.result
Normal file
33
mysql-test/columnstore/bugfixes/MCOL-5699.result
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
DROP DATABASE IF EXISTS mcol_5699 ;
|
||||||
|
CREATE DATABASE mcol_5699 ;
|
||||||
|
USE mcol_5699 ;
|
||||||
|
CREATE TABLE cs1(a text) ENGINE=columnstore;
|
||||||
|
INSERT INTO cs1 VALUES('a'),('b'),('c'),('x');
|
||||||
|
CREATE TABLE cs2(a text) ENGINE=columnstore;
|
||||||
|
INSERT INTO cs1 VALUES('y'),('z'),('x');
|
||||||
|
SELECT a from cs1 UNION ALL select a from cs2;
|
||||||
|
a
|
||||||
|
a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
x
|
||||||
|
y
|
||||||
|
z
|
||||||
|
x
|
||||||
|
SELECT a from cs1 UNION DISTINCT select a from cs2;
|
||||||
|
a
|
||||||
|
a
|
||||||
|
b
|
||||||
|
c
|
||||||
|
x
|
||||||
|
y
|
||||||
|
z
|
||||||
|
SELECT a from cs1 INTERSECT ALL select a from cs2;
|
||||||
|
ERROR HY000: Internal error: INTERSECT is not supported by Columnstore engine
|
||||||
|
SELECT a from cs1 INTERSECT DISTINCT select a from cs2;
|
||||||
|
ERROR HY000: Internal error: INTERSECT is not supported by Columnstore engine
|
||||||
|
SELECT a from cs1 EXCEPT ALL select a from cs2;
|
||||||
|
ERROR HY000: Internal error: EXCEPT is not supported by Columnstore engine
|
||||||
|
SELECT a from cs1 EXCEPT DISTINCT select a from cs2;
|
||||||
|
ERROR HY000: Internal error: EXCEPT is not supported by Columnstore engine
|
||||||
|
DROP DATABASE mcol_5699 ;
|
25
mysql-test/columnstore/bugfixes/MCOL-5699.test
Normal file
25
mysql-test/columnstore/bugfixes/MCOL-5699.test
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
--source ../include/have_columnstore.inc
|
||||||
|
--disable_warnings
|
||||||
|
DROP DATABASE IF EXISTS mcol_5699 ;
|
||||||
|
--enable_warnings
|
||||||
|
CREATE DATABASE mcol_5699 ;
|
||||||
|
USE mcol_5699 ;
|
||||||
|
CREATE TABLE cs1(a text) ENGINE=columnstore;
|
||||||
|
INSERT INTO cs1 VALUES('a'),('b'),('c'),('x');
|
||||||
|
|
||||||
|
CREATE TABLE cs2(a text) ENGINE=columnstore;
|
||||||
|
INSERT INTO cs1 VALUES('y'),('z'),('x');
|
||||||
|
|
||||||
|
SELECT a from cs1 UNION ALL select a from cs2;
|
||||||
|
SELECT a from cs1 UNION DISTINCT select a from cs2;
|
||||||
|
|
||||||
|
--ERROR 1815
|
||||||
|
SELECT a from cs1 INTERSECT ALL select a from cs2;
|
||||||
|
--ERROR 1815
|
||||||
|
SELECT a from cs1 INTERSECT DISTINCT select a from cs2;
|
||||||
|
--ERROR 1815
|
||||||
|
SELECT a from cs1 EXCEPT ALL select a from cs2;
|
||||||
|
--ERROR 1815
|
||||||
|
SELECT a from cs1 EXCEPT DISTINCT select a from cs2;
|
||||||
|
|
||||||
|
DROP DATABASE mcol_5699 ;
|
Reference in New Issue
Block a user