diff options
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r-- | mysql-test/t/func_str.test | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 66b9eabd385..032c9ade643 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1318,3 +1318,45 @@ insert into t1 values (-1),(null); explain select 1 as a from t1,(select decode(f1,f1) as b from t1) a; explain select 1 as a from t1,(select encode(f1,f1) as b from t1) a; drop table t1; + + + +--echo Start of 5.4 tests +# +# WL#4584 Internationalized number format +# +SELECT format(12345678901234567890.123, 3); +SELECT format(12345678901234567890.123, 3, NULL); +SELECT format(12345678901234567890.123, 3, 'ar_AE'); +SELECT format(12345678901234567890.123, 3, 'ar_SA'); +SELECT format(12345678901234567890.123, 3, 'be_BY'); +SELECT format(12345678901234567890.123, 3, 'de_DE'); +SELECT format(12345678901234567890.123, 3, 'en_IN'); +SELECT format(12345678901234567890.123, 3, 'en_US'); +SELECT format(12345678901234567890.123, 3, 'it_CH'); +SELECT format(12345678901234567890.123, 3, 'ru_RU'); +SELECT format(12345678901234567890.123, 3, 'ta_IN'); + +CREATE TABLE t1 (fmt CHAR(5) NOT NULL); +INSERT INTO t1 VALUES ('ar_AE'); +INSERT INTO t1 VALUES ('ar_SA'); +INSERT INTO t1 VALUES ('be_BY'); +INSERT INTO t1 VALUES ('de_DE'); +INSERT INTO t1 VALUES ('en_IN'); +INSERT INTO t1 VALUES ('en_US'); +INSERT INTO t1 VALUES ('it_CH'); +INSERT INTO t1 VALUES ('ru_RU'); +INSERT INTO t1 VALUES ('ta_IN'); +SELECT fmt, format(12345678901234567890.123, 3, fmt) FROM t1 ORDER BY fmt; +SELECT fmt, format(12345678901234567890.123, 0, fmt) FROM t1 ORDER BY fmt; +SELECT fmt, format(12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +SELECT fmt, format(-12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +SELECT fmt, format(-02345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +SELECT fmt, format(-00345678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +SELECT fmt, format(-00045678901234567890, 3, fmt) FROM t1 ORDER BY fmt; +DROP TABLE t1; + +SELECT format(123, 1, 'Non-existent-locale'); + +--echo End of 5.4 tests + |