diff options
Diffstat (limited to 'sql/ha_federated.cc')
-rw-r--r-- | sql/ha_federated.cc | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 8be1e40f42d..6508216e3d6 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -2,8 +2,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. + the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -557,8 +556,8 @@ static int parse_url_error(FEDERATED_SHARE *share, TABLE *table, int error_num) if (share->scheme) { DBUG_PRINT("info", - ("error: parse_url. Returning error code %d \ - freeing share->scheme %lx", error_num, share->scheme)); + ("error: parse_url. Returning error code %d freeing share->scheme 0x%lx", + error_num, (long) share->scheme)); my_free((gptr) share->scheme, MYF(0)); share->scheme= 0; } @@ -624,7 +623,7 @@ static int parse_url(FEDERATED_SHARE *share, TABLE *table, MYF(0)); share->connect_string_length= table->s->connect_string.length; - DBUG_PRINT("info",("parse_url alloced share->scheme %lx", share->scheme)); + DBUG_PRINT("info",("parse_url alloced share->scheme 0x%lx", (long) share->scheme)); /* remove addition of null terminator and store length @@ -1249,7 +1248,6 @@ bool ha_federated::create_where_from_key(String *to, if (tmp.append(FEDERATED_CLOSEPAREN)) DBUG_RETURN(1); -next_loop: if (store_length >= length) break; DBUG_PRINT("info", ("remainder %d", remainder)); @@ -1435,6 +1433,16 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) /* Connect to foreign database mysql_real_connect() */ mysql= mysql_init(0); + + /* + BUG# 17044 Federated Storage Engine is not UTF8 clean + Add set names to whatever charset the table is at open + of table + */ + /* 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,6 +1459,7 @@ int ha_federated::open(const char *name, int mode, uint test_if_locked) 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 ? @@ -1664,7 +1673,7 @@ void ha_federated::update_auto_increment(void) DBUG_ENTER("ha_federated::update_auto_increment"); thd->insert_id(mysql->last_used_con->insert_id); - DBUG_PRINT("info",("last_insert_id %d", auto_increment_value)); + DBUG_PRINT("info",("last_insert_id: %ld", (long) auto_increment_value)); DBUG_VOID_RETURN; } @@ -1914,11 +1923,11 @@ int ha_federated::delete_row(const byte *buf) { DBUG_RETURN(stash_remote_error()); } - deleted+= mysql->affected_rows; - records-= mysql->affected_rows; + deleted+= (ha_rows) mysql->affected_rows; + records-= (ha_rows) mysql->affected_rows; DBUG_PRINT("info", - ("rows deleted %d rows deleted for all time %d", - int(mysql->affected_rows), deleted)); + ("rows deleted %ld rows deleted for all time %ld", + (long) mysql->affected_rows, (long) deleted)); DBUG_RETURN(0); } @@ -2270,7 +2279,6 @@ int ha_federated::rnd_next(byte *buf) int ha_federated::read_next(byte *buf, MYSQL_RES *result) { int retval; - my_ulonglong num_rows; MYSQL_ROW row; DBUG_ENTER("ha_federated::read_next"); |