summaryrefslogtreecommitdiff
path: root/storage/federated
diff options
context:
space:
mode:
Diffstat (limited to 'storage/federated')
-rw-r--r--storage/federated/ha_federated.cc83
1 files changed, 11 insertions, 72 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index 26cc63885f3..2e8d5b12e81 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -561,8 +561,7 @@ static bool append_ident(String *string, const char *name, size_t length,
for (name_end= name+length; name < name_end; name+= clen)
{
uchar c= *(uchar *) name;
- if (!(clen= my_mbcharlen(system_charset_info, c)))
- clen= 1;
+ clen= my_charlen_fix(system_charset_info, name, name_end);
if (clen == 1 && c == (uchar) quote_char &&
(result= string->append(&quote_char, 1, system_charset_info)))
goto err;
@@ -615,8 +614,8 @@ int get_connection(MEM_ROOT *mem_root, FEDERATED_SHARE *share)
error_num=1;
goto error;
}
- DBUG_PRINT("info", ("get_server_by_name returned server at %lx",
- (long unsigned int) server));
+ DBUG_PRINT("info", ("get_server_by_name returned server at %p",
+ server));
/*
Most of these should never be empty strings, error handling will
@@ -717,15 +716,15 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
share->port= 0;
share->socket= 0;
- DBUG_PRINT("info", ("share at %lx", (long unsigned int) share));
+ DBUG_PRINT("info", ("share at %p", share));
DBUG_PRINT("info", ("Length: %u", (uint) table->s->connect_string.length));
DBUG_PRINT("info", ("String: '%.*s'", (int) table->s->connect_string.length,
table->s->connect_string.str));
share->connection_string= strmake_root(mem_root, table->s->connect_string.str,
table->s->connect_string.length);
- DBUG_PRINT("info",("parse_url alloced share->connection_string %lx",
- (long unsigned int) share->connection_string));
+ DBUG_PRINT("info",("parse_url alloced share->connection_string %p",
+ share->connection_string));
DBUG_PRINT("info",("share->connection_string %s",share->connection_string));
/*
@@ -738,9 +737,9 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
DBUG_PRINT("info",
("share->connection_string %s internal format \
- share->connection_string %lx",
+ share->connection_string %p",
share->connection_string,
- (long unsigned int) share->connection_string));
+ share->connection_string));
/* ok, so we do a little parsing, but not completely! */
share->parsed= FALSE;
@@ -794,8 +793,8 @@ static int parse_url(MEM_ROOT *mem_root, FEDERATED_SHARE *share, TABLE *table,
// Add a null for later termination of table name
share->connection_string[table->s->connect_string.length]= 0;
share->scheme= share->connection_string;
- DBUG_PRINT("info",("parse_url alloced share->scheme %lx",
- (long unsigned int) share->scheme));
+ DBUG_PRINT("info",("parse_url alloced share->scheme %p",
+ share->scheme));
/*
remove addition of null terminator and store length
@@ -1657,7 +1656,7 @@ public:
public:
bool handle_condition(THD *thd, uint sql_errno, const char* sqlstate,
- Sql_condition::enum_warning_level level,
+ Sql_condition::enum_warning_level *level,
const char* msg, Sql_condition ** cond_hdl)
{
return sql_errno >= ER_ABORTING_CONNECTION &&
@@ -3295,66 +3294,6 @@ int ha_federated::external_lock(THD *thd, int lock_type)
int error= 0;
DBUG_ENTER("ha_federated::external_lock");
- /*
- Support for transactions disabled until WL#2952 fixes it.
- */
-#ifdef XXX_SUPERCEDED_BY_WL2952
- if (lock_type != F_UNLCK)
- {
- ha_federated *trx= (ha_federated *)thd_get_ha_data(thd, ht);
-
- DBUG_PRINT("info",("federated not lock F_UNLCK"));
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
- {
- DBUG_PRINT("info",("federated autocommit"));
- /*
- This means we are doing an autocommit
- */
- error= connection_autocommit(TRUE);
- if (error)
- {
- DBUG_PRINT("info", ("error setting autocommit TRUE: %d", error));
- DBUG_RETURN(error);
- }
- trans_register_ha(thd, FALSE, ht);
- }
- else
- {
- DBUG_PRINT("info",("not autocommit"));
- if (!trx)
- {
- /*
- This is where a transaction gets its start
- */
- error= connection_autocommit(FALSE);
- if (error)
- {
- DBUG_PRINT("info", ("error setting autocommit FALSE: %d", error));
- DBUG_RETURN(error);
- }
- thd_set_ha_data(thd, ht, this);
- trans_register_ha(thd, TRUE, ht);
- /*
- Send a lock table to the remote end.
- We do not support this at the moment
- */
- if (thd->options & (OPTION_TABLE_LOCK))
- {
- DBUG_PRINT("info", ("We do not support lock table yet"));
- }
- }
- else
- {
- ha_federated *ptr;
- for (ptr= trx; ptr; ptr= ptr->trx_next)
- if (ptr == this)
- break;
- else if (!ptr->trx_next)
- ptr->trx_next= this;
- }
- }
- }
-#endif /* XXX_SUPERCEDED_BY_WL2952 */
table_will_be_deleted = FALSE;
DBUG_RETURN(error);
}