Loading mysql-test/r/func_misc.result +16 −0 Original line number Diff line number Diff line Loading @@ -185,4 +185,20 @@ ERROR 21000: Operand should contain 1 column(s) drop table table_26093; drop function func_26093_a; drop function func_26093_b; SELECT NAME_CONST('test', NOW()); ERROR HY000: Incorrect arguments to NAME_CONST SELECT NAME_CONST('test', UPPER('test')); ERROR HY000: Incorrect arguments to NAME_CONST SELECT NAME_CONST('test', NULL); test NULL SELECT NAME_CONST('test', 1); test 1 SELECT NAME_CONST('test', 1.0); test 1.0 SELECT NAME_CONST('test', 'test'); test test End of 5.0 tests mysql-test/t/func_misc.test +14 −0 Original line number Diff line number Diff line Loading @@ -189,4 +189,18 @@ drop table table_26093; drop function func_26093_a; drop function func_26093_b; # # Bug #30832: Assertion + crash with select name_const('test',now()); # --error ER_WRONG_ARGUMENTS SELECT NAME_CONST('test', NOW()); --error ER_WRONG_ARGUMENTS SELECT NAME_CONST('test', UPPER('test')); SELECT NAME_CONST('test', NULL); SELECT NAME_CONST('test', 1); SELECT NAME_CONST('test', 1.0); SELECT NAME_CONST('test', 'test'); --echo End of 5.0 tests sql/item.h +2 −0 Original line number Diff line number Diff line Loading @@ -1112,6 +1112,8 @@ class Item_name_const : public Item Item_name_const(Item *name_arg, Item *val): value_item(val), name_item(name_arg) { if(!value_item->basic_const_item()) my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST"); Item::maybe_null= TRUE; } Loading Loading
mysql-test/r/func_misc.result +16 −0 Original line number Diff line number Diff line Loading @@ -185,4 +185,20 @@ ERROR 21000: Operand should contain 1 column(s) drop table table_26093; drop function func_26093_a; drop function func_26093_b; SELECT NAME_CONST('test', NOW()); ERROR HY000: Incorrect arguments to NAME_CONST SELECT NAME_CONST('test', UPPER('test')); ERROR HY000: Incorrect arguments to NAME_CONST SELECT NAME_CONST('test', NULL); test NULL SELECT NAME_CONST('test', 1); test 1 SELECT NAME_CONST('test', 1.0); test 1.0 SELECT NAME_CONST('test', 'test'); test test End of 5.0 tests
mysql-test/t/func_misc.test +14 −0 Original line number Diff line number Diff line Loading @@ -189,4 +189,18 @@ drop table table_26093; drop function func_26093_a; drop function func_26093_b; # # Bug #30832: Assertion + crash with select name_const('test',now()); # --error ER_WRONG_ARGUMENTS SELECT NAME_CONST('test', NOW()); --error ER_WRONG_ARGUMENTS SELECT NAME_CONST('test', UPPER('test')); SELECT NAME_CONST('test', NULL); SELECT NAME_CONST('test', 1); SELECT NAME_CONST('test', 1.0); SELECT NAME_CONST('test', 'test'); --echo End of 5.0 tests
sql/item.h +2 −0 Original line number Diff line number Diff line Loading @@ -1112,6 +1112,8 @@ class Item_name_const : public Item Item_name_const(Item *name_arg, Item *val): value_item(val), name_item(name_arg) { if(!value_item->basic_const_item()) my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST"); Item::maybe_null= TRUE; } Loading