mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-20632: Recursive CTE cycle detection using CYCLE clause (nonstandard)
Added CYCLE ... RESTRICT (nonstandard) clause to recursive CTE.
This commit is contained in:
@@ -138,7 +138,7 @@ bool check_duplicate_names(THD *thd, List<Item> &item_list, bool gen_unique_view
|
||||
Item *check;
|
||||
/* treat underlying fields like set by user names */
|
||||
if (item->real_item()->type() == Item::FIELD_ITEM)
|
||||
item->is_autogenerated_name= FALSE;
|
||||
item->common_flags&= ~IS_AUTO_GENERATED_NAME;
|
||||
itc.rewind();
|
||||
while ((check= itc++) && check != item)
|
||||
{
|
||||
@@ -146,9 +146,9 @@ bool check_duplicate_names(THD *thd, List<Item> &item_list, bool gen_unique_view
|
||||
{
|
||||
if (!gen_unique_view_name)
|
||||
goto err;
|
||||
if (item->is_autogenerated_name)
|
||||
if (item->is_autogenerated_name())
|
||||
make_unique_view_field_name(thd, item, item_list, item);
|
||||
else if (check->is_autogenerated_name)
|
||||
else if (check->is_autogenerated_name())
|
||||
make_unique_view_field_name(thd, check, item_list, item);
|
||||
else
|
||||
goto err;
|
||||
@@ -180,7 +180,7 @@ void make_valid_column_names(THD *thd, List<Item> &item_list)
|
||||
|
||||
for (uint column_no= 1; (item= it++); column_no++)
|
||||
{
|
||||
if (!item->is_autogenerated_name || !check_column_name(item->name.str))
|
||||
if (!item->is_autogenerated_name() || !check_column_name(item->name.str))
|
||||
continue;
|
||||
name_len= my_snprintf(buff, NAME_LEN, "Name_exp_%u", column_no);
|
||||
item->orig_name= item->name.str;
|
||||
@@ -566,7 +566,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
|
||||
while ((item= it++, name= nm++))
|
||||
{
|
||||
item->set_name(thd, *name);
|
||||
item->is_autogenerated_name= FALSE;
|
||||
item->common_flags&= ~IS_AUTO_GENERATED_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user