Bug #21556 federated table - charset=euckr
Submitted: 10 Aug 2006 2:26 Modified: 3 Jan 2007 11:40
Reporter: JongSe Park Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Federated storage engine Severity:S2 (Serious)
Version:max-5.0.22 OS:Solaris (solaris 10)
Assigned to: Bugs System CPU Architecture:Any
Tags: charset=euckr, federated table

[10 Aug 2006 2:26] JongSe Park
Description:
federate table didn't support characterset euckr. when servers reconnect between source data and remote data. it didn't display clearly the results of select statements.

server A
CREATE TABLE `test_table2` (
  `id` int(20) NOT NULL auto_increment,
  `name` varchar(32) NOT NULL default '',
  `other` int(20) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `name` (`name`),
  KEY `other_key` (`other`)
) ENGINE=MyISAM DEFAULT CHARSET=euckr

server B
CREATE TABLE `federated_table2` (
  `id` int(20) NOT NULL auto_increment,
  `name` varchar(32) NOT NULL default '',
  `other` int(20) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `name` (`name`),
  KEY `other_key` (`other`)
) ENGINE=FEDERATED DEFAULT CHARSET=euckr CONNECTION='mysql://root@localhost:3311/test/test_table2'

server A
shutdown 
# ./mysqladmin -uroot -S /Test/mysql-max-5.0.22/tmp/mysql.sock shutdown 
STOPPING server from pid file /Test/mysql-max-5.0.22/data/shinip.pid
060810 09:54:26  mysqld ended

restart
# ./bin/mysqld_safe --user=mysql &
[1] 19065
# Starting mysqld daemon with databases from /Test/mysql-max-5.0.22/data

server B
mysql> select * from federated_table2;
+----+------+-------+
| id | name | other |
+----+------+-------+
|  1 | ???  |    35 | 
|  2 | ???  |    32 | 
|  3 | ???  |    32 | 
+----+------+-------+
3 rows in set (0.01 sec)

mysql> flush tables;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from federated_table2;
+----+--------+-------+
| id | name   | other |
+----+--------+-------+
|  1 | 권대성 |    35 | 
|  2 | 박재만 |    32 | 
|  3 | 이용성 |    32 | 
+----+--------+-------+
3 rows in set (0.01 sec)

I don't know reason that this result happened
could anyone tell me the reason? please!!!

How to repeat:
server A
CREATE TABLE `test_table2` (
  `id` int(20) NOT NULL auto_increment,
  `name` varchar(32) NOT NULL default '',
  `other` int(20) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `name` (`name`),
  KEY `other_key` (`other`)
) ENGINE=MyISAM DEFAULT CHARSET=euckr

insert into test_table2 (name,other) values ('권대성','35');
insert into test_table2 (name,other) values ('박재만','32');
insert into test_table2 (name,other) values ('이용성','32');

server B
CREATE TABLE `federated_table2` (
  `id` int(20) NOT NULL auto_increment,
  `name` varchar(32) NOT NULL default '',
  `other` int(20) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `name` (`name`),
  KEY `other_key` (`other`)
) ENGINE=FEDERATED DEFAULT CHARSET=euckr CONNECTION='mysql://root@localhost:3311/test/test_table2'

server A
shutdown 
# ./mysqladmin -uroot -S /Test/mysql-max-5.0.22/tmp/mysql.sock shutdown 
STOPPING server from pid file /Test/mysql-max-5.0.22/data/shinip.pid
060810 09:54:26  mysqld ended

restart
# ./bin/mysqld_safe --user=mysql &
[1] 19065
# Starting mysqld daemon with databases from /Test/mysql-max-5.0.22/data

server B
mysql> select * from federated_table2;
+----+------+-------+
| id | name | other |
+----+------+-------+
|  1 | ???  |    35 | 
|  2 | ???  |    32 | 
|  3 | ???  |    32 | 
+----+------+-------+
3 rows in set (0.01 sec)

mysql> flush tables;
Query OK, 0 rows affected (0.00 sec)

mysql> select * from federated_table2;
+----+--------+-------+
| id | name   | other |
+----+--------+-------+
|  1 | 권대성 |    35 | 
|  2 | 박재만 |    32 | 
|  3 | 이용성 |    32 | 
+----+--------+-------+
3 rows in set (0.01 sec)
[10 Aug 2006 13:56] Miguel Solorzano
Thank you for the bug report.
[4 Oct 2006 2:50] Patrick Galbraith
related to bug# 17044. I have committed a patch for 17044 which is patch pending status.
[27 Oct 2006 15:42] Patrick Galbraith
I'm trying to test this to see if my patch fixes this. It does fix it for UTF8. 

I can't even get a myisam table to return results correctly:

mysql> set names euckr;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE `test_table2` (
    ->   `id` int(20) NOT NULL auto_increment,
    ->   `name` varchar(32) NOT NULL default '',
    ->   `other` int(20) NOT NULL default '0',
    ->   PRIMARY KEY  (`id`),
    ->   KEY `name` (`name`),
    ->   KEY `other_key` (`other`)
    -> ) ENGINE=MyISAM DEFAULT CHARSET=euckr;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test_table2 (name,other) values ('권대성','35');
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> insert into test_table2 (name,other) values ('박재만','32');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into test_table2 (name,other) values ('이용성','32');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select * from test_table2;
+----+------+-------+
| id | name | other |
+----+------+-------+
|  1 | �  |    35 |
|  2 | �  |    32 |
|  3 |      |    32 |
+----+------+-------+
3 rows in set (0.00 sec)

mysql>     

 patg@govinda:~/mysql-build/mysql-5.0-engines-bug17044> mysql -u root -S /tmp/fed.sock test
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.26-debug-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE TABLE `test_table2` (   `id` int(20) NOT NULL auto_increment,   `name` varchar(32) NOT NULL default '',   `other` int(20) NOT NULL default '0',   PRIMARY KEY  (`id`),   KEY `name` (`name`),   KEY `other_key` (`other`) ) ENGINE=MyISAM DEFAULT CHARSET=euckr;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test_table2 (name,other) values ('권대성','35');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into test_table2 (name,other) values ('박재만','32');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into test_table2 (name,other) values ('이용성','32');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select * from test_table2;
+----+-----------+-------+
| id | name      | other |
+----+-----------+-------+
|  1 | ????? |    35 |
|  2 | ?????? |    32 |
|  3 | ??????? |    32 |
+----+-----------+-------+
3 rows in set (0.00 sec)

mysql>  

I even tried:

   /home/patg/mysql-build/mysql-5.0-engines-bug17044/sql/mysqld --no-defaults --init_connect='SET AUTOCOMMIT=1'   --skip-innodb --skip-ndbcluster --port=5554 --socket=/tmp/fed.sock --datadir=/home/patg/mysql-build/mysql-5.0-engines-bug17044/mysql-test/var/master-data/ --character-sets-dir=/home/patg/mysql-build/mysql-5.0-engines-bug17044/sql/share/charsets --default-character-set=euckr --character-set-server=euckr --basedir=/home/patg/mysql-build/mysql-5.0-engines-bug17044/sql --language=/home/patg/mysql-build/mysql-5.0-engines-bug17044/sql/share/english --log=/tmp/mysqld.log

with these results:
mysql> CREATE TABLE `test_table2` (   `id` int(20) NOT NULL auto_increment,   `name` varchar(32) NOT NULL default '',   `other` int(20) NOT NULL default '0',   PRIMARY KEY  (`id`),   KEY `name` (`name`),   KEY `other_key` (`other`) ) ENGINE=MyISAM DEFAULT CHARSET=euckr;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test_table2 (name,other) values ('권대성','35');
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> insert into test_table2 (name,other) values ('박재만','32');
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> insert into test_table2 (name,other) values ('이용성','32');
Query OK, 1 row affected, 1 warning (0.01 sec)

mysql> select * from test_table2;
+----+-----------+-------+
| id | name      | other |
+----+-----------+-------+
|  1 | ????? |    35 |
|  2 | ?????? |    32 |
|  3 | ??????? |    32 |
+----+-----------+-------+
3 rows in set (0.00 sec)

mysql>
[23 Dec 2006 20:52] Patrick Galbraith
Fix for this already in main 5.1
[23 Dec 2006 20:52] Patrick Galbraith
mistake - queued in engines 5.1 tree
[2 Jan 2007 16:08] Calvin Sun
Pushed to 5.1.15-beta repository and 5.0.34 repository.
The same patch for bug#17044.
[3 Jan 2007 11:29] MC Brown
A note has been added to the 5.0.34 and 5.1.15 changelogs.
[3 Jan 2007 11:40] MC Brown
Closing bug.