1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -1916,4 +1916,16 @@ CHAR(0xff,0x8f USING utf8) IS NULL
Warnings:
Error 1300 Invalid utf8 character string: 'FF8F'
SET SQL_MODE=@orig_sql_mode;
select substring('abc', cast(2 as unsigned int));
substring('abc', cast(2 as unsigned int))
bc
select repeat('a', cast(2 as unsigned int));
repeat('a', cast(2 as unsigned int))
aa
select rpad('abc', cast(5 as unsigned integer), 'x');
rpad('abc', cast(5 as unsigned integer), 'x')
abcxx
select lpad('abc', cast(5 as unsigned integer), 'x');
lpad('abc', cast(5 as unsigned integer), 'x')
xxabc
End of 5.0 tests