1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

ha_start_consistent_snapshot() did not check for errors

This commit is contained in:
Sergei Golubchik
2017-03-13 10:18:15 +01:00
parent 6e899642fe
commit 143e771dee
2 changed files with 11 additions and 6 deletions

View File

@ -2212,7 +2212,8 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
if (hton->state == SHOW_OPTION_YES && if (hton->state == SHOW_OPTION_YES &&
hton->start_consistent_snapshot) hton->start_consistent_snapshot)
{ {
hton->start_consistent_snapshot(hton, thd); if (hton->start_consistent_snapshot(hton, thd))
return TRUE;
*((bool *)arg)= false; *((bool *)arg)= false;
} }
return FALSE; return FALSE;
@ -2220,7 +2221,7 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
int ha_start_consistent_snapshot(THD *thd) int ha_start_consistent_snapshot(THD *thd)
{ {
bool warn= true; bool err, warn= true;
/* /*
Holding the LOCK_commit_ordered mutex ensures that we get the same Holding the LOCK_commit_ordered mutex ensures that we get the same
@ -2230,9 +2231,15 @@ int ha_start_consistent_snapshot(THD *thd)
have a consistent binlog position. have a consistent binlog position.
*/ */
mysql_mutex_lock(&LOCK_commit_ordered); mysql_mutex_lock(&LOCK_commit_ordered);
plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn); err= plugin_foreach(thd, snapshot_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, &warn);
mysql_mutex_unlock(&LOCK_commit_ordered); mysql_mutex_unlock(&LOCK_commit_ordered);
if (err)
{
ha_rollback_trans(thd, true);
return 1;
}
/* /*
Same idea as when one wants to CREATE TABLE in one engine which does not Same idea as when one wants to CREATE TABLE in one engine which does not
exist: exist:

View File

@ -5515,9 +5515,7 @@ end_with_restore_list:
(longlong) thd->thread_id); (longlong) thd->thread_id);
goto error; goto error;
} }
/* MyRocks: hton->start_consistent_snapshot call may fail with an error */ my_ok(thd);
if (!thd->is_error())
my_ok(thd);
break; break;
case SQLCOM_COMMIT: case SQLCOM_COMMIT:
{ {