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:
@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user