--- mysql-5.0.22/sql/ha_federated.cc	2006-05-25 17:56:43.000000000 +0900
+++ mysql-5.0.22-federated-fix/sql/ha_federated.cc	2006-08-01 11:14:07.696661520 +0900
@@ -1470,6 +1470,16 @@
   {
     DBUG_RETURN(stash_remote_error());
   }
+
+  mysql->charset = table->share_not_to_be_used.table_charset;
+
+  if (mysql_set_character_set(mysql, mysql->charset->csname))
+  {
+    DBUG_PRINT("error", ("mysql_set_character_set() failed"));
+    bzero((char*) &mysql->options, sizeof(mysql->options));
+    mysql_close(mysql);
+  }
+
   /*
     Since we do not support transactions at this version, we can let the client
     API silently reconnect. For future versions, we will need more logic to deal