summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-10-15 12:06:00 +0200
committerSergei Golubchik <serg@mariadb.org>2018-11-06 13:36:50 +0100
commit564a63b5a35b644dc038965b4cf3b0cbfdc398af (patch)
tree68076626d87c4d2ce7c37e99d237fdc97eace0ae
parent4990b0e1ee463d98c773429e0007b11eb335ae79 (diff)
downloadmariadb-git-564a63b5a35b644dc038965b4cf3b0cbfdc398af.tar.gz
MDEV-14429 sql_safe_updates in my.cnf not work
-rw-r--r--mysql-test/main/mysqld--help.result5
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result2
-rw-r--r--sql/sys_vars.cc2
3 files changed, 7 insertions, 2 deletions
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index 5a7153f32d3..1c7e9cd839d 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -1209,6 +1209,10 @@ The following specify which files/extra groups are read (specified before remain
NO_AUTO_CREATE_USER, HIGH_NOT_PRECEDENCE,
NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH,
EMPTY_STRING_IS_NULL, SIMULTANEOUS_ASSIGNMENT
+ --sql-safe-updates If set to 1, UPDATEs and DELETEs need either a key in the
+ WHERE clause, or a LIMIT clause, or else they will
+ aborted. Prevents the common mistake of accidentally
+ deleting or updating every row in a table.
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
--standard-compliant-cte
@@ -1664,6 +1668,7 @@ slow-launch-time 2
slow-query-log FALSE
sort-buffer-size 2097152
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+sql-safe-updates FALSE
stack-trace TRUE
standard-compliant-cte TRUE
stored-program-cache 256
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index e8e4d671eb9..47df962b7c4 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -4799,7 +4799,7 @@ NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
-COMMAND_LINE_ARGUMENT NULL
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SQL_SELECT_LIMIT
SESSION_VALUE 18446744073709551615
GLOBAL_VALUE 18446744073709551615
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 6d4c135683a..369c9a6222a 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -4119,7 +4119,7 @@ static Sys_var_bit Sys_safe_updates(
"sql_safe_updates", "If set to 1, UPDATEs and DELETEs need either a key in "
"the WHERE clause, or a LIMIT clause, or else they will aborted. Prevents "
"the common mistake of accidentally deleting or updating every row in a table.",
- SESSION_VAR(option_bits), NO_CMD_LINE, OPTION_SAFE_UPDATES,
+ SESSION_VAR(option_bits), CMD_LINE(OPT_ARG), OPTION_SAFE_UPDATES,
DEFAULT(FALSE));
static Sys_var_bit Sys_buffer_results(