1
0
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:
tsmith/tim@siva.hindu.god
2006-12-19 15:54:12 -07:00
parent 3cc1a4251a
commit 2bc45899c0
3 changed files with 40 additions and 21 deletions

View File

@ -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