You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-08 14:22:09 +03:00
fix(plugin): MCOL-5703 fix server crash on 'UNION ALL VALUES' queries
Such queries are not supported by the ColumnStore anyway.
This commit is contained in:
committed by
Leonid Fedorov
parent
d02e2854ae
commit
0f202fb633
@@ -680,7 +680,7 @@ select_handler* create_columnstore_select_handler_(THD* thd, SELECT_LEX* sel_lex
|
|||||||
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
|
create_explain_query_if_not_exists(thd->lex, thd->mem_root);
|
||||||
Query_arena *arena, backup;
|
Query_arena *arena, backup;
|
||||||
arena = thd->activate_stmt_arena_if_needed(&backup);
|
arena = thd->activate_stmt_arena_if_needed(&backup);
|
||||||
COND* conds = join->conds;
|
COND* conds = join ? join->conds : nullptr;
|
||||||
select_lex->where = conds;
|
select_lex->where = conds;
|
||||||
|
|
||||||
if (isPS)
|
if (isPS)
|
||||||
@@ -688,7 +688,11 @@ select_handler* create_columnstore_select_handler_(THD* thd, SELECT_LEX* sel_lex
|
|||||||
select_lex->prep_where = conds ? conds->copy_andor_structure(thd) : 0;
|
select_lex->prep_where = conds ? conds->copy_andor_structure(thd) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
select_lex->update_used_tables();
|
// no join indicates that there is no tables to update
|
||||||
|
if (join)
|
||||||
|
{
|
||||||
|
select_lex->update_used_tables();
|
||||||
|
}
|
||||||
|
|
||||||
if (arena)
|
if (arena)
|
||||||
thd->restore_active_arena(arena, &backup);
|
thd->restore_active_arena(arena, &backup);
|
||||||
@@ -714,7 +718,8 @@ select_handler* create_columnstore_select_handler_(THD* thd, SELECT_LEX* sel_lex
|
|||||||
JOIN* join = select_lex->join;
|
JOIN* join = select_lex->join;
|
||||||
|
|
||||||
// This is taken from JOIN::optimize()
|
// This is taken from JOIN::optimize()
|
||||||
join->fields = &select_lex->item_list;
|
if (join)
|
||||||
|
join->fields = &select_lex->item_list;
|
||||||
|
|
||||||
// Instantiate handler::table, which is the place for the result set.
|
// Instantiate handler::table, which is the place for the result set.
|
||||||
if ((i == 0) && handler->prepare())
|
if ((i == 0) && handler->prepare())
|
||||||
@@ -758,7 +763,7 @@ select_handler* create_columnstore_select_handler_(THD* thd, SELECT_LEX* sel_lex
|
|||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!join->zero_result_cause && join->exec_const_cond && !join->exec_const_cond->val_int())
|
if (join && !join->zero_result_cause && join->exec_const_cond && !join->exec_const_cond->val_int())
|
||||||
join->zero_result_cause = "Impossible WHERE noticed after reading const tables";
|
join->zero_result_cause = "Impossible WHERE noticed after reading const tables";
|
||||||
|
|
||||||
// We've called exec_const_cond->val_int(). This may have caused an error.
|
// We've called exec_const_cond->val_int(). This may have caused an error.
|
||||||
@@ -769,7 +774,7 @@ select_handler* create_columnstore_select_handler_(THD* thd, SELECT_LEX* sel_lex
|
|||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (join->zero_result_cause)
|
if (join && join->zero_result_cause)
|
||||||
{
|
{
|
||||||
if (join->select_lex->have_window_funcs() && join->send_row_on_empty_set())
|
if (join->select_lex->have_window_funcs() && join->send_row_on_empty_set())
|
||||||
{
|
{
|
||||||
@@ -789,7 +794,7 @@ select_handler* create_columnstore_select_handler_(THD* thd, SELECT_LEX* sel_lex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((join->select_lex->options & OPTION_SCHEMA_TABLE) &&
|
if (join && (join->select_lex->options & OPTION_SCHEMA_TABLE) &&
|
||||||
get_schema_tables_result(join, PROCESSED_BY_JOIN_EXEC))
|
get_schema_tables_result(join, PROCESSED_BY_JOIN_EXEC))
|
||||||
{
|
{
|
||||||
if (!thd->is_error())
|
if (!thd->is_error())
|
||||||
|
Reference in New Issue
Block a user