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/func_str.test | |
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/func_str.test')
-rw-r--r-- | mysql-test/t/func_str.test | 17 |
1 files changed, 17 insertions, 0 deletions
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 # |