From e78712d4647f819ec10dfacc0b36c051aad77603 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 13 Sep 2017 19:54:48 +0200 Subject: cleanup: remove dead code --- storage/federated/ha_federated.cc | 60 --------------------------------------- 1 file changed, 60 deletions(-) (limited to 'storage/federated') diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 8e8b39df2b2..cd4c0fe2c40 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -3289,66 +3289,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); } -- cgit v1.2.1 From e6ce97a592858cf7274f045150e5208128e2c35a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 13 Sep 2017 21:02:44 +0200 Subject: MDEV-12951 Server crash [mysqld got exception 0xc0000005] Same as MDEV-12725 but for federated (not X). Set and reset mysql.net->thd appropriately. --- storage/federated/ha_federated.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'storage/federated') diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index cd4c0fe2c40..6b88ab6f2bb 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -2980,6 +2980,9 @@ int ha_federated::reset(void) } reset_dynamic(&results); + if (mysql) + mysql->net.thd= NULL; + return 0; } @@ -3200,12 +3203,14 @@ int ha_federated::real_query(const char *query, size_t length) int rc= 0; DBUG_ENTER("ha_federated::real_query"); - if (!mysql && (rc= real_connect())) + if (!query || !length) goto end; - if (!query || !length) + if (!mysql && (rc= real_connect())) goto end; + mysql->net.thd= table->in_use; + rc= mysql_real_query(mysql, query, (uint) length); end: -- cgit v1.2.1