mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #24947: REPEAT function returns NULL when passed a field as the count parameter
Handling of large signed/unsigned values was not consistent, so some string functions could return bogus results. The current fix is to simply patch up the val_str() methods for those string items. It would be good clean this code up in general, to make similar problems much harder to make. This is left as an exercise for the reader.
This commit is contained in:
@ -991,5 +991,13 @@ SELECT CHAR(0xff,0x8f USING utf8) IS NULL;
|
||||
|
||||
SET SQL_MODE=@orig_sql_mode;
|
||||
|
||||
#
|
||||
# Bug #24947: problem with some string function with unsigned int parameters
|
||||
#
|
||||
|
||||
select substring('abc', cast(2 as unsigned int));
|
||||
select repeat('a', cast(2 as unsigned int));
|
||||
select rpad('abc', cast(5 as unsigned integer), 'x');
|
||||
select lpad('abc', cast(5 as unsigned integer), 'x');
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user