[Commits] 953dd8d: MDEV-6997 MDEV-6996 MDEV-7002 MDEV-7006 MDEV-7009 MDEV-7012 MDEV-7015 MDEV-6977

sanja at mariadb.com sanja at mariadb.com
Wed Nov 5 12:05:04 EET 2014


revision-id: 953dd8d87fea224e26d11452eb458c79ba098f4a
parent(s): d6981391eb8f904135dfdedb5b90a7592b35e648
committer: Oleksandr Byelkin
branch nick: work-maria-10.1-sysvar4
timestamp: 2014-11-05 11:05:01 +0100
message:

MDEV-6997 MDEV-6996 MDEV-7002 MDEV-7006 MDEV-7009 MDEV-7012 MDEV-7015 MDEV-6977

---
 mysql-test/r/set_statement.result | 34 ++++++++++++++++++++++++++++++++++
 mysql-test/t/set_statement.test   | 35 +++++++++++++++++++++++++++++++++++
 sql/sys_vars.cc                   | 37 +++++++++++++++++++------------------
 3 files changed, 88 insertions(+), 18 deletions(-)

diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result
index 3afc097..efe5286 100644
--- a/mysql-test/r/set_statement.result
+++ b/mysql-test/r/set_statement.result
@@ -1066,3 +1066,37 @@ set statement skip_replication=default for select 1;
 ERROR 42000: The system variable skip_replication cannot be set in SET STATEMENT.
 set statement default_master_connection=default for select 1;
 ERROR 42000: The system variable default_master_connection cannot be set in SET STATEMENT.
+set statement default_master_connection=default for select 1;
+ERROR 42000: The system variable default_master_connection cannot be set in SET STATEMENT.
+set statement last_insert_id=1 for select 1;
+ERROR 42000: The system variable last_insert_id cannot be set in SET STATEMENT.
+set statement sql_log_off=default for select 1;
+ERROR 42000: The system variable sql_log_off cannot be set in SET STATEMENT.
+set statement long_query_time=default for select 1;
+ERROR 42000: The system variable long_query_time cannot be set in SET STATEMENT.
+set statement log_slow_filter=default for select 1;
+ERROR 42000: The system variable log_slow_filter cannot be set in SET STATEMENT.
+set statement log_slow_verbosity=default for select 1;
+ERROR 42000: The system variable log_slow_verbosity cannot be set in SET STATEMENT.
+set statement log_slow_rate_limit=default for select 1;
+ERROR 42000: The system variable log_slow_rate_limit cannot be set in SET STATEMENT.
+set statement slow_query_log=default for select 1;
+ERROR 42000: The system variable slow_query_log cannot be set in SET STATEMENT.
+set statement min_examined_row_limit=default for select 1;
+ERROR 42000: The system variable min_examined_row_limit cannot be set in SET STATEMENT.
+set statement character_set_client=default for select 1;
+ERROR 42000: The system variable character_set_client cannot be set in SET STATEMENT.
+set statement character_set_connection=default for select 1;
+ERROR 42000: The system variable character_set_connection cannot be set in SET STATEMENT.
+set statement character_set_filesystem=default for select 1;
+ERROR 42000: The system variable character_set_filesystem cannot be set in SET STATEMENT.
+set statement collation_connection=default for select 1;
+ERROR 42000: The system variable collation_connection cannot be set in SET STATEMENT.
+set statement old_passwords=default for select 1;
+ERROR 42000: The system variable old_passwords cannot be set in SET STATEMENT.
+set statement query_cache_type=default for select 1;
+ERROR 42000: The system variable query_cache_type cannot be set in SET STATEMENT.
+set statement wait_timeout=default for select 1;
+ERROR 42000: The system variable wait_timeout cannot be set in SET STATEMENT.
+set statement interactive_timeout=default for select 1;
+ERROR 42000: The system variable interactive_timeout cannot be set in SET STATEMENT.
diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test
index b92e909..a658071 100644
--- a/mysql-test/t/set_statement.test
+++ b/mysql-test/t/set_statement.test
@@ -1012,3 +1012,38 @@ set statement rand_seed2=default for select 1;
 set statement skip_replication=default for select 1;
 --error ER_SET_STATEMENT_NOT_SUPPORTED
 set statement default_master_connection=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement default_master_connection=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement last_insert_id=1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement sql_log_off=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement long_query_time=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_filter=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_verbosity=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_rate_limit=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement slow_query_log=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement min_examined_row_limit=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement character_set_client=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement character_set_connection=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement character_set_filesystem=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement collation_connection=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement old_passwords=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement query_cache_type=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement wait_timeout=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement interactive_timeout=default for select 1;
+
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 95beed8..20193fe 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -636,7 +636,7 @@ static bool fix_thd_charset(sys_var *self, THD *thd, enum_var_type type)
 static Sys_var_struct Sys_character_set_client(
        "character_set_client", "The character set for statements "
        "that arrive from the client",
-       SESSION_VAR(character_set_client), NO_CMD_LINE,
+       NO_SET_STMT SESSION_VAR(character_set_client), NO_CMD_LINE,
        offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
        NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_cs_client),
        ON_UPDATE(fix_thd_charset));
@@ -645,7 +645,7 @@ static Sys_var_struct Sys_character_set_connection(
        "character_set_connection", "The character set used for "
        "literals that do not have a character set introducer and for "
        "number-to-string conversion",
-       SESSION_VAR(collation_connection), NO_CMD_LINE,
+       NO_SET_STMT SESSION_VAR(collation_connection), NO_CMD_LINE,
        offsetof(CHARSET_INFO, csname), DEFAULT(&default_charset_info),
        NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_charset_not_null),
        ON_UPDATE(fix_thd_charset));
@@ -659,7 +659,7 @@ static Sys_var_struct Sys_character_set_results(
 
 static Sys_var_struct Sys_character_set_filesystem(
        "character_set_filesystem", "The filesystem character set",
-       SESSION_VAR(character_set_filesystem), NO_CMD_LINE,
+       NO_SET_STMT SESSION_VAR(character_set_filesystem), NO_CMD_LINE,
        offsetof(CHARSET_INFO, csname), DEFAULT(&character_set_filesystem),
        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_charset_not_null),
        ON_UPDATE(fix_thd_charset));
@@ -705,7 +705,7 @@ static bool check_collation_not_null(sys_var *self, THD *thd, set_var *var)
 static Sys_var_struct Sys_collation_connection(
        "collation_connection", "The collation of the connection "
        "character set",
-       SESSION_VAR(collation_connection), NO_CMD_LINE,
+       NO_SET_STMT SESSION_VAR(collation_connection), NO_CMD_LINE,
        offsetof(CHARSET_INFO, name), DEFAULT(&default_charset_info),
        NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(check_collation_not_null),
        ON_UPDATE(fix_thd_charset));
@@ -1024,7 +1024,7 @@ static Sys_var_ulong Sys_interactive_timeout(
        "interactive_timeout",
        "The number of seconds the server waits for activity on an interactive "
        "connection before closing it",
-       SESSION_VAR(net_interactive_timeout),
+       NO_SET_STMT SESSION_VAR(net_interactive_timeout),
        CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1, LONG_TIMEOUT), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
 
@@ -1182,7 +1182,7 @@ static Sys_var_double Sys_long_query_time(
        "Log all queries that have taken more than long_query_time seconds "
        "to execute to file. The argument will be treated as a decimal value "
        "with microsecond precision",
-       SESSION_VAR(long_query_time_double),
+       NO_SET_STMT SESSION_VAR(long_query_time_double),
        CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10),
        NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
        ON_UPDATE(update_cached_long_query_time));
@@ -2037,7 +2037,7 @@ static Sys_var_ulong Sys_min_examined_row_limit(
        "min_examined_row_limit",
        "Don't write queries to slow log that examine fewer rows "
        "than that",
-       SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
 
 #ifdef _WIN32
@@ -2130,8 +2130,9 @@ static bool check_old_passwords(sys_var *self, THD *thd, set_var *var)
 static Sys_var_mybool Sys_old_passwords(
        "old_passwords",
        "Use old password encryption method (needed for 4.0 and older clients)",
-       SESSION_VAR(old_passwords), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
-       NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_old_passwords));
+       NO_SET_STMT SESSION_VAR(old_passwords), CMD_LINE(OPT_ARG),
+       DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
+       ON_CHECK(check_old_passwords));
 export sys_var *Sys_old_passwords_ptr= &Sys_old_passwords; // for sql_acl.cc
 
 static Sys_var_ulong Sys_open_files_limit(
@@ -2675,7 +2676,7 @@ static Sys_var_enum Sys_query_cache_type(
        "OFF = Don't cache or retrieve results. ON = Cache all results "
        "except SELECT SQL_NO_CACHE ... queries. DEMAND = Cache only "
        "SELECT SQL_CACHE ... queries",
-       SESSION_VAR(query_cache_type), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(query_cache_type), CMD_LINE(REQUIRED_ARG),
        query_cache_type_names, DEFAULT(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
        ON_CHECK(check_query_cache_type),
        ON_UPDATE(fix_query_cache_type));
@@ -3284,7 +3285,7 @@ static Sys_var_ulong Sys_net_wait_timeout(
        "wait_timeout",
        "The number of seconds the server waits for activity on a "
        "connection before closing it",
-       SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(net_wait_timeout), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)),
        DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1));
 
@@ -3424,7 +3425,7 @@ static Sys_var_bit Sys_big_selects(
 
 static Sys_var_bit Sys_log_off(
        "sql_log_off", "sql_log_off",
-       SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_LOG_OFF,
+       NO_SET_STMT SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_LOG_OFF,
        DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(check_has_super));
 
 /**
@@ -3618,7 +3619,7 @@ static ulonglong read_last_insert_id(THD *thd)
 }
 static Sys_var_session_special Sys_last_insert_id(
        "last_insert_id", "The value to be returned from LAST_INSERT_ID()",
-       sys_var::ONLY_SESSION, NO_CMD_LINE,
+       NO_SET_STMT sys_var::ONLY_SESSION, NO_CMD_LINE,
        VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1),
        NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
        ON_UPDATE(update_last_insert_id), ON_READ(read_last_insert_id));
@@ -3740,7 +3741,7 @@ static Sys_var_session_special Sys_warning_count(
 static Sys_var_ulong Sys_default_week_format(
        "default_week_format",
        "The default week format used by WEEK() functions",
-       SESSION_VAR(default_week_format), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(default_week_format), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(0, 7), DEFAULT(0), BLOCK_SIZE(1));
 
 static Sys_var_ulonglong Sys_group_concat_max_len(
@@ -3963,7 +3964,7 @@ static Sys_var_mybool Sys_slow_query_log(
        "Log slow queries to a table or log file. Defaults logging to a file "
        "'hostname'-slow.log or a table mysql.slow_log if --log-output=TABLE is "
        "used. Must be enabled to activate other slow log options",
-       SESSION_VAR(sql_log_slow), CMD_LINE(OPT_ARG),
+       NO_SET_STMT SESSION_VAR(sql_log_slow), CMD_LINE(OPT_ARG),
        DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
        ON_CHECK(0), ON_UPDATE(fix_log_state));
 
@@ -4834,7 +4835,7 @@ static Sys_var_keycache Sys_key_cache_segments(
 static Sys_var_set Sys_log_slow_filter(
        "log_slow_filter",
        "Log only certain types of queries",
-       SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
        log_slow_filter_names,
        DEFAULT(MAX_SET(array_elements(log_slow_filter_names)-1)));
 
@@ -4881,7 +4882,7 @@ static Sys_var_ulong Sys_log_slow_rate_limit(
        "Write to slow log every #th slow query. Set to 1 to log everything. "
        "Increase it to reduce the size of the slow or the performance impact "
        "of slow logging",
-       SESSION_VAR(log_slow_rate_limit), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(log_slow_rate_limit), CMD_LINE(REQUIRED_ARG),
        VALID_RANGE(1, UINT_MAX), DEFAULT(1), BLOCK_SIZE(1));
 
 static const char *log_slow_verbosity_names[]= { "innodb", "query_plan", 
@@ -4889,7 +4890,7 @@ static Sys_var_ulong Sys_log_slow_rate_limit(
 static Sys_var_set Sys_log_slow_verbosity(
        "log_slow_verbosity",
        "Verbosity level for the slow log",
-       SESSION_VAR(log_slow_verbosity), CMD_LINE(REQUIRED_ARG),
+       NO_SET_STMT SESSION_VAR(log_slow_verbosity), CMD_LINE(REQUIRED_ARG),
        log_slow_verbosity_names, DEFAULT(LOG_SLOW_VERBOSITY_INIT));
 
 static Sys_var_ulong Sys_join_cache_level(


More information about the commits mailing list