Commit 9b7c2c6b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-33220 fixup: Remove some initialization

parent e0c81654
......@@ -1383,19 +1383,20 @@ String *Item_func_regexp_replace::val_str_internal(String *str,
char buff2[MAX_FIELD_WIDTH];
String tmp0(buff0,sizeof(buff0),&my_charset_bin);
String tmp2(buff2,sizeof(buff2),&my_charset_bin);
String *source, *replace= 0;
String *source, *replace;
LEX_CSTRING src, rpl;
int startoffset= 0;
if ((null_value=
(!(source= args[0]->val_str(&tmp0)) ||
!(replace= args[2]->val_str_null_to_empty(&tmp2, null_to_empty)) ||
re.recompile(args[1]))))
return (String *) 0;
source= args[0]->val_str(&tmp0);
if (!source)
goto err;
replace= args[2]->val_str_null_to_empty(&tmp2, null_to_empty);
if (!replace || re.recompile(args[1]))
goto err;
if (!(source= re.convert_if_needed(source, &re.subject_converter)) ||
!(replace= re.convert_if_needed(replace, &re.replace_converter)))
goto err;
null_value= false;
src= source->lex_cstring();
rpl= replace->lex_cstring();
......@@ -1439,7 +1440,7 @@ String *Item_func_regexp_replace::val_str_internal(String *str,
err:
null_value= true;
return (String *) 0;
return nullptr;
}
......@@ -1583,13 +1584,21 @@ bool Item_func_insert::fix_length_and_dec()
String *Item_str_conv::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
String *res;
size_t alloced_length= 0, len;
String *res= args[0]->val_str(&tmp_value);
if ((null_value= (!(res= args[0]->val_str(&tmp_value)) ||
str->alloc((alloced_length= res->length() * multiply)))))
return 0;
if (!res)
{
err:
null_value= true;
return nullptr;
}
size_t alloced_length= res->length() * multiply, len;
if (str->alloc((alloced_length)))
goto err;
null_value= false;
len= converter(collation.collation, (char*) res->ptr(), res->length(),
(char*) str->ptr(), alloced_length);
DBUG_ASSERT(len <= alloced_length);
......
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