mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #48291 : crash with row() operator,select into @var, and
subquery returning multiple rows Error handling was missing when handling subqueires in WHERE and when assigning a SELECT result to a @variable. This caused crash(es). Fixed by adding error handling code to both the WHERE condition evaluation and to assignment to an @variable.
This commit is contained in:
@ -10822,6 +10822,7 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
|
||||
bool not_used_in_distinct=join_tab->not_used_in_distinct;
|
||||
ha_rows found_records=join->found_records;
|
||||
COND *select_cond= join_tab->select_cond;
|
||||
bool select_cond_result= TRUE;
|
||||
|
||||
if (error > 0 || (*report_error)) // Fatal error
|
||||
return NESTED_LOOP_ERROR;
|
||||
@ -10833,7 +10834,17 @@ evaluate_join_record(JOIN *join, JOIN_TAB *join_tab,
|
||||
return NESTED_LOOP_KILLED; /* purecov: inspected */
|
||||
}
|
||||
DBUG_PRINT("info", ("select cond 0x%lx", (ulong)select_cond));
|
||||
if (!select_cond || select_cond->val_int())
|
||||
|
||||
if (select_cond)
|
||||
{
|
||||
select_cond_result= test(select_cond->val_int());
|
||||
|
||||
/* check for errors evaluating the condition */
|
||||
if (join->thd->net.report_error)
|
||||
return NESTED_LOOP_ERROR;
|
||||
}
|
||||
|
||||
if (!select_cond || select_cond_result)
|
||||
{
|
||||
/*
|
||||
There is no select condition or the attached pushed down
|
||||
|
Reference in New Issue
Block a user