mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#55912 FORMAT with locale set fails for numbers < 1000
Problems: - dot character was always printed as decimal point instead of localized decimal point for short numbers without thousands - Item_func_format::val_str always returned values in ASCII format, regargless of @@character_set_connection, which in case of utf32 led to crash in debug build, or to incorrect values in release build. Fix: - Adding a piece of code to replace dot character to localized decimal point in short numbers. - Changing parent class for Item_func_format to Item_str_ascii_func, because its val_str() implementation is heavily ASCII oriented.
This commit is contained in:
@ -1404,3 +1404,20 @@ SELECT format(123, 1, 'Non-existent-locale');
|
||||
|
||||
--echo End of 5.4 tests
|
||||
|
||||
--echo #
|
||||
--echo # Start of 5.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Bug#55912 FORMAT with locale set fails for numbers < 1000
|
||||
--echo #
|
||||
SELECT FORMAT(123.33, 2, 'no_NO'), FORMAT(1123.33, 2, 'no_NO');
|
||||
SELECT FORMAT(12333e-2, 2, 'no_NO'), FORMAT(112333e-2, 2, 'no_NO');
|
||||
CREATE TABLE t1 AS SELECT format(123,2,'no_NO');
|
||||
SHOW CREATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user