summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-05-28 09:47:58 +0400
committerAlexander Nozdrin <alik@sun.com>2010-05-28 09:47:58 +0400
commit59a99129634a020bc618324db1c36f36f9e14493 (patch)
tree88543c956886365a2376e01ce26a0436c38a4454 /sql/handler.cc
parent7758bdc8aad36927db408b4bc9546d39ef646c3c (diff)
parenteb27f163a31ca6995c98ada9fc678176c041dd93 (diff)
downloadmariadb-git-59a99129634a020bc618324db1c36f36f9e14493.tar.gz
Auto-merge from mysql-trunk.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 8b56921a3a1..844c7305825 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -174,7 +174,7 @@ redo:
}
-plugin_ref ha_lock_engine(THD *thd, handlerton *hton)
+plugin_ref ha_lock_engine(THD *thd, const handlerton *hton)
{
if (hton)
{
@@ -642,9 +642,13 @@ static my_bool closecon_handlerton(THD *thd, plugin_ref plugin,
there's no need to rollback here as all transactions must
be rolled back already
*/
- if (hton->state == SHOW_OPTION_YES && hton->close_connection &&
- thd_get_ha_data(thd, hton))
- hton->close_connection(hton, thd);
+ if (hton->state == SHOW_OPTION_YES && thd_get_ha_data(thd, hton))
+ {
+ if (hton->close_connection)
+ hton->close_connection(hton, thd);
+ /* make sure ha_data is reset and ha_data_lock is released */
+ thd_set_ha_data(thd, hton, NULL);
+ }
return FALSE;
}