1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Fixed review notices, added the loop over selects, to collect error on more tnan two selects

This commit is contained in:
Leonid Fedorov
2024-04-16 14:57:53 +00:00
committed by Leonid Fedorov
parent 8efdee6eca
commit 71185efe54
3 changed files with 39 additions and 10 deletions

View File

@ -6744,16 +6744,21 @@ int processFrom(bool& isUnion, SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP&
// 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 (select_lex.master_unit() && select_lex.master_unit()->first_select())
{
if (nextSelect->get_linkage() == INTERSECT_TYPE)
for (auto nextSelect = select_lex.master_unit()->first_select()->next_select(); nextSelect;
nextSelect = nextSelect->next_select())
{
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 (nextSelect->get_linkage() == INTERSECT_TYPE)
{
setError(gwi.thd, ER_INTERNAL_ERROR, "INTERSECT is not supported by Columnstore engine", gwi);
return ER_INTERNAL_ERROR;
}
else if (nextSelect->get_linkage() == EXCEPT_TYPE)
{
setError(gwi.thd, ER_INTERNAL_ERROR, "EXCEPT is not supported by Columnstore engine", gwi);
return ER_INTERNAL_ERROR;
}
}
}