Commit 8698db63 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 f65ce2ad
...@@ -447,7 +447,9 @@ get_server_from_table_to_cache(TABLE *table) ...@@ -447,7 +447,9 @@ get_server_from_table_to_cache(TABLE *table)
if (vt != JSV_STRING) if (vt != JSV_STRING)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
Lex_cstring name= {keyname, keyname_end}, value= {v, v + v_len}; Lex_cstring name= {keyname, keyname_end}, value= {v, v + v_len};
engine_option_value *option= new (&mem) engine_option_value(name, value, true); engine_option_value *option= new (&mem) engine_option_value(
engine_option_value::Name(safe_lexcstrdup_root(&mem, name)),
engine_option_value::Value(safe_lexcstrdup_root(&mem, value)), true);
option->link(&server->option_list, &option_list_last); option->link(&server->option_list, &option_list_last);
} }
engine_option_value *option= server->option_list; engine_option_value *option= server->option_list;
...@@ -1252,8 +1254,10 @@ static void copy_option_list(MEM_ROOT *mem, FOREIGN_SERVER *server, ...@@ -1252,8 +1254,10 @@ static void copy_option_list(MEM_ROOT *mem, FOREIGN_SERVER *server,
option= option->next) option= option->next)
{ {
engine_option_value *new_option= new (mem) engine_option_value(option); engine_option_value *new_option= new (mem) engine_option_value(option);
new_option->name= safe_lexcstrdup_root(mem, option->name); new_option->name= engine_option_value::Name(
new_option->value= safe_lexcstrdup_root(mem, option->value); 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); new_option->link(&server->option_list, &option_list_last);
} }
} }
......
...@@ -2900,7 +2900,11 @@ server_option: ...@@ -2900,7 +2900,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.username.str == 0); MYSQL_YYABORT_UNLESS(Lex->server_options.username.str == 0);
Lex->server_options.username= $2; Lex->server_options.username= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2909,7 +2913,11 @@ server_option: ...@@ -2909,7 +2913,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.host.str == 0); MYSQL_YYABORT_UNLESS(Lex->server_options.host.str == 0);
Lex->server_options.host= $2; Lex->server_options.host= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2918,7 +2926,11 @@ server_option: ...@@ -2918,7 +2926,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.db.str == 0); MYSQL_YYABORT_UNLESS(Lex->server_options.db.str == 0);
Lex->server_options.db= $2; Lex->server_options.db= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2927,7 +2939,11 @@ server_option: ...@@ -2927,7 +2939,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.owner.str == 0); MYSQL_YYABORT_UNLESS(Lex->server_options.owner.str == 0);
Lex->server_options.owner= $2; Lex->server_options.owner= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2936,7 +2952,11 @@ server_option: ...@@ -2936,7 +2952,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.password.str == 0); MYSQL_YYABORT_UNLESS(Lex->server_options.password.str == 0);
Lex->server_options.password= $2; Lex->server_options.password= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2945,7 +2965,11 @@ server_option: ...@@ -2945,7 +2965,11 @@ server_option:
MYSQL_YYABORT_UNLESS(Lex->server_options.socket.str == 0); MYSQL_YYABORT_UNLESS(Lex->server_options.socket.str == 0);
Lex->server_options.socket= $2; Lex->server_options.socket= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2953,7 +2977,10 @@ server_option: ...@@ -2953,7 +2977,10 @@ server_option:
{ {
Lex->server_options.port= $2; Lex->server_options.port= $2;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
...@@ -2971,14 +2998,22 @@ server_option: ...@@ -2971,14 +2998,22 @@ server_option:
} }
Lex->server_options.port= (long) p; Lex->server_options.port= (long) p;
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &Lex->option_list_last);
} }
| IDENT_sys TEXT_STRING_sys | IDENT_sys TEXT_STRING_sys
{ {
engine_option_value *new_option= 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, new_option->link(&Lex->server_options.option_list,
&Lex->option_list_last); &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