1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed bug #22085: Crash on the execution of a prepared

statement that uses an aggregating IN subquery with 
HAVING clause.
A wrong order of the call of split_sum_func2 for the HAVING
clause of the subquery and the transformation for the 
subquery resulted in the creation of a andor structure
that could not be restored at an execution of the prepared
statement.


mysql-test/r/ps.result:
  Added a test cases for bug #22085.
mysql-test/t/ps.test:
  Added a test cases for bug #22085.
This commit is contained in:
unknown
2006-09-16 11:50:00 -07:00
parent b527a75e01
commit c46151d961
3 changed files with 102 additions and 2 deletions

View File

@ -290,8 +290,6 @@ JOIN::prepare(Item ***rref_pointer_array,
select_lex->having_fix_field= 0;
if (having_fix_rc || thd->net.report_error)
DBUG_RETURN(-1); /* purecov: inspected */
if (having->with_sum_func)
having->split_sum_func2(thd, ref_pointer_array, all_fields, &having);
}
// Is it subselect
@ -306,6 +304,9 @@ JOIN::prepare(Item ***rref_pointer_array,
}
}
if (having && having->with_sum_func)
having->split_sum_func2(thd, ref_pointer_array, all_fields, &having);
if (setup_ftfuncs(select_lex)) /* should be after having->fix_fields */
DBUG_RETURN(-1);