Commit 0214115c authored by Sergei Golubchik's avatar Sergei Golubchik

trivial cleanup

parent 03dec1aa
...@@ -3025,14 +3025,16 @@ static bool check_log_path(sys_var *self, THD *thd, set_var *var) ...@@ -3025,14 +3025,16 @@ static bool check_log_path(sys_var *self, THD *thd, set_var *var)
if (!var->save_result.string_value.str) if (!var->save_result.string_value.str)
return true; return true;
if (var->save_result.string_value.length > FN_REFLEN) LEX_STRING *val= &var->save_result.string_value;
if (val->length > FN_REFLEN)
{ // path is too long { // path is too long
my_error(ER_PATH_LENGTH, MYF(0), self->name.str); my_error(ER_PATH_LENGTH, MYF(0), self->name.str);
return true; return true;
} }
char path[FN_REFLEN]; char path[FN_REFLEN];
size_t path_length= unpack_filename(path, var->save_result.string_value.str); size_t path_length= unpack_filename(path, val->str);
if (!path_length) if (!path_length)
return true; return true;
...@@ -3046,9 +3048,9 @@ static bool check_log_path(sys_var *self, THD *thd, set_var *var) ...@@ -3046,9 +3048,9 @@ static bool check_log_path(sys_var *self, THD *thd, set_var *var)
return false; return false;
} }
(void) dirname_part(path, var->save_result.string_value.str, &path_length); (void) dirname_part(path, val->str, &path_length);
if (var->save_result.string_value.length - path_length >= FN_LEN) if (val->length - path_length >= FN_LEN)
{ // filename is too long { // filename is too long
my_error(ER_PATH_LENGTH, MYF(0), self->name.str); my_error(ER_PATH_LENGTH, MYF(0), self->name.str);
return true; return true;
......
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