Commit be688ecb authored by Yuchen Pei's avatar Yuchen Pei

MDEV-34716 [to-squash] 11.6 fixup caused by MDEV-31340

To be squashed with the top MDEV-34716 commit
parent b497bf16
......@@ -454,7 +454,8 @@ get_server_from_table_to_cache(TABLE *table)
name_copy= safe_lexcstrdup_root(&mem, name),
value_copy= safe_lexcstrdup_root(&mem, value);
engine_option_value *option= new (&mem) engine_option_value(
name_copy, value_copy, true);
engine_option_value::Name(name_copy),
engine_option_value::Value(value_copy), true);
option->link(&server->option_list, &option_list_last);
if (option->value.length)
{
......@@ -1254,8 +1255,10 @@ static void copy_option_list(MEM_ROOT *mem, FOREIGN_SERVER *server,
option= option->next)
{
engine_option_value *new_option= new (mem) engine_option_value(option);
new_option->name= safe_lexcstrdup_root(mem, option->name);
new_option->value= safe_lexcstrdup_root(mem, option->value);
new_option->name= engine_option_value::Name(
safe_lexcstrdup_root(mem, option->name));
new_option->value= engine_option_value::Value(
safe_lexcstrdup_root(mem, option->value));
new_option->link(&server->option_list, &option_list_last);
}
}
......
......@@ -2900,7 +2900,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.username.str == 0);
Lex->server_options.username= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2909,7 +2913,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.host.str == 0);
Lex->server_options.host= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2918,7 +2926,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.db.str == 0);
Lex->server_options.db= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2927,7 +2939,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.owner.str == 0);
Lex->server_options.owner= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2936,7 +2952,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.password.str == 0);
Lex->server_options.password= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2945,7 +2965,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.socket.str == 0);
Lex->server_options.socket= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2953,7 +2977,10 @@ server_option:
{
Lex->server_options.port= $2;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, thd->mem_root);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
$2, thd->mem_root);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......@@ -2971,14 +2998,22 @@ server_option:
}
Lex->server_options.port= (long) p;
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
| IDENT_sys TEXT_STRING_sys
{
engine_option_value *new_option=
new (thd->mem_root) engine_option_value($1, $2, true);
new (thd->mem_root) engine_option_value(
engine_option_value::Name(
safe_lexcstrdup_root(thd->mem_root, $1)),
engine_option_value::Value(
safe_lexcstrdup_root(thd->mem_root, $2)), true);
new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment