Bug #31006 problem of concat() and concat_ws() with german "Umlaute" and int fields
| Submitted: | 13 Sep 2007 20:08 | Modified: | 15 Oct 2007 8:40 |
|---|---|---|---|
| Reporter: | Helmut Zeilinger | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: Data Types | Severity: | S3 (Non-critical) |
| Version: | 5.0.44 Gentoo Linux mysql-5.0.44-r1 | OS: | Linux (2.6.21-gentoo-r4) |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
| Tags: | character set, concatenation, Latin1, type conversion, Unicode | ||
[13 Sep 2007 20:08]
Helmut Zeilinger
[14 Sep 2007 14:17]
MySQL Verification Team
Thank you for the bug report.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.50-debug Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE TABLE `test_table` (
-> `pk` int(11) default NULL,
-> `name` varchar(100) default NULL
-> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.03 sec)
mysql> insert into test_table values (1,'ä');
Query OK, 1 row affected (0.00 sec)
mysql> insert into test_table values (1,'a');
Query OK, 1 row affected (0.00 sec)
mysql> select pk, name, concat(pk,name) from test_table;
+------+------+-----------------+
| pk | name | concat(pk,name) |
+------+------+-----------------+
| 1 | ä | 1ä |
| 1 | a | 1a |
+------+------+-----------------+
2 rows in set (0.00 sec)
mysql>
[15 Oct 2007 8:40]
Alexander Barkov
This problem is a duplicate of http://bugs.mysql.com/bug.php?id=8204 As a workaround you need to use explicit conversion from number to char(): mysql> select pk, name, concat(pk,name), concat((cast(pk as char)),name) from test_table; +------+------+-----------------+---------------------------------+ | pk | name | concat(pk,name) | concat((cast(pk as char)),name) | +------+------+-----------------+---------------------------------+ | 1 | ä | 1ä | 1ä | | 1 | a | 1a | 1a | +------+------+-----------------+---------------------------------+ 2 rows in set (0.00 sec) Marking this bug as duplicate to 8204.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.