mirror of
https://github.com/MariaDB/server.git
synced 2026-05-02 21:25:36 +02:00
func_str.result, func_str.test:
Adding test case. item_strfunc.cc: bug#11728 string function LEFT, strange undocumented behaviour Fixing LEFT and RIGHT return NULL if the second argument is NULL. sql/item_strfunc.cc: bug#11728 string function LEFT, strange undocumented behaviour Fixing LEFT and RIGHT return NULL if the second argument is NULL. mysql-test/t/func_str.test: Adding test case. mysql-test/r/func_str.result: Adding test case.
This commit is contained in:
parent
0b399f1d3f
commit
613cbb621e
3 changed files with 10 additions and 2 deletions
|
|
@ -1038,7 +1038,7 @@ String *Item_func_left::val_str(String *str)
|
|||
long length =(long) args[1]->val_int();
|
||||
uint char_pos;
|
||||
|
||||
if ((null_value=args[0]->null_value))
|
||||
if ((null_value=(args[0]->null_value || args[1]->null_value)))
|
||||
return 0;
|
||||
if (length <= 0)
|
||||
return &my_empty_string;
|
||||
|
|
@ -1078,7 +1078,7 @@ String *Item_func_right::val_str(String *str)
|
|||
String *res =args[0]->val_str(str);
|
||||
long length =(long) args[1]->val_int();
|
||||
|
||||
if ((null_value=args[0]->null_value))
|
||||
if ((null_value=(args[0]->null_value || args[1]->null_value)))
|
||||
return 0; /* purecov: inspected */
|
||||
if (length <= 0)
|
||||
return &my_empty_string; /* purecov: inspected */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue