diff options
| author | Sergei Golubchik <serg@mariadb.org> | 2021-10-09 16:00:13 +0200 |
|---|---|---|
| committer | Sergei Golubchik <serg@mariadb.org> | 2021-10-12 13:28:10 +0200 |
| commit | 57bf8c1f35158c3bc22b343816ffe7e76af163d8 (patch) | |
| tree | 9290b11af6c31fb8f9837b7bdce94d9be1b0c3a1 /mysql-test/main/func_sformat.test | |
| parent | 6a7c10de92e913c1c9fddbf8ed34693e7d682661 (diff) | |
| download | mariadb-git-57bf8c1f35158c3bc22b343816ffe7e76af163d8.tar.gz | |
MDEV-26646 SFORMAT Does not allow @variable use
If charset aggregation decides to convert arguments to some specific
charset and some arguments are numbers, they'll be wrapped into a
Item_func_conv_charset(), that changes result_type() to STRING_RESULT.
Fix: don't convert numbers, sformat needs their numerical value only.
Diffstat (limited to 'mysql-test/main/func_sformat.test')
| -rw-r--r-- | mysql-test/main/func_sformat.test | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mysql-test/main/func_sformat.test b/mysql-test/main/func_sformat.test index 36b755acae5..7c850fc2644 100644 --- a/mysql-test/main/func_sformat.test +++ b/mysql-test/main/func_sformat.test @@ -199,7 +199,7 @@ select hex(sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442')); create table t1 as select sformat(_ucs2 x'003D007B007D003D', _ucs2 x'0442043504410442') as x; show create table t1; drop table t1; - +set names latin1; echo #; echo # ps parameters; @@ -213,3 +213,16 @@ echo # MDEV-26691 SFORMAT: Pass down FLOAT as FLOAT, without upcast to DOUBLE; echo #; select sformat('{}', cast(1.1 as float)); + +echo #; +echo # MDEV-26646 SFORMAT Does not allow @variable use; +echo #; + +set names utf8; +set @a=3.14; +select sformat('{:f}', @a); +set names latin1; + +echo #; +echo # End of 10.7 tests; +echo #; |
