Commit a462f34a authored by unknown's avatar unknown

Bug#30832:Assertion + crash with select name_const('test',now());

Completion of previous patch. Negative number were denied
as the second argument to NAME_CONST.


mysql-test/r/func_misc.result:
  Bug#30832 completion: test result
mysql-test/t/func_misc.test:
  Bug#30832 completion: test case
  added negative numbers
sql/item_func.h:
  Bug#30832 completion
  The function that represents unary minus is considered a constant if the argument is.
parent 554d405d
......@@ -195,9 +195,15 @@ NULL
SELECT NAME_CONST('test', 1);
test
1
SELECT NAME_CONST('test', -1);
test
-1
SELECT NAME_CONST('test', 1.0);
test
1.0
SELECT NAME_CONST('test', -1.0);
test
-1.0
SELECT NAME_CONST('test', 'test');
test
test
......
......@@ -199,7 +199,9 @@ SELECT NAME_CONST('test', UPPER('test'));
SELECT NAME_CONST('test', NULL);
SELECT NAME_CONST('test', 1);
SELECT NAME_CONST('test', -1);
SELECT NAME_CONST('test', 1.0);
SELECT NAME_CONST('test', -1.0);
SELECT NAME_CONST('test', 'test');
--echo End of 5.0 tests
......
......@@ -435,6 +435,7 @@ public:
longlong int_op();
my_decimal *decimal_op(my_decimal *);
const char *func_name() const { return "-"; }
virtual bool basic_const_item() const { return args[0]->basic_const_item(); }
void fix_length_and_dec();
void fix_num_length_and_dec();
uint decimal_precision() const { return args[0]->decimal_precision(); }
......
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