summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill DeVries <wdevries@clustrix.com>2020-01-10 14:48:39 -0800
committerSergei Petrunia <psergey@askmonty.org>2020-03-10 11:22:32 +0300
commit14c34d963a5bbf0f5d064ce8e76025b34ddebe25 (patch)
tree0d8ebe51333b7dfddfd2194edd34dce8895c0987
parent4e45e8a217b67456195b501318826bd324418cfc (diff)
downloadmariadb-git-14c34d963a5bbf0f5d064ce8e76025b34ddebe25.tar.gz
Add session variable to enable direct update.
-rw-r--r--storage/clustrixdb/ha_clustrixdb.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/storage/clustrixdb/ha_clustrixdb.cc b/storage/clustrixdb/ha_clustrixdb.cc
index 328bed7fce8..1f548a45081 100644
--- a/storage/clustrixdb/ha_clustrixdb.cc
+++ b/storage/clustrixdb/ha_clustrixdb.cc
@@ -162,6 +162,7 @@ static MYSQL_THDVAR_BOOL(
NULL,
1
);
+
// Per thread derived handler knob
static MYSQL_THDVAR_BOOL(
derived_handler,
@@ -172,6 +173,15 @@ static MYSQL_THDVAR_BOOL(
1
);
+static MYSQL_THDVAR_BOOL(
+ enable_direct_update,
+ PLUGIN_VAR_NOCMDARG,
+ "",
+ NULL,
+ NULL,
+ 1
+);
+
bool select_handler_setting(THD* thd)
{
return ( thd == NULL ) ? false : THDVAR(thd, select_handler);
@@ -542,8 +552,10 @@ int ha_clustrixdb::update_row(const uchar *old_data, const uchar *new_data)
int ha_clustrixdb::direct_update_rows_init(List<Item> *update_fields)
{
DBUG_ENTER("ha_clustrixdb::direct_update_rows_init");
- int error_code= 0;
- DBUG_RETURN(error_code);
+ THD *thd= ha_thd();
+ if (!THDVAR(thd, enable_direct_update))
+ DBUG_RETURN(HA_ERR_WRONG_COMMAND);
+ DBUG_RETURN(0);
}
int ha_clustrixdb::direct_update_rows(ha_rows *update_rows)
@@ -1352,6 +1364,7 @@ static struct st_mysql_sys_var* clustrixdb_system_variables[] =
MYSQL_SYSVAR(row_buffer),
MYSQL_SYSVAR(select_handler),
MYSQL_SYSVAR(derived_handler),
+ MYSQL_SYSVAR(enable_direct_update),
NULL
};