diff options
author | Antony T Curtis <antony@xiphis.org> | 2009-11-14 12:15:39 -0800 |
---|---|---|
committer | Antony T Curtis <antony@xiphis.org> | 2009-11-14 12:15:39 -0800 |
commit | fb8a529d6eeff616ff13fabce2234d3bfe2e4b57 (patch) | |
tree | d62ff8ca1d1ac8d3a75c485147977558a1d75405 /storage/federatedx | |
parent | 343001d84054a4051d75bf56f131fc3bf140d59d (diff) | |
download | mariadb-git-fb8a529d6eeff616ff13fabce2234d3bfe2e4b57.tar.gz |
merge fix for bug monty found in ha_federatedx::close() method
Diffstat (limited to 'storage/federatedx')
-rw-r--r-- | storage/federatedx/ha_federatedx.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 629868f93e2..e9ef06c750f 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -1786,7 +1786,7 @@ int ha_federatedx::open(const char *name, int mode, uint test_if_locked) int ha_federatedx::close(void) { int retval, error; - THD *thd= current_thd; + THD *thd; DBUG_ENTER("ha_federatedx::close"); /* free the result set */ @@ -1794,13 +1794,26 @@ int ha_federatedx::close(void) retval= free_result(); /* Disconnect from mysql */ - if (txn || thd && (txn= get_txn(thd, true))) + if (!(thd= current_thd) || !(txn= get_txn(thd, true))) + { + federatedx_txn tmp_txn; + + tmp_txn.release(&io); + + DBUG_ASSERT(io == NULL); + + if ((error= free_share(&tmp_txn, share))) + retval= error; + } + else + { txn->release(&io); - DBUG_ASSERT(io == NULL); + DBUG_ASSERT(io == NULL); - if ((error= free_share(txn, share))) - retval= error; + if ((error= free_share(txn, share))) + retval= error; + } DBUG_RETURN(retval); } |