summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_str.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mysql.com>2010-08-20 15:14:11 +0400
committerAlexander Barkov <bar@mysql.com>2010-08-20 15:14:11 +0400
commit84ee0a9fa40f13eaeec66ce2c9d3b8dcf2b9c67d (patch)
tree898cfdb055d0628299db2ec24858e41d693242ee /mysql-test/r/func_str.result
parent02863b41804352f1371407ccdc9e1cb51b9e20e3 (diff)
downloadmariadb-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/r/func_str.result')
-rw-r--r--mysql-test/r/func_str.result25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 7539cf43dd9..f01d46a9f41 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -2734,3 +2734,28 @@ format(123, 1, 'Non-existent-locale')
Warnings:
Warning 1649 Unknown locale: 'Non-existent-locale'
End of 5.4 tests
+#
+# Start of 5.5 tests
+#
+#
+# Bug#55912 FORMAT with locale set fails for numbers < 1000
+#
+SELECT FORMAT(123.33, 2, 'no_NO'), FORMAT(1123.33, 2, 'no_NO');
+FORMAT(123.33, 2, 'no_NO') FORMAT(1123.33, 2, 'no_NO')
+123,33 1.123,33
+SELECT FORMAT(12333e-2, 2, 'no_NO'), FORMAT(112333e-2, 2, 'no_NO');
+FORMAT(12333e-2, 2, 'no_NO') FORMAT(112333e-2, 2, 'no_NO')
+123,33 1.123,33
+CREATE TABLE t1 AS SELECT format(123,2,'no_NO');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `format(123,2,'no_NO')` varchar(37) NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+format(123,2,'no_NO')
+123,00
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#