From 852e2b0f0d7d7ef9d1e97df3863afe9b80096663 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Jul 2003 10:12:05 +0300 Subject: Safety and speedup fixes: Changed is_open() to work as before. Added back inited argument to LOG mysql-test/r/rpl_flush_log_loop.result: Fixed results (probably bug in previous rpatch) sql/handler.cc: Changed is_open() to work as before sql/item_func.cc: Changed is_open() to work as before sql/log.cc: Part revert of previous patch. The reason for adding back 'inited' is that is that we can't be 100 % sure that init_pthread_objects() is called before mysqld dies (for example on windows) I removed mutex lock handling in is_open() as the new code didn't have ANY affect except beeing slower. Added back checking of is_open() to some functions as we don't want to do a mutex lock when we are not using logging. Indentation/comment fixes sql/log_event.cc: Changed is_open() to work as before sql/repl_failsafe.cc: Changed is_open() to work as before sql/sql_base.cc: Changed is_open() to work as before sql/sql_class.h: Changed is_open() to work as before. Added back 'inited' variable sql/sql_db.cc: Changed is_open() to work as before sql/sql_delete.cc: Changed is_open() to work as before sql/sql_insert.cc: Changed is_open() to work as before sql/sql_load.cc: Changed is_open() to work as before sql/sql_parse.cc: Changed is_open() to work as before sql/sql_rename.cc: Changed is_open() to work as before sql/sql_repl.cc: Changed is_open() to work as before sql/sql_table.cc: Changed is_open() to work as before sql/sql_update.cc: Changed is_open() to work as before --- sql/sql_insert.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/sql_insert.cc') diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index f94963f2570..167ccf974c7 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -308,7 +308,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List &fields, 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(1)) + if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, log_delayed); @@ -1143,7 +1143,7 @@ bool delayed_insert::handle_inserts(void) { int error; uint max_rows; - bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(1); + bool using_ignore=0, using_bin_log=mysql_bin_log.is_open(); delayed_row *row; DBUG_ENTER("handle_inserts"); @@ -1361,7 +1361,7 @@ void select_insert::send_error(uint errcode,const char *err) if (last_insert_id) thd->insert_id(last_insert_id); // For binary log mysql_update_log.write(thd,thd->query,thd->query_length); - if (mysql_bin_log.is_open(1)) + if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, table->file->has_transactions()); @@ -1387,7 +1387,7 @@ bool select_insert::send_eof() thd->insert_id(last_insert_id); // For binary log /* Write to binlog before commiting transaction */ mysql_update_log.write(thd,thd->query,thd->query_length); - if (mysql_bin_log.is_open(1)) + if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, table->file->has_transactions()); -- cgit v1.2.1