summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 7a2581d5ab8..af842937491 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -432,6 +432,11 @@ void free_table_share(TABLE_SHARE *share)
key_info->flags= 0;
}
}
+ if (share->ha_data_destroy)
+ {
+ share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
/* We must copy mem_root from share because share is allocated through it */
memcpy((char*) &mem_root, (char*) &share->mem_root, sizeof(mem_root));
free_root(&mem_root, MYF(0)); // Free's share
@@ -1724,6 +1729,11 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
delete crypted;
delete handler_file;
hash_free(&share->name_hash);
+ if (share->ha_data_destroy)
+ {
+ share->ha_data_destroy(share->ha_data);
+ share->ha_data_destroy= NULL;
+ }
open_table_error(share, error, share->open_errno, errarg);
DBUG_RETURN(error);