Commit 143e771d authored by Sergei Golubchik's avatar Sergei Golubchik

ha_start_consistent_snapshot() did not check for errors

parent 6e899642
......@@ -2212,7 +2212,8 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
if (hton->state == SHOW_OPTION_YES &&
hton->start_consistent_snapshot)
{
hton->start_consistent_snapshot(hton, thd);
if (hton->start_consistent_snapshot(hton, thd))
return TRUE;
*((bool *)arg)= false;
}
return FALSE;
......@@ -2220,7 +2221,7 @@ static my_bool snapshot_handlerton(THD *thd, plugin_ref plugin,
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
......@@ -2230,9 +2231,15 @@ int ha_start_consistent_snapshot(THD *thd)
have a consistent binlog position.
*/
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);
if (err)
{
ha_rollback_trans(thd, true);
return 1;
}
/*
Same idea as when one wants to CREATE TABLE in one engine which does not
exist:
......
......@@ -5515,9 +5515,7 @@ mysql_execute_command(THD *thd)
(longlong) thd->thread_id);
goto error;
}
/* MyRocks: hton->start_consistent_snapshot call may fail with an error */
if (!thd->is_error())
my_ok(thd);
my_ok(thd);
break;
case SQLCOM_COMMIT:
{
......
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