Commit 99ac9678 authored by unknown's avatar unknown

a fix (#11235: Expression with IFNULL yields 18 where 1 is correct).


sql/item_func.cc:
  a fix (#11235: Expression with IFNULL yields 18 where 1 is correct).
  We should pass res end pointer to the strtoll10().
parent 7708229d
...@@ -879,11 +879,11 @@ longlong Item_func_numhybrid::val_int() ...@@ -879,11 +879,11 @@ longlong Item_func_numhybrid::val_int()
return (longlong)real_op(); return (longlong)real_op();
case STRING_RESULT: case STRING_RESULT:
{ {
char *end_not_used;
int err_not_used; int err_not_used;
String *res= str_op(&str_value); String *res= str_op(&str_value);
char *end= (char*) res->ptr() + res->length();
CHARSET_INFO *cs= str_value.charset(); CHARSET_INFO *cs= str_value.charset();
return (res ? (*(cs->cset->strtoll10))(cs, res->ptr(), &end_not_used, return (res ? (*(cs->cset->strtoll10))(cs, res->ptr(), &end,
&err_not_used) : 0); &err_not_used) : 0);
} }
default: default:
......
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