mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #30832: Assertion + crash with select name_const('test', now());
The NAME_CONST function is required to work correctly with constants only. When executed with functions that return types other than those returned by Item::field_type (string, int, decimal, or real), the result gets cast to one of those types. This cannot happen for constants. Fixed by only allowing constants as arguments to NAME_CONST.
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user