diff options
author | Michael Widenius <monty@askmonty.org> | 2011-02-28 13:16:17 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-02-28 13:16:17 +0200 |
commit | 869f5d0e81d5cbecaec3605f292fbb363b9ccbf6 (patch) | |
tree | 9e2bc4700a2db961d967e53f00c941f3ee501173 /sql/set_var.cc | |
parent | cfa0c6ff1d8f7268f895d79daf94e7d29197327d (diff) | |
parent | ff3da0f963b28d128005da8ca5d0c93a72d34b27 (diff) | |
download | mariadb-git-869f5d0e81d5cbecaec3605f292fbb363b9ccbf6.tar.gz |
Merge with alias as String
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 910deafc432..9917ba9bfe3 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -975,7 +975,7 @@ bool sys_var_str::check(THD *thd, set_var *var) if ((res=(*check_func)(thd, var)) < 0) my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), - name, var->value->str_value.ptr()); + name, var->value->str_value.c_ptr()); return res; } @@ -2266,11 +2266,15 @@ bool sys_var_character_set::check(THD *thd, set_var *var) } tmp= NULL; } - else if (!(tmp=get_charset_by_csname(res->c_ptr(),MY_CS_PRIMARY,MYF(0))) && - !(tmp=get_old_charset_by_name(res->c_ptr()))) + else { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), res->c_ptr()); - return 1; + const char *name= res->c_ptr_safe(); + if (!(tmp=get_charset_by_csname(name,MY_CS_PRIMARY,MYF(0))) && + !(tmp=get_old_charset_by_name(name))) + { + my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), name); + return 1; + } } } else // INT_RESULT @@ -2607,7 +2611,7 @@ static int sys_check_log_path(THD *thd, set_var *var) if (!(res= var->value->val_str(&str))) goto err; - log_file_str= res->c_ptr(); + log_file_str= res->c_ptr_safe(); bzero(&f_stat, sizeof(MY_STAT)); path_length= unpack_filename(path, log_file_str); @@ -3070,7 +3074,7 @@ bool sys_var_thd_lc_time_names::check(THD *thd, set_var *var) my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); return 1; } - const char *locale_str= res->c_ptr(); + const char *locale_str= res->c_ptr_safe(); if (!(locale_match= my_locale_by_name(locale_str))) { my_printf_error(ER_UNKNOWN_ERROR, @@ -4102,7 +4106,7 @@ bool sys_var_thd_optimizer_switch::check(THD *thd, set_var *var) optimizer_switch_typelib.count, thd->variables.optimizer_switch, global_system_variables.optimizer_switch, - res->c_ptr_safe(), res->length(), NULL, + res->ptr(), res->length(), NULL, &error, &error_len, ¬_used); if (error_len) { |