Commit e980797d authored by Kentoku SHIBA's avatar Kentoku SHIBA

fix crash at thd_wait_begin()

parent 240e62b8
...@@ -2429,14 +2429,18 @@ int spider_initinal_xa_recover( ...@@ -2429,14 +2429,18 @@ int spider_initinal_xa_recover(
} }
} }
/*
if (!thd) if (!thd)
{ {
*/
if (!(thd = spider_create_tmp_thd())) if (!(thd = spider_create_tmp_thd()))
{ {
error_num = HA_ERR_OUT_OF_MEM; error_num = HA_ERR_OUT_OF_MEM;
goto error_create_thd; goto error_create_thd;
} }
/*
} }
*/
/* /*
select select
...@@ -2465,8 +2469,10 @@ int spider_initinal_xa_recover( ...@@ -2465,8 +2469,10 @@ int spider_initinal_xa_recover(
} }
free_root(&mem_root, MYF(0)); free_root(&mem_root, MYF(0));
/*
if (cnt < (int) len) if (cnt < (int) len)
{ {
*/
end_read_record(read_record); end_read_record(read_record);
spider_close_sys_table(thd, table_xa, open_tables_backup, TRUE); spider_close_sys_table(thd, table_xa, open_tables_backup, TRUE);
table_xa = NULL; table_xa = NULL;
...@@ -2476,7 +2482,9 @@ int spider_initinal_xa_recover( ...@@ -2476,7 +2482,9 @@ int spider_initinal_xa_recover(
read_record = NULL; read_record = NULL;
delete open_tables_backup; delete open_tables_backup;
open_tables_backup = NULL; open_tables_backup = NULL;
/*
} }
*/
DBUG_RETURN(cnt); DBUG_RETURN(cnt);
/* /*
...@@ -3749,6 +3757,11 @@ void spider_free_tmp_thd( ...@@ -3749,6 +3757,11 @@ void spider_free_tmp_thd(
THD *thd THD *thd
) { ) {
DBUG_ENTER("spider_free_tmp_thd"); DBUG_ENTER("spider_free_tmp_thd");
#if defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 100000
thd->reset_globals();
#else
thd->restore_globals();
#endif
thd->cleanup(); thd->cleanup();
delete thd; delete thd;
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment