diff options
author | unknown <guilhem@mysql.com> | 2005-11-10 17:50:51 +0100 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2005-11-10 17:50:51 +0100 |
commit | 20285580ccf87fddc7045e9e2d898bbce0286530 (patch) | |
tree | 9f5312705476f9f7218439c118f72bd97002bf5d /sql/mysqld.cc | |
parent | 4a90d353c2e51917f6c99d2288282289d18c52d1 (diff) | |
download | mariadb-git-20285580ccf87fddc7045e9e2d898bbce0286530.tar.gz |
WL#2971 "change log-bin-trust-routine-creators=0 to apply only to functions".
Indeed now that stored procedures CALL is not binlogged, but instead the invoked substatements are,
the restrictions applied by log-bin-trust-routine-creators=0 are superfluous for procedures.
They still need to apply to functions where function calls are written to the binlog (for example as "DO myfunc(3)").
We rename the variable to log-bin-trust-function-creators but allow the old name until some future version (and issue a warning if old name is used).
mysql-test/mysql-test-run.pl:
update to new option name
mysql-test/mysql-test-run.sh:
update to new option name
mysql-test/mysql_test_run_new.c:
update to new option name
mysql-test/r/rpl_sp.result:
result update
mysql-test/t/rpl_sp-slave.opt:
we need to skip this error to not hit BUG#14769
mysql-test/t/rpl_sp.test:
Test update:
1) as log-bin-trust-routine-creators now affects only functions, the testing of this option, which was
mainly done on procedures, is moved to functions
2) cleanup is simplified; and instead of many SHOW BINLOG EVENTS we do a big one in the end, which is more
maintainable.
3) we test a few more function and procedures cases to see how they replicate.
4) removing out-of-date comments
sql/item_func.cc:
This warning is wrong since binlogging of functions was changed in August. If a function fails
in the middle, it will be binlogged with its error code (i.e. properly).
sql/mysql_priv.h:
variable name changed
sql/mysqld.cc:
option name changes. A precision about --read-only.
sql/set_var.cc:
a new class sys_var_trust_routine_creators to be able to issue a "this is a deprecated variable" warning if used.
sql/set_var.h:
new class to be able to issue a "this is a deprecated variable" warning if used.
sql/share/errmsg.txt:
routine -> function
sql/sp.cc:
log-bin-trust-routine-creators now applies only to functions.
sql/sql_parse.cc:
1) sending ER_FAILED_ROUTINE_BREAK_BINLOG is wrong since August as we don't binlog CALL anymore but instead binlog the substatements;
the clear_error() goes away too as it was necessary only when we created a binlog event from the "CALL" statement.
2) log-bin-trust-routine-creators now applies only to functions.
sql/sql_trigger.cc:
comments.
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index acad378353b..dc7d11ad728 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -371,7 +371,7 @@ my_bool opt_log_slow_admin_statements= 0; my_bool lower_case_file_system= 0; my_bool opt_large_pages= 0; uint opt_large_page_size= 0; -my_bool opt_old_style_user_limits= 0, trust_routine_creators= 0; +my_bool opt_old_style_user_limits= 0, trust_function_creators= 0; /* True if there is at least one per-hour limit for some user, so we should check them before each query (and possibly reset counters when hour is @@ -4432,7 +4432,7 @@ enum options_mysqld OPT_INNODB_FAST_SHUTDOWN, OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB, OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, - OPT_LOG_BIN_TRUST_ROUTINE_CREATORS, + OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG, OPT_INNODB, OPT_ISAM, OPT_ENGINE_CONDITION_PUSHDOWN, @@ -4857,16 +4857,27 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite, "File that holds the names for last binary log files.", (gptr*) &opt_binlog_index_name, (gptr*) &opt_binlog_index_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#ifndef TO_BE_REMOVED_IN_5_1_OR_6_0 + /* + In 5.0.6 we introduced the below option, then in 5.0.16 we renamed it to + log-bin-trust-function-creators but kept also the old name for + compatibility; the behaviour was also changed to apply only to functions + (and triggers). In a future release this old name could be removed. + */ + {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, + "(deprecated) Use log-bin-trust-function-creators.", + (gptr*) &trust_function_creators, (gptr*) &trust_function_creators, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif /* This option starts with "log-bin" to emphasize that it is specific of - binary logging. Hopefully in 5.1 nobody will need it anymore, when we have - row-level binlog. + binary logging. */ - {"log-bin-trust-routine-creators", OPT_LOG_BIN_TRUST_ROUTINE_CREATORS, + {"log-bin-trust-function-creators", OPT_LOG_BIN_TRUST_FUNCTION_CREATORS, "If equal to 0 (the default), then when --log-bin is used, creation of " - "a routine is allowed only to users having the SUPER privilege and only" - "if this routine may not break binary logging", - (gptr*) &trust_routine_creators, (gptr*) &trust_routine_creators, 0, + "a function is allowed only to users having the SUPER privilege and only " + "if this function may not break binary logging.", + (gptr*) &trust_function_creators, (gptr*) &trust_function_creators, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"log-error", OPT_ERROR_LOG_FILE, "Error log file.", (gptr*) &log_error_file_ptr, (gptr*) &log_error_file_ptr, 0, GET_STR, @@ -5725,7 +5736,7 @@ The minimum value for this variable is 4096.", (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, {"read_only", OPT_READONLY, - "Make all tables readonly, with the exception for replication (slave) threads and users with the SUPER privilege", + "Make all non-temporary tables read-only, with the exception for replication (slave) threads and users with the SUPER privilege", (gptr*) &opt_readonly, (gptr*) &opt_readonly, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0}, |