summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--storage/spider/spd_param.cc39
-rw-r--r--storage/spider/spd_param.h2
-rw-r--r--storage/spider/spd_trx.cc15
3 files changed, 33 insertions, 23 deletions
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index 6970f19e85f..bc8888babb0 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -968,20 +968,25 @@ bool spider_param_use_default_database(
DBUG_RETURN(THDVAR(thd, use_default_database));
}
+static int spider_internal_sql_log_off;
/*
- FALSE: sql_log_off = 0
- TRUE: sql_log_off = 1
- */
-static MYSQL_THDVAR_BOOL(
- internal_sql_log_off, /* name */
- PLUGIN_VAR_OPCMDARG, /* opt */
- "Sync sql_log_off", /* comment */
- NULL, /* check */
- NULL, /* update */
- TRUE /* def */
-);
-
-bool spider_param_internal_sql_log_off(
+-1 :don't know or does not matter; don't send 'SET SQL_LOG_OFF' statement
+ 0 :do send 'SET SQL_LOG_OFF 0' statement to data nodes
+ 1 :do send 'SET SQL_LOG_OFF 1' statement to data nodes
+*/
+static MYSQL_THDVAR_INT(
+ internal_sql_log_off, /* name */
+ PLUGIN_VAR_RQCMDARG, /* opt */
+ "Manage SQL_LOG_OFF mode statement to the data nodes", /* comment */
+ NULL, /* check */
+ NULL, /* update */
+ -1, /* default */
+ -1, /* min */
+ 1, /* max */
+ 0 /* blk */
+);
+
+int spider_param_internal_sql_log_off(
THD *thd
) {
DBUG_ENTER("spider_param_internal_sql_log_off");
@@ -2224,15 +2229,15 @@ char *spider_param_remote_time_zone()
static int spider_remote_sql_log_off;
/*
- -1 :don't set
- 0 :sql_log_off = 0
- 1 :sql_log_off = 1
+ -1 :don't know the value on all data nodes, or does not matter
+ 0 :sql_log_off = 0 on all data nodes
+ 1 :sql_log_off = 1 on all data nodes
*/
static MYSQL_SYSVAR_INT(
remote_sql_log_off,
spider_remote_sql_log_off,
PLUGIN_VAR_RQCMDARG,
- "Set sql_log_off mode at connecting for improvement performance of connection if you know",
+ "Set SQL_LOG_OFF mode on connecting for improved performance of connection, if you know",
NULL,
NULL,
-1,
diff --git a/storage/spider/spd_param.h b/storage/spider/spd_param.h
index d4af48a75ea..9a358c54be5 100644
--- a/storage/spider/spd_param.h
+++ b/storage/spider/spd_param.h
@@ -113,7 +113,7 @@ bool spider_param_sync_time_zone(
bool spider_param_use_default_database(
THD *thd
);
-bool spider_param_internal_sql_log_off(
+int spider_param_internal_sql_log_off(
THD *thd
);
int spider_param_bulk_size(
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index 53c83026f50..cf60a0376bb 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -1638,15 +1638,20 @@ int spider_check_and_set_sql_log_off(
SPIDER_CONN *conn,
int *need_mon
) {
- bool internal_sql_log_off;
+ int internal_sql_log_off;
DBUG_ENTER("spider_check_and_set_sql_log_off");
internal_sql_log_off = spider_param_internal_sql_log_off(thd);
- if (internal_sql_log_off)
+ if (internal_sql_log_off != -1)
{
- spider_conn_queue_sql_log_off(conn, TRUE);
- } else {
- spider_conn_queue_sql_log_off(conn, FALSE);
+ if (internal_sql_log_off)
+ {
+ spider_conn_queue_sql_log_off(conn, TRUE);
+ }
+ else
+ {
+ spider_conn_queue_sql_log_off(conn, FALSE);
+ }
}
/*
if (internal_sql_log_off && conn->sql_log_off != 1)