summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-03-13 10:18:15 +0100
committerSergei Golubchik <serg@mariadb.org>2017-03-31 19:28:58 +0200
commit143e771deef47e4afdd5d8dcdaddc424f919af83 (patch)
treebece802f0bcecc31b1b988b814332c3b8fd5f1b3 /sql/handler.cc
parent6e899642fe65eb3f36ff33fbb7b77052a0f216e6 (diff)
downloadmariadb-git-143e771deef47e4afdd5d8dcdaddc424f919af83.tar.gz
ha_start_consistent_snapshot() did not check for errors
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index c28ab2a7bd7..a6016646d3c 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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: