1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Bug#18691: Converting number to UNICODE string returns invalid result.

Conversion from int and real numbers to UCS2 didn't work fine: 
CONVERT(100, CHAR(50) UNICODE)
CONVERT(103.9, CHAR(50) UNICODE)

The problem appeared because numbers have binary charset, so,
simple charset recast binary->ucs2 was performed
instead of real conversion.

Fixed to make numbers pretend to be non-binary.
This commit is contained in:
bar@mysql.com
2006-04-13 10:55:48 +05:00
parent 76a122d0c3
commit 45293fc346
4 changed files with 44 additions and 6 deletions

View File

@@ -666,6 +666,18 @@ Warnings:
Warning 1265 Data truncated for column 'Field1' at row 1
DROP TABLE t1;
SET NAMES latin1;
SELECT CONVERT(103, CHAR(50) UNICODE);
CONVERT(103, CHAR(50) UNICODE)
103
SELECT CONVERT(103.0, CHAR(50) UNICODE);
CONVERT(103.0, CHAR(50) UNICODE)
103.0
SELECT CONVERT(-103, CHAR(50) UNICODE);
CONVERT(-103, CHAR(50) UNICODE)
-103
SELECT CONVERT(-103.0, CHAR(50) UNICODE);
CONVERT(-103.0, CHAR(50) UNICODE)
-103.0
CREATE TABLE t1 (
a varchar(255) NOT NULL default '',
KEY a (a)