mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #28550 "Potential bugs related to the return type of the CHAR function".
Since, as of MySQL 5.0.15, CHAR() arguments larger than 255 are converted into multiple result bytes, a single CHAR() argument can now take up to 4 bytes. This patch fixes Item_func_char::fix_length_and_dec() to take this into account. This patch also fixes a regression introduced by the patch for bug21513. As now we do not always have the 'name' member of Item set for Item_hex_string and Item_bin_string, an own print() method has been added to Item_hex_string so that it could correctly be printed by Item_func::print_args().
This commit is contained in:
@ -726,7 +726,7 @@ t1 CREATE TABLE `t1` (
|
||||
`oct(130)` varchar(64) NOT NULL default '',
|
||||
`conv(130,16,10)` varchar(64) NOT NULL default '',
|
||||
`hex(130)` varchar(6) NOT NULL default '',
|
||||
`char(130)` varbinary(1) NOT NULL default '',
|
||||
`char(130)` varbinary(4) NOT NULL default '',
|
||||
`format(130,10)` varchar(4) NOT NULL default '',
|
||||
`left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
|
||||
`right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '',
|
||||
@ -2153,4 +2153,14 @@ SUBSTR(a,1,len)
|
||||
ba
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 AS SELECT CHAR(0x414243) as c1;
|
||||
SELECT HEX(c1) from t1;
|
||||
HEX(c1)
|
||||
414243
|
||||
DROP TABLE t1;
|
||||
CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1;
|
||||
SELECT HEX(c1) from v1;
|
||||
HEX(c1)
|
||||
414243
|
||||
DROP VIEW v1;
|
||||
End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user