summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill DeVries <wdevries@clustrix.com>2020-01-22 12:59:00 -0800
committerSergei Petrunia <psergey@askmonty.org>2020-03-10 11:22:32 +0300
commit0b01f9ef25532c02881bb2f080f808bd3df8f069 (patch)
treed611d4b201c2fbe5c4372914be91122ef2e58a69
parent14c34d963a5bbf0f5d064ce8e76025b34ddebe25 (diff)
downloadmariadb-git-0b01f9ef25532c02881bb2f080f808bd3df8f069.tar.gz
Fix direct_update error handling.
-rw-r--r--storage/clustrixdb/clustrix_connection.cc9
-rw-r--r--storage/clustrixdb/ha_clustrixdb.cc5
2 files changed, 5 insertions, 9 deletions
diff --git a/storage/clustrixdb/clustrix_connection.cc b/storage/clustrixdb/clustrix_connection.cc
index 7d7848db8dc..aca69877ef5 100644
--- a/storage/clustrixdb/clustrix_connection.cc
+++ b/storage/clustrixdb/clustrix_connection.cc
@@ -731,13 +731,12 @@ int clustrix_connection::update_query(String &stmt, LEX_CSTRING &dbname,
if ((error_code = send_command()))
return error_code;
- if ((error_code = read_query_response()))
- return error_code;
-
+ error_code = read_query_response();
auto_commit_closed();
- *affected_rows = clustrix_net.affected_rows;
+ if (!error_code)
+ *affected_rows = clustrix_net.affected_rows;
- return 0;
+ return error_code;
}
diff --git a/storage/clustrixdb/ha_clustrixdb.cc b/storage/clustrixdb/ha_clustrixdb.cc
index 1f548a45081..46b72366d9a 100644
--- a/storage/clustrixdb/ha_clustrixdb.cc
+++ b/storage/clustrixdb/ha_clustrixdb.cc
@@ -573,10 +573,7 @@ int ha_clustrixdb::direct_update_rows(ha_rows *update_rows)
if (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
trx->auto_commit_next();
- trx->update_query(update_stmt, table->s->db, update_rows);
-
- thd->get_stmt_da()->set_overwrite_status(true);
-
+ error_code = trx->update_query(update_stmt, table->s->db, update_rows);
DBUG_RETURN(error_code);
}