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

Merge branch '11.1' into 11.2

This commit is contained in:
Sergei Golubchik
2023-08-17 17:27:05 +02:00
879 changed files with 12425 additions and 6297 deletions

View File

@@ -1488,7 +1488,7 @@ bool is_lex_native_function(const LEX_CSTRING *name)
bool is_native_function(THD *thd, const LEX_CSTRING *name)
{
if (find_native_function_builder(thd, name))
if (native_functions_hash.find(thd, *name))
return true;
if (is_lex_native_function(name))
@@ -2869,34 +2869,6 @@ int Lex_input_stream::scan_ident_delimited(THD *thd,
}
void trim_whitespace(CHARSET_INFO *cs, LEX_CSTRING *str, size_t * prefix_length)
{
/*
TODO:
This code assumes that there are no multi-bytes characters
that can be considered white-space.
*/
size_t plen= 0;
while ((str->length > 0) && (my_isspace(cs, str->str[0])))
{
plen++;
str->length --;
str->str ++;
}
if (prefix_length)
*prefix_length= plen;
/*
FIXME:
Also, parsing backward is not safe with multi bytes characters
*/
while ((str->length > 0) && (my_isspace(cs, str->str[str->length-1])))
{
str->length --;
}
}
/*
st_select_lex structures initialisations
*/
@@ -7463,7 +7435,7 @@ bool LEX::sp_body_finalize_routine(THD *thd)
{
if (sphead->check_unresolved_goto())
return true;
sphead->set_stmt_end(thd);
sphead->set_stmt_end(thd, thd->m_parser_state->m_lip.get_cpp_tok_start());
sphead->restore_thd_mem_root(thd);
return false;
}
@@ -9404,8 +9376,7 @@ sp_package *LEX::create_package_start(THD *thd,
bool LEX::create_package_finalize(THD *thd,
const sp_name *name,
const sp_name *name2,
const char *body_start,
const char *body_end)
const char *cpp_body_end)
{
if (name2 &&
(name2->m_explicit_name != name->m_explicit_name ||
@@ -9418,18 +9389,8 @@ bool LEX::create_package_finalize(THD *thd,
exp ? ErrConvDQName(name).ptr() : name->m_name.str);
return true;
}
// TODO: reuse code in LEX::create_package_finalize and sp_head::set_stmt_end
sphead->m_body.length= body_end - body_start;
if (unlikely(!(sphead->m_body.str= thd->strmake(body_start,
sphead->m_body.length))))
return true;
size_t not_used;
Lex_input_stream *lip= & thd->m_parser_state->m_lip;
sphead->m_defstr.length= lip->get_cpp_ptr() - lip->get_cpp_buf();
sphead->m_defstr.str= thd->strmake(lip->get_cpp_buf(), sphead->m_defstr.length);
trim_whitespace(thd->charset(), &sphead->m_defstr, &not_used);
sphead->set_stmt_end(thd, cpp_body_end);
sphead->restore_thd_mem_root(thd);
sp_package *pkg= sphead->get_package();
DBUG_ASSERT(pkg);
@@ -9643,7 +9604,7 @@ Item *LEX::make_item_func_call_native_or_parse_error(THD *thd,
Lex_ident_cli_st &name,
List<Item> *args)
{
Create_func *builder= find_native_function_builder(thd, &name);
Create_func *builder= native_functions_hash.find(thd, name);
DBUG_EXECUTE_IF("make_item_func_call_native_simulate_not_found",
builder= NULL;);
if (builder)