List:Commits« Previous MessageNext Message »
From:Patrick Galbraith Date:November 16 2006 2:02am
Subject:bk commit into 5.0 tree (patg:1.2295) BUG#17044
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of patg. When patg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-15 21:01:44-05:00, patg@stripped +3 -0
  BUG# 17044 Federated Storage Engine not UTF8 clean
  - Added 'SET NAMES <charset>" upon ::open
  - Added test and results for simple UTF test
  
  federated.test:
  BUG #17044 Federated Storage Engine not UTF8 clean
    New test. Using hex - pasting various charsets in the terminal doesn't work.
  federated.result:
  BUG# 17044 Federated Storage Engine not UTF8 clean
    New test results
  ha_federated.cc:
    BUG# 17044 Federated Storage Engine not UTF8 clean
    Upon ::open, set names to table's charset. 

  mysql-test/r/federated.result@stripped, 2006-11-15 20:58:46-05:00, patg@stripped +28 -0
    BUG# 17044 Federated Storage Engine not UTF8 clean
        New test results

  mysql-test/t/federated.test@stripped, 2006-11-15 20:58:23-05:00, patg@stripped +31 -0
    BUG #17044 Federated Storage Engine not UTF8 clean
        New test. Using hex - pasting various charsets in the terminal doesn't work.

  sql/ha_federated.cc@stripped, 2006-11-15 20:57:48-05:00, patg@stripped +22 -0
    ha_federated.cc:
        BUG# 17044 Federated Storage Engine not UTF8 clean
        Upon ::open, set names to table's charset. 

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	patg
# Host:	radha.local
# Root:	/Users/patg/mysql-build/mysql-5.0-engines-bug17044

--- 1.38/mysql-test/r/federated.result	2006-11-15 21:02:01 -05:00
+++ 1.39/mysql-test/r/federated.result	2006-11-15 21:02:01 -05:00
@@ -1815,6 +1815,34 @@
 connection='mysql://root@stripped:SLAVE_PORT/federated/test';
 drop table federated.test1, federated.test2;
 drop table federated.test;
+set names utf8;
+create table federated.t1 (a varchar(64)) DEFAULT CHARSET=utf8;
+insert into federated.t1 values (0x6DC3A56E6164);
+select hex(a) from federated.t1;
+hex(a)
+6DC3A56E6164
+set names utf8;
+create table federated.t1 (a varchar(64))
+ENGINE=FEDERATED 
+CONNECTION='mysql://root@stripped:9308/federated/t1'
+DEFAULT CHARSET=utf8;
+select hex(a) from federated.t1;
+hex(a)
+6DC3A56E6164
+insert into federated.t1 values (0xC3A4C3B6C3BCC39F);
+insert into federated.t1 values (0xD18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E);
+select hex(a) from federated.t1;
+hex(a)
+6DC3A56E6164
+C3A4C3B6C3BCC39F
+D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
+select hex(a) from federated.t1;
+hex(a)
+6DC3A56E6164
+C3A4C3B6C3BCC39F
+D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
+drop table federated.t1;
+drop table federated.t1;
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
 DROP TABLE IF EXISTS federated.t1;

--- 1.33/mysql-test/t/federated.test	2006-11-15 21:02:01 -05:00
+++ 1.34/mysql-test/t/federated.test	2006-11-15 21:02:01 -05:00
@@ -1544,4 +1544,35 @@
 connection slave;
 drop table federated.test;
 
+#
+# BUG# 17044 Federated Storage Engine not UTF8 clean
+#
+connection slave;
+set names utf8;
+create table federated.t1 (a varchar(64)) DEFAULT CHARSET=utf8;
+
+insert into federated.t1 values (0x6DC3A56E6164);
+select hex(a) from federated.t1;
+
+connection master;
+set names utf8;
+eval create table federated.t1 (a varchar(64))
+ENGINE=FEDERATED 
+CONNECTION='mysql://root@stripped:$SLAVE_MYPORT/federated/t1'
+DEFAULT CHARSET=utf8;
+select hex(a) from federated.t1;
+insert into federated.t1 values (0xC3A4C3B6C3BCC39F);
+insert into federated.t1 values (0xD18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E);
+select hex(a) from federated.t1;
+
+connection slave;
+select hex(a) from federated.t1;
+
+connection master;
+drop table federated.t1;
+
+connection slave;
+drop table federated.t1;
+
+
 source include/federated_cleanup.inc;

--- 1.68/sql/ha_federated.cc	2006-11-15 21:02:02 -05:00
+++ 1.69/sql/ha_federated.cc	2006-11-15 21:02:02 -05:00
@@ -1427,14 +1427,24 @@
 
 int ha_federated::open(const char *name, int mode, uint test_if_locked)
 {
+  /*char query_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+  String query(query_buffer, sizeof(query_buffer), &my_charset_bin);
+  */
   DBUG_ENTER("ha_federated::open");
 
+  /*query.length(0);*/
+
   if (!(share= get_share(name, table)))
     DBUG_RETURN(1);
   thr_lock_data_init(&share->lock, &lock, NULL);
 
   /* Connect to foreign database mysql_real_connect() */
   mysql= mysql_init(0);
+
+  /* this sets the csname like 'set names utf8' */
+  mysql_options(mysql,MYSQL_SET_CHARSET_NAME,
+                this->table->s->table_charset->csname);
+
   if (!mysql || !mysql_real_connect(mysql,
                                    share->hostname,
                                    share->username,
@@ -1451,12 +1461,24 @@
     API silently reconnect. For future versions, we will need more logic to
     deal with transactions
   */
+
   mysql->reconnect= 1;
 
   ref_length= (table->s->primary_key != MAX_KEY ?
                table->key_info[table->s->primary_key].key_length :
                table->s->reclength);
   DBUG_PRINT("info", ("ref_length: %u", ref_length));
+
+  /*
+    BUG# 17044 Federated Storage Engine is not UTF8 clean
+    Add set names to whatever charset the table is at open
+    of table
+  */
+  /*query.append("SET NAMES ");
+  query.append(this->table->s->table_charset->csname);
+  if (mysql_real_query(mysql, query.ptr(), query.length()))
+    DBUG_RETURN(stash_remote_error()); 
+*/
 
   DBUG_RETURN(0);
 }
Thread
bk commit into 5.0 tree (patg:1.2295) BUG#17044Patrick Galbraith16 Nov