summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index f31fe6a351d..8e48e0213f0 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -117,7 +117,8 @@ void sys_var_end()
sys_var constructor
@param chain variables are linked into chain for mysql_add_sys_var_chain()
- @param name_arg the name of the variable. @sa my_option::name
+ @param name_arg the name of the variable. Must be 0-terminated and exist
+ for the liftime of the sys_var object. @sa my_option::name
@param comment shown in mysqld --help, @sa my_option::comment
@param flags_arg or'ed flag_enum values
@param off offset of the global variable value from the
@@ -164,8 +165,8 @@ sys_var::sys_var(sys_var_chain *chain, const char *name_arg,
*/
DBUG_ASSERT(parse_flag == PARSE_NORMAL || getopt_id <= 0 || getopt_id >= 255);
- name.str= name_arg;
- name.length= strlen(name_arg);
+ name.str= name_arg; // ER_NO_DEFAULT relies on 0-termination of name_arg
+ name.length= strlen(name_arg); // and so does this.
DBUG_ASSERT(name.length <= NAME_CHAR_LEN);
bzero(&option, sizeof(option));