mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
sql_select.cc, opt_sum.cc:
Fix bug: if MIN() or MAX() resulted in a deadlock or a lock wait timeout, MySQL did not return an error, but NULL as the function value sql/opt_sum.cc: Fix bug: if MIN() or MAX() resulted in a deadlock or a lock wait timeout, MySQL did not return an error, but NULL as the function value sql/sql_select.cc: Fix bug: if MIN() or MAX() resulted in a deadlock or a lock wait timeout, MySQL did not return an error, but NULL as the function value
This commit is contained in:
@ -391,8 +391,17 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
|
||||
if (tables && join.tmp_table_param.sum_func_count && ! group)
|
||||
{
|
||||
int res;
|
||||
/*
|
||||
opt_sum_query returns -1 if no rows match to the WHERE conditions,
|
||||
or 1 if all items were resolved, or 0, or an error number HA_ERR_...
|
||||
*/
|
||||
if ((res=opt_sum_query(tables, all_fields, conds)))
|
||||
{
|
||||
if (res > 1)
|
||||
{
|
||||
delete procedure;
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
if (res < 0)
|
||||
{
|
||||
error=return_zero_rows(&join, result, tables, fields, !group,
|
||||
|
Reference in New Issue
Block a user