diff options
author | Alexander Barkov <bar@mysql.com> | 2010-08-20 15:14:11 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mysql.com> | 2010-08-20 15:14:11 +0400 |
commit | 84ee0a9fa40f13eaeec66ce2c9d3b8dcf2b9c67d (patch) | |
tree | 898cfdb055d0628299db2ec24858e41d693242ee /mysql-test/t | |
parent | 02863b41804352f1371407ccdc9e1cb51b9e20e3 (diff) | |
download | mariadb-git-84ee0a9fa40f13eaeec66ce2c9d3b8dcf2b9c67d.tar.gz |
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.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/ctype_utf32.test | 9 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 17 |
2 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test index 51a28627daa..668b3b033bd 100644 --- a/mysql-test/t/ctype_utf32.test +++ b/mysql-test/t/ctype_utf32.test @@ -810,5 +810,14 @@ SELECT * FROM t1; DROP TABLE t1; --echo # +--echo # Bug#55912 FORMAT with locale set fails for numbers < 1000 +--echo # +SET collation_connection=utf32_general_ci; +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 # diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 10d35b16315..7b7bffd0bbc 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -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 # |