Bug #21583 | Federated table returns broken strings. | ||
---|---|---|---|
Submitted: | 11 Aug 2006 13:33 | Modified: | 29 Feb 2008 12:10 |
Reporter: | Tetsuro Ikeda | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Federated storage engine | Severity: | S3 (Non-critical) |
Version: | 5.0.24/5.0BK | OS: | Linux (Linux) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[11 Aug 2006 13:33]
Tetsuro Ikeda
[11 Aug 2006 13:34]
Tetsuro Ikeda
suggested patch for this report
Attachment: federated-charset.patch (application/octet-stream, text), 694 bytes.
[14 Aug 2006 18:31]
MySQL Verification Team
Thank you for the bug report and patch suggestion. mysql> CREATE TABLE t_local (c1 VARCHAR(20)) DEFAULT CHARSET utf8 ENGINE = Federated connection='mysql://foo:bar@192.168.0.119:3306/test/t_remote'; Query OK, 0 rows affected (0.11 sec) mysql> SELECT c1 FROM t_local; +------+ | c1 | +------+ | ??? | +------+ 1 row in set (0.05 sec) mysql>
[20 Sep 2006 17:26]
Gleb Paharenko
I'd like to add that inserts don't work in similar way. Say, we have a table on remote server mysql> show create table tcp\G; *************************** 1. row *************************** Table: tcp Create Table: CREATE TABLE `tcp` ( `a` varchar(60) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=cp1251 1 row in set (0.00 sec) On the local server we have: mysql> show create table tcp\G; *************************** 1. row *************************** Table: tcp Create Table: CREATE TABLE `tcp` ( `a` varchar(60) default NULL ) ENGINE=FEDERATED DEFAULT CHARSET=cp1251 CONNECTION='mysql://g:*****@p.dev.mtx.kiev.ua:3306/test/tcp' On all servers: mysql> show variables like '%char%'; +--------------------------+----------------------------------+ | Variable_name | Value | +--------------------------+----------------------------------+ | character_set_client | cp1251 | | character_set_connection | cp1251 | | character_set_database | cp1251 | | character_set_filesystem | binary | | character_set_results | cp1251 | | character_set_server | cp1251 | | character_set_system | utf8 | | character_sets_dir | /usr/local/share/mysql/charsets/ | +--------------------------+----------------------------------+ Operating system is FreeBSD. SQL query file: aby.sql [root@newgleb rezina]# cat /tmp/aby.sql |iconv -f cp1251 -t utf8 insert into tcp1 set a='абу'; This command mysql test </tmp/aby.sql produces ??? in remote table, in case local server was compiled without with_charset=cp1251, and produces 'абу' when local server was compiled with_charset=cp1251 Please, fix this.
[29 Feb 2008 12:10]
Ramil Kalimullin
See bug #17044: FEDERATED storage engine is not UTF8 clean
[23 Mar 2008 16:33]
Patrick Galbraith
I have a fix for FederatedX storage engine using your patch, with some changes: On remotedb, port 3307: mysql> CREATE TABLE t_remote (c1 VARCHAR(20)) DEFAULT CHARSET utf8; Query OK, 0 rows affected (0.27 sec) mysql> INSERT INTO t_remote VALUES ("あああ"); Query OK, 1 row affected (0.00 sec) mysql> select * from t_remote; +-----------+ | c1 | +-----------+ | あああ | +-----------+ 1 row in set (0.00 sec) mysql> CREATE TABLE t_local (c1 VARCHAR(20)) DEFAULT CHARSET utf8 ENGINE=FEDERATEDX connection='mysql://root@localhost:3307/remotedb/t_remote'; Query OK, 0 rows affected (0.06 sec) mysql> select * from t_local; +-----------+ | c1 | +-----------+ | あああ | +-----------+ 1 row in set (0.00 sec)
[23 Mar 2008 16:38]
Patrick Galbraith
Might I also add: insert to federatedx table (I took Japanese chars from slashdot.jp): mysql> insert into t_local values ("がどこまで巧"); Query OK, 1 row affected (0.00 sec) mysql> select * from t_local; +--------------------+ | c1 | +--------------------+ | あああ | | がどこまで巧 | +--------------------+ 2 rows in set (0.00 sec) Check on remote table: mysql> select * from t_remote; +--------------------+ | c1 | +--------------------+ | あああ | | がどこまで巧 | +--------------------+ 2 rows in set (0.00 sec)