Commit 590d769e authored by unknown's avatar unknown

Deprecated the update log (Sprint task #792). Now --log-update

just turns on --log-bin and prints a warning. SQL_LOG_UPDATE
is handled in two ways (see mysqld.cc for comments).


include/mysqld_error.h:
  deprecated update log
sql/log.cc:
  deprecated update log
sql/mysqld.cc:
  deprecated update log
sql/set_var.cc:
  deprecated update log
sql/share/czech/errmsg.txt:
  deprecated update log
sql/share/danish/errmsg.txt:
  deprecated update log
sql/share/dutch/errmsg.txt:
  deprecated update log
sql/share/english/errmsg.txt:
  deprecated update log
sql/share/estonian/errmsg.txt:
  deprecated update log
sql/share/french/errmsg.txt:
  deprecated update log
sql/share/german/errmsg.txt:
  deprecated update log
sql/share/greek/errmsg.txt:
  deprecated update log
sql/share/hungarian/errmsg.txt:
  deprecated update log
sql/share/italian/errmsg.txt:
  deprecated update log
sql/share/japanese/errmsg.txt:
  deprecated update log
sql/share/korean/errmsg.txt:
  deprecated update log
sql/share/norwegian-ny/errmsg.txt:
  deprecated update log
sql/share/norwegian/errmsg.txt:
  deprecated update log
sql/share/polish/errmsg.txt:
  deprecated update log
sql/share/portuguese/errmsg.txt:
  deprecated update log
sql/share/romanian/errmsg.txt:
  deprecated update log
sql/share/russian/errmsg.txt:
  deprecated update log
sql/share/serbian/errmsg.txt:
  deprecated update log
sql/share/slovak/errmsg.txt:
  deprecated update log
sql/share/spanish/errmsg.txt:
  deprecated update log
sql/share/swedish/errmsg.txt:
  deprecated update log
sql/share/ukrainian/errmsg.txt:
  deprecated update log
sql/sql_acl.cc:
  deprecated update log
sql/sql_db.cc:
  deprecated update log
sql/sql_delete.cc:
  deprecated update log
sql/sql_insert.cc:
  deprecated update log
sql/sql_load.cc:
  deprecated update log
sql/sql_parse.cc:
  deprecated update log
sql/sql_rename.cc:
  deprecated update log
sql/sql_table.cc:
  deprecated update log
sql/sql_update.cc:
  deprecated update log
parent 60e7ad75
...@@ -282,4 +282,6 @@ ...@@ -282,4 +282,6 @@
#define ER_SP_BADSELECT 1263 #define ER_SP_BADSELECT 1263
#define ER_SP_BADRETURN 1264 #define ER_SP_BADRETURN 1264
#define ER_SP_BADQUERY 1265 #define ER_SP_BADQUERY 1265
#define ER_ERROR_MESSAGES 266 #define ER_UPDATE_LOG_DEPRECATED_IGNORED 1266
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1267
#define ER_ERROR_MESSAGES 268
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <m_ctype.h> // For test_if_number #include <m_ctype.h> // For test_if_number
MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; MYSQL_LOG mysql_log, mysql_slow_log, mysql_bin_log;
extern I_List<i_string> binlog_do_db, binlog_ignore_db; extern I_List<i_string> binlog_do_db, binlog_ignore_db;
static bool test_if_number(const char *str, static bool test_if_number(const char *str,
...@@ -1020,7 +1020,7 @@ err: ...@@ -1020,7 +1020,7 @@ err:
/* /*
Write to normal (not rotable) log Write to normal (not rotable) log
This is the format for the 'normal', 'slow' and 'update' logs. This is the format for the 'normal' log.
*/ */
bool MYSQL_LOG::write(THD *thd,enum enum_server_command command, bool MYSQL_LOG::write(THD *thd,enum enum_server_command command,
...@@ -1392,8 +1392,7 @@ err: ...@@ -1392,8 +1392,7 @@ err:
/* /*
Write update log in a format suitable for incremental backup Write to the slow query log.
This is also used by the slow query log.
*/ */
bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
...@@ -1409,12 +1408,6 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, ...@@ -1409,12 +1408,6 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length,
int tmp_errno=0; int tmp_errno=0;
char buff[80],*end; char buff[80],*end;
end=buff; end=buff;
if (!(thd->options & OPTION_UPDATE_LOG) &&
(thd->master_access & SUPER_ACL))
{
VOID(pthread_mutex_unlock(&LOCK_log));
return 0;
}
if ((specialflag & SPECIAL_LONG_LOG_FORMAT) || query_start_arg) if ((specialflag & SPECIAL_LONG_LOG_FORMAT) || query_start_arg)
{ {
current_time=time(NULL); current_time=time(NULL);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "sql_repl.h" #include "sql_repl.h"
#include "repl_failsafe.h" #include "repl_failsafe.h"
#include "stacktrace.h" #include "stacktrace.h"
#include "mysys_err.h"
#ifdef HAVE_BERKELEY_DB #ifdef HAVE_BERKELEY_DB
#include "ha_berkeley.h" #include "ha_berkeley.h"
#endif #endif
...@@ -345,7 +346,7 @@ uint mysql_port; ...@@ -345,7 +346,7 @@ uint mysql_port;
uint test_flags = 0, select_errors=0, dropping_tables=0,ha_open_options=0; uint test_flags = 0, select_errors=0, dropping_tables=0,ha_open_options=0;
uint volatile thread_count=0, thread_running=0, kill_cached_threads=0, uint volatile thread_count=0, thread_running=0, kill_cached_threads=0,
wake_thread=0; wake_thread=0;
ulong thd_startup_options=(OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL | ulong thd_startup_options=(OPTION_AUTO_IS_NULL |
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE ); OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE );
uint protocol_version=PROTOCOL_VERSION; uint protocol_version=PROTOCOL_VERSION;
struct system_variables global_system_variables; struct system_variables global_system_variables;
...@@ -911,7 +912,6 @@ void clean_up(bool print_message) ...@@ -911,7 +912,6 @@ void clean_up(bool print_message)
mysql_log.cleanup(); mysql_log.cleanup();
mysql_slow_log.cleanup(); mysql_slow_log.cleanup();
mysql_update_log.cleanup();
mysql_bin_log.cleanup(); mysql_bin_log.cleanup();
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
...@@ -2177,9 +2177,55 @@ static int init_server_components() ...@@ -2177,9 +2177,55 @@ static int init_server_components()
LOG_NORMAL); LOG_NORMAL);
if (opt_update_log) if (opt_update_log)
{ {
open_log(&mysql_update_log, glob_hostname, opt_update_logname, "", /*
NullS, LOG_NEW); Update log is removed since 5.0. But we still accept the option.
using_update_log=1; The idea is if the user already uses the binlog and the update log,
we completely ignore any option/variable related to the update log, like
if the update log did not exist. But if the user uses only the update log,
then we translate everything into binlog for him (with warnings).
Implementation of the above :
- If mysqld is started with --log-update and --log-bin,
ignore --log-update (print a warning), push a warning when SQL_LOG_UPDATE
is used, and turn off --sql-bin-update-same.
This will completely ignore SQL_LOG_UPDATE
- If mysqld is started with --log-update only,
change it to --log-bin (with the filename passed to log-update,
plus '-bin') (print a warning), push a warning when SQL_LOG_UPDATE is
used, and turn on --sql-bin-update-same.
This will translate SQL_LOG_UPDATE to SQL_LOG_BIN.
Note that we tell the user that --sql-bin-update-same is deprecated and
does nothing, and we don't take into account if he used this option or
not; but internally we give this variable a value to have the behaviour we
want (i.e. have SQL_LOG_UPDATE influence SQL_LOG_BIN or not).
As sql-bin-update-same, log-update and log-bin cannot be changed by the user
after starting the server (they are not variables), the user will not
later interfere with the settings we do here.
*/
if (opt_bin_log)
{
opt_sql_bin_update= 0;
sql_print_error("The update log is no longer supported by MySQL in \
version 5.0 and above. It is replaced by the binary log.");
}
else
{
opt_sql_bin_update= 1;
opt_bin_log= 1;
if (opt_update_logname)
{
// as opt_bin_log==0, no need to free opt_bin_logname
if (!(opt_bin_logname= my_strdup(opt_update_logname, MYF(MY_WME))))
exit(EXIT_OUT_OF_MEMORY);
sql_print_error("The update log is no longer supported by MySQL in \
version 5.0 and above. It is replaced by the binary log. Now starting MySQL \
with --log-bin='%s' instead.",opt_bin_logname);
}
else
sql_print_error("The update log is no longer supported by MySQL in \
version 5.0 and above. It is replaced by the binary log. Now starting MySQL \
with --log-bin instead.");
}
} }
if (opt_slow_log) if (opt_slow_log)
open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log", open_log(&mysql_slow_log, glob_hostname, opt_slow_logname, "-slow.log",
...@@ -3659,7 +3705,8 @@ struct my_option my_long_options[] = ...@@ -3659,7 +3705,8 @@ struct my_option my_long_options[] =
(gptr*) &myisam_log_filename, (gptr*) &myisam_log_filename, 0, GET_STR, (gptr*) &myisam_log_filename, (gptr*) &myisam_log_filename, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0}, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-update", OPT_UPDATE_LOG, {"log-update", OPT_UPDATE_LOG,
"Log updates to file.# where # is a unique number if not given.", "The update log is deprecated since version 5.0, is replaced by the binary \
log and this option justs turns on --log-bin instead.",
(gptr*) &opt_update_logname, (gptr*) &opt_update_logname, 0, GET_STR, (gptr*) &opt_update_logname, (gptr*) &opt_update_logname, 0, GET_STR,
OPT_ARG, 0, 0, 0, 0, 0, 0}, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"log-slow-queries", OPT_SLOW_QUERY_LOG, {"log-slow-queries", OPT_SLOW_QUERY_LOG,
...@@ -3910,9 +3957,9 @@ struct my_option my_long_options[] = ...@@ -3910,9 +3957,9 @@ struct my_option my_long_options[] =
(gptr*) &mysql_unix_port, (gptr*) &mysql_unix_port, 0, GET_STR, (gptr*) &mysql_unix_port, (gptr*) &mysql_unix_port, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME, {"sql-bin-update-same", OPT_SQL_BIN_UPDATE_SAME,
"If set, setting SQL_LOG_BIN to a value will automatically set SQL_LOG_UPDATE to the same value and vice versa.", "The update log is deprecated since version 5.0, is replaced by the binary \
(gptr*) &opt_sql_bin_update, (gptr*) &opt_sql_bin_update, 0, GET_BOOL, log and this option does nothing anymore.",
NO_ARG, 0, 0, 0, 0, 0, 0}, 0, 0, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"sql-mode", OPT_SQL_MODE, {"sql-mode", OPT_SQL_MODE,
"Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, SERIALIZE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.", "Syntax: sql-mode=option[,option[,option...]] where option can be one of: REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, SERIALIZE, ONLY_FULL_GROUP_BY, NO_UNSIGNED_SUBTRACTION.",
(gptr*) &sql_mode_str, (gptr*) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0, (gptr*) &sql_mode_str, (gptr*) &sql_mode_str, 0, GET_STR, REQUIRED_ARG, 0,
......
...@@ -78,6 +78,7 @@ static void sys_set_default_charset(THD *thd, enum_var_type type); ...@@ -78,6 +78,7 @@ static void sys_set_default_charset(THD *thd, enum_var_type type);
static bool set_option_bit(THD *thd, set_var *var); static bool set_option_bit(THD *thd, set_var *var);
static bool set_option_autocommit(THD *thd, set_var *var); static bool set_option_autocommit(THD *thd, set_var *var);
static bool set_log_update(THD *thd, set_var *var); static bool set_log_update(THD *thd, set_var *var);
static bool set_log_bin(THD *thd, set_var *var);
static void fix_low_priority_updates(THD *thd, enum_var_type type); static void fix_low_priority_updates(THD *thd, enum_var_type type);
static void fix_tx_isolation(THD *thd, enum_var_type type); static void fix_tx_isolation(THD *thd, enum_var_type type);
static void fix_net_read_timeout(THD *thd, enum_var_type type); static void fix_net_read_timeout(THD *thd, enum_var_type type);
...@@ -265,7 +266,7 @@ static sys_var_thd_bit sys_log_update("sql_log_update", ...@@ -265,7 +266,7 @@ static sys_var_thd_bit sys_log_update("sql_log_update",
set_log_update, set_log_update,
OPTION_UPDATE_LOG); OPTION_UPDATE_LOG);
static sys_var_thd_bit sys_log_binlog("sql_log_bin", static sys_var_thd_bit sys_log_binlog("sql_log_bin",
set_log_update, set_log_bin,
OPTION_BIN_LOG); OPTION_BIN_LOG);
static sys_var_thd_bit sys_sql_warnings("sql_warnings", static sys_var_thd_bit sys_sql_warnings("sql_warnings",
set_option_bit, set_option_bit,
...@@ -1363,6 +1364,30 @@ static bool set_option_autocommit(THD *thd, set_var *var) ...@@ -1363,6 +1364,30 @@ static bool set_option_autocommit(THD *thd, set_var *var)
static bool set_log_update(THD *thd, set_var *var) static bool set_log_update(THD *thd, set_var *var)
{
/*
The update log is not supported anymore since 5.0.
See sql/mysqld.cc/, comments in function init_server_components() for an
explaination of the different warnings we send below
*/
if (opt_sql_bin_update)
{
((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG |
OPTION_UPDATE_LOG);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_UPDATE_LOG_DEPRECATED_TRANSLATED,
ER(ER_UPDATE_LOG_DEPRECATED_TRANSLATED));
}
else
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_UPDATE_LOG_DEPRECATED_IGNORED,
ER(ER_UPDATE_LOG_DEPRECATED_IGNORED));
set_option_bit(thd, var);
return 0;
}
static bool set_log_bin(THD *thd, set_var *var)
{ {
if (opt_sql_bin_update) if (opt_sql_bin_update)
((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG | ((sys_var_thd_bit*) var->var)->bit_flag|= (OPTION_BIN_LOG |
...@@ -1371,6 +1396,7 @@ static bool set_log_update(THD *thd, set_var *var) ...@@ -1371,6 +1396,7 @@ static bool set_log_update(THD *thd, set_var *var)
return 0; return 0;
} }
static byte *get_warning_count(THD *thd) static byte *get_warning_count(THD *thd)
{ {
thd->sys_var_tmp.long_value= thd->sys_var_tmp.long_value=
......
...@@ -276,3 +276,5 @@ v/* ...@@ -276,3 +276,5 @@ v/*
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -270,3 +270,5 @@ ...@@ -270,3 +270,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -278,3 +278,5 @@ ...@@ -278,3 +278,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -272,3 +272,5 @@ ...@@ -272,3 +272,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -277,3 +277,5 @@ ...@@ -277,3 +277,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -269,3 +269,5 @@ ...@@ -269,3 +269,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -269,3 +269,5 @@ ...@@ -269,3 +269,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -269,3 +269,5 @@ ...@@ -269,3 +269,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -269,3 +269,5 @@ ...@@ -269,3 +269,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -271,3 +271,5 @@ ...@@ -271,3 +271,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -271,3 +271,5 @@ ...@@ -271,3 +271,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -269,3 +269,5 @@ ...@@ -269,3 +269,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -263,3 +263,5 @@ ...@@ -263,3 +263,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -275,3 +275,5 @@ ...@@ -275,3 +275,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -268,3 +268,5 @@ ...@@ -268,3 +268,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -267,3 +267,5 @@ ...@@ -267,3 +267,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -272,3 +272,5 @@ ...@@ -272,3 +272,5 @@
"SELECT in a stored procedure must have INTO" "SELECT in a stored procedure must have INTO"
"RETURN is only allowed in a FUNCTION" "RETURN is only allowed in a FUNCTION"
"Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION" "Queries, like SELECT, INSERT, UPDATE (and others), are not allowed in a FUNCTION"
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been ignored."
"The update log is deprecated and replaced by the binary log. SET SQL_LOG_UPDATE has been translated to SET SQL_LOG_BIN."
...@@ -1161,7 +1161,6 @@ bool change_password(THD *thd, const char *host, const char *user, ...@@ -1161,7 +1161,6 @@ bool change_password(THD *thd, const char *host, const char *user,
acl_user->user ? acl_user->user : "", acl_user->user ? acl_user->user : "",
acl_user->host.hostname ? acl_user->host.hostname : "", acl_user->host.hostname ? acl_user->host.hostname : "",
new_password)); new_password));
mysql_update_log.write(thd, buff, query_length);
Query_log_event qinfo(thd, buff, query_length, 0); Query_log_event qinfo(thd, buff, query_length, 0);
mysql_bin_log.write(&qinfo); mysql_bin_log.write(&qinfo);
DBUG_RETURN(0); DBUG_RETURN(0);
......
...@@ -231,7 +231,6 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, ...@@ -231,7 +231,6 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
query= thd->query; query= thd->query;
query_length= thd->query_length; query_length= thd->query_length;
} }
mysql_update_log.write(thd, query, query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, query, query_length, 0); Query_log_event qinfo(thd, query, query_length, 0);
...@@ -283,7 +282,6 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) ...@@ -283,7 +282,6 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info)
create_info->table_charset : default_charset_info; create_info->table_charset : default_charset_info;
} }
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
...@@ -369,7 +367,6 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) ...@@ -369,7 +367,6 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
query=thd->query; query=thd->query;
query_length=thd->query_length; query_length=thd->query_length;
} }
mysql_update_log.write(thd, query, query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, query, query_length, 0); Query_log_event qinfo(thd, query, query_length, 0);
......
...@@ -179,7 +179,6 @@ cleanup: ...@@ -179,7 +179,6 @@ cleanup:
log_delayed= (transactional_table || table->tmp_table); log_delayed= (transactional_table || table->tmp_table);
if (deleted && (error <= 0 || !transactional_table)) if (deleted && (error <= 0 || !transactional_table))
{ {
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
...@@ -486,7 +485,6 @@ bool multi_delete::send_eof() ...@@ -486,7 +485,6 @@ bool multi_delete::send_eof()
*/ */
if (deleted && (error <= 0 || normal_tables)) if (deleted && (error <= 0 || normal_tables))
{ {
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
...@@ -601,7 +599,6 @@ end: ...@@ -601,7 +599,6 @@ end:
{ {
if (!error) if (!error)
{ {
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
static int check_null_fields(THD *thd,TABLE *entry); static int check_null_fields(THD *thd,TABLE *entry);
static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list); static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list);
static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup,
char *query, uint query_length, int log_on); char *query, uint query_length, bool log_on);
static void end_delayed_insert(THD *thd); static void end_delayed_insert(THD *thd);
extern "C" pthread_handler_decl(handle_delayed_insert,arg); extern "C" pthread_handler_decl(handle_delayed_insert,arg);
static void unlink_blobs(register TABLE *table); static void unlink_blobs(register TABLE *table);
...@@ -38,9 +38,6 @@ static void unlink_blobs(register TABLE *table); ...@@ -38,9 +38,6 @@ static void unlink_blobs(register TABLE *table);
#define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0)) #define my_safe_afree(ptr, size, min_length) if (size > min_length) my_free(ptr,MYF(0))
#endif #endif
#define DELAYED_LOG_UPDATE 1
#define DELAYED_LOG_BIN 2
/* /*
Check if insert fields are correct Check if insert fields are correct
Updates table->time_stamp to point to timestamp field or 0, depending on Updates table->time_stamp to point to timestamp field or 0, depending on
...@@ -114,8 +111,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -114,8 +111,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
By default, both logs are enabled (this won't cause problems if the server By default, both logs are enabled (this won't cause problems if the server
runs without --log-update or --log-bin). runs without --log-update or --log-bin).
*/ */
int log_on= DELAYED_LOG_UPDATE | DELAYED_LOG_BIN ; bool log_on= (!(thd->master_access & SUPER_ACL)) || (thd->options & OPTION_BIN_LOG);
bool transactional_table, log_delayed, bulk_insert; bool transactional_table, log_delayed, bulk_insert;
uint value_count; uint value_count;
ulong counter = 1; ulong counter = 1;
...@@ -130,14 +126,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -130,14 +126,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->lex.select_lex.table_list.first; thd->lex.select_lex.table_list.first;
DBUG_ENTER("mysql_insert"); DBUG_ENTER("mysql_insert");
if (thd->master_access & SUPER_ACL)
{
if (!(thd->options & OPTION_UPDATE_LOG))
log_on&= ~(int) DELAYED_LOG_UPDATE;
if (!(thd->options & OPTION_BIN_LOG))
log_on&= ~(int) DELAYED_LOG_BIN;
}
/* /*
in safe mode or with skip-new change delayed insert to be regular in safe mode or with skip-new change delayed insert to be regular
if we are told to replace duplicates, the insert cannot be concurrent if we are told to replace duplicates, the insert cannot be concurrent
...@@ -338,7 +326,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, ...@@ -338,7 +326,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
log_delayed= (transactional_table || table->tmp_table); log_delayed= (transactional_table || table->tmp_table);
if ((info.copied || info.deleted) && (error <= 0 || !transactional_table)) if ((info.copied || info.deleted) && (error <= 0 || !transactional_table))
{ {
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
...@@ -562,13 +549,12 @@ public: ...@@ -562,13 +549,12 @@ public:
char *record,*query; char *record,*query;
enum_duplicates dup; enum_duplicates dup;
time_t start_time; time_t start_time;
bool query_start_used,last_insert_id_used,insert_id_used; bool query_start_used,last_insert_id_used,insert_id_used, log_query;
int log_query;
ulonglong last_insert_id; ulonglong last_insert_id;
ulong time_stamp; ulong time_stamp;
uint query_length; uint query_length;
delayed_row(enum_duplicates dup_arg, int log_query_arg) delayed_row(enum_duplicates dup_arg, bool log_query_arg)
:record(0),query(0),dup(dup_arg),log_query(log_query_arg) {} :record(0),query(0),dup(dup_arg),log_query(log_query_arg) {}
~delayed_row() ~delayed_row()
{ {
...@@ -871,7 +857,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) ...@@ -871,7 +857,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
/* Put a question in queue */ /* Put a question in queue */
static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic,
char *query, uint query_length, int log_on) char *query, uint query_length, bool log_on)
{ {
delayed_row *row=0; delayed_row *row=0;
delayed_insert *di=thd->di; delayed_insert *di=thd->di;
...@@ -1258,16 +1244,11 @@ bool delayed_insert::handle_inserts(void) ...@@ -1258,16 +1244,11 @@ bool delayed_insert::handle_inserts(void)
using_ignore=0; using_ignore=0;
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
} }
if (row->query) if (row->query && row->log_query && using_bin_log)
{
if (row->log_query & DELAYED_LOG_UPDATE)
mysql_update_log.write(&thd,row->query, row->query_length);
if (row->log_query & DELAYED_LOG_BIN && using_bin_log)
{ {
Query_log_event qinfo(&thd, row->query, row->query_length,0); Query_log_event qinfo(&thd, row->query, row->query_length,0);
mysql_bin_log.write(&qinfo); mysql_bin_log.write(&qinfo);
} }
}
if (table->blob_fields) if (table->blob_fields)
free_delayed_insert_blobs(table); free_delayed_insert_blobs(table);
thread_safe_sub(delayed_rows_in_use,1,&LOCK_delayed_status); thread_safe_sub(delayed_rows_in_use,1,&LOCK_delayed_status);
...@@ -1449,7 +1430,6 @@ bool select_insert::send_eof() ...@@ -1449,7 +1430,6 @@ bool select_insert::send_eof()
if (last_insert_id) if (last_insert_id)
thd->insert_id(last_insert_id); // For update log thd->insert_id(last_insert_id); // For update log
::send_ok(thd,info.copied,last_insert_id,buff); ::send_ok(thd,info.copied,last_insert_id,buff);
mysql_update_log.write(thd,thd->query,thd->query_length);
return 0; return 0;
} }
} }
......
...@@ -315,9 +315,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, ...@@ -315,9 +315,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
sprintf(name,ER(ER_LOAD_INFO),info.records,info.deleted, sprintf(name,ER(ER_LOAD_INFO),info.records,info.deleted,
info.records-info.copied,thd->cuted_fields); info.records-info.copied,thd->cuted_fields);
send_ok(thd,info.copied+info.deleted,0L,name); send_ok(thd,info.copied+info.deleted,0L,name);
// on the slave thd->query is never initialized
if (!thd->slave_thread)
mysql_update_log.write(thd,thd->query,thd->query_length);
if (!log_delayed) if (!log_delayed)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE; thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
......
...@@ -2861,16 +2861,13 @@ mysql_execute_command(THD *thd) ...@@ -2861,16 +2861,13 @@ mysql_execute_command(THD *thd)
goto error; goto error;
if (!(res = mysql_table_grant(thd,tables,lex->users_list, lex->columns, if (!(res = mysql_table_grant(thd,tables,lex->users_list, lex->columns,
lex->grant, lex->grant,
lex->sql_command == SQLCOM_REVOKE))) lex->sql_command == SQLCOM_REVOKE)) &&
{ mysql_bin_log.is_open())
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
mysql_bin_log.write(&qinfo); mysql_bin_log.write(&qinfo);
} }
} }
}
else else
{ {
if (lex->columns.elements) if (lex->columns.elements)
...@@ -2883,7 +2880,6 @@ mysql_execute_command(THD *thd) ...@@ -2883,7 +2880,6 @@ mysql_execute_command(THD *thd)
lex->sql_command == SQLCOM_REVOKE); lex->sql_command == SQLCOM_REVOKE);
if (!res) if (!res)
{ {
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
...@@ -4114,7 +4110,6 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) ...@@ -4114,7 +4110,6 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables)
if (options & REFRESH_LOG) if (options & REFRESH_LOG)
{ {
mysql_log.new_file(1); mysql_log.new_file(1);
mysql_update_log.new_file(1);
mysql_bin_log.new_file(1); mysql_bin_log.new_file(1);
#ifdef HAVE_REPLICATION #ifdef HAVE_REPLICATION
if (expire_logs_days) if (expire_logs_days)
......
...@@ -79,7 +79,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) ...@@ -79,7 +79,6 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
/* Lets hope this doesn't fail as the result will be messy */ /* Lets hope this doesn't fail as the result will be messy */
if (!error) if (!error)
{ {
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
......
...@@ -255,17 +255,13 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, ...@@ -255,17 +255,13 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (some_tables_deleted || tmp_table_deleted) if (some_tables_deleted || tmp_table_deleted)
{ {
query_cache_invalidate3(thd, tables, 0); query_cache_invalidate3(thd, tables, 0);
if (!dont_log_query) if (!dont_log_query && mysql_bin_log.is_open())
{
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
tmp_table_deleted && !some_tables_deleted); tmp_table_deleted && !some_tables_deleted);
mysql_bin_log.write(&qinfo); mysql_bin_log.write(&qinfo);
} }
} }
}
unlock_table_names(thd, tables); unlock_table_names(thd, tables);
error= 0; error= 0;
...@@ -908,18 +904,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, ...@@ -908,18 +904,14 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
} }
thd->tmp_table_used= 1; thd->tmp_table_used= 1;
} }
if (!tmp_table && !no_log) if (!tmp_table && !no_log && mysql_bin_log.is_open())
{
// Must be written before unlock // Must be written before unlock
mysql_update_log.write(thd,thd->query, thd->query_length);
if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
test(create_info->options & test(create_info->options &
HA_LEX_CREATE_TMP_TABLE)); HA_LEX_CREATE_TMP_TABLE));
mysql_bin_log.write(&qinfo); mysql_bin_log.write(&qinfo);
} }
}
error=0; error=0;
end: end:
VOID(pthread_mutex_unlock(&LOCK_open)); VOID(pthread_mutex_unlock(&LOCK_open));
...@@ -1742,7 +1734,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -1742,7 +1734,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
} }
if (!error) if (!error)
{ {
mysql_update_log.write(thd, thd->query, thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
...@@ -2123,7 +2114,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -2123,7 +2114,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_free((gptr) new_table,MYF(0)); my_free((gptr) new_table,MYF(0));
goto err; goto err;
} }
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
...@@ -2252,7 +2242,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -2252,7 +2242,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err; goto err;
} }
thd->proc_info="end"; thd->proc_info="end";
mysql_update_log.write(thd, thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, 0); Query_log_event qinfo(thd, thd->query, thd->query_length, 0);
......
...@@ -323,7 +323,6 @@ int mysql_update(THD *thd, ...@@ -323,7 +323,6 @@ int mysql_update(THD *thd,
log_delayed= (transactional_table || table->tmp_table); log_delayed= (transactional_table || table->tmp_table);
if (updated && (error <= 0 || !transactional_table)) if (updated && (error <= 0 || !transactional_table))
{ {
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
...@@ -932,7 +931,6 @@ bool multi_update::send_eof() ...@@ -932,7 +931,6 @@ bool multi_update::send_eof()
if (updated && (local_error <= 0 || !trans_safe)) if (updated && (local_error <= 0 || !trans_safe))
{ {
mysql_update_log.write(thd,thd->query,thd->query_length);
if (mysql_bin_log.is_open()) if (mysql_bin_log.is_open())
{ {
Query_log_event qinfo(thd, thd->query, thd->query_length, Query_log_event qinfo(thd, thd->query, thd->query_length,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment