1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.11 into 11.0

This commit is contained in:
Marko Mäkelä
2023-11-24 11:20:56 +02:00
165 changed files with 2019 additions and 450 deletions

View File

@@ -2960,6 +2960,7 @@ void st_select_lex::init_query()
tvc= 0;
versioned_tables= 0;
pushdown_select= 0;
orig_names_of_item_list_elems= 0;
}
void st_select_lex::init_select()
@@ -3011,6 +3012,7 @@ void st_select_lex::init_select()
versioned_tables= 0;
is_tvc_wrapper= false;
nest_flags= 0;
orig_names_of_item_list_elems= 0;
}
/*
@@ -11192,6 +11194,71 @@ exit:
}
/**
@brief
Save the original names of items from the item list.
@retval
true - if an error occurs
false - otherwise
*/
bool st_select_lex::save_item_list_names(THD *thd)
{
if (orig_names_of_item_list_elems)
return false;
Query_arena *arena, backup;
arena= thd->activate_stmt_arena_if_needed(&backup);
if (unlikely(!(orig_names_of_item_list_elems= new(thd->mem_root)
List<Lex_ident_sys>)))
return true;
List_iterator_fast<Item> li(item_list);
Item *item;
while ((item= li++))
{
if (unlikely(orig_names_of_item_list_elems->push_back(
new Lex_ident_sys(item->name.str, item->name.length))))
{
if (arena)
thd->restore_active_arena(arena, &backup);
orig_names_of_item_list_elems= 0;
return true;
}
}
if (arena)
thd->restore_active_arena(arena, &backup);
return false;
}
/**
@brief
Restore the name of each item in the item_list of this st_select_lex
from orig_names_of_item_list_elems.
*/
void st_select_lex::restore_item_list_names()
{
if (!orig_names_of_item_list_elems)
return;
DBUG_ASSERT(item_list.elements == orig_names_of_item_list_elems->elements);
List_iterator_fast<Lex_ident_sys> it(*orig_names_of_item_list_elems);
Lex_ident_sys *new_name;
List_iterator_fast<Item> li(item_list);
Item *item;
while ((item= li++) && (new_name= it++))
lex_string_set( &item->name, new_name->str);
}
bool LEX::stmt_install_plugin(const DDL_options_st &opt,
const Lex_ident_sys_st &name,
const LEX_CSTRING &soname)