1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug mdev-12368.

Mutually recursive CTE could cause a crash of the server in the case
when they were not Standard compliant. The crash happened in
mysql_derived_prepare(), because the destructor the derived_result
object created for a CTE that was mutually recursive with some others
was called twice. Yet this destructor should not be called for resursive
references.
This commit is contained in:
Igor Babaev
2017-03-26 22:59:33 -07:00
parent 5a4537f092
commit ad7da60ded
3 changed files with 80 additions and 3 deletions

View File

@ -789,9 +789,12 @@ exit:
*/
if (res)
{
if (derived->table && !derived->is_with_table_recursive_reference())
free_tmp_table(thd, derived->table);
delete derived->derived_result;
if (!derived->is_with_table_recursive_reference())
{
if (derived->table)
free_tmp_table(thd, derived->table);
delete derived->derived_result;
}
}
else
{