From 19b678eefe59529761691ddebece604107dcb42b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 16 Sep 2000 04:27:21 +0300 Subject: Faster log::write() call, memory leak fix, flush master fix. BUILD/compile-alpha-ccc: remove deps to get things to compile better Docs/manual.texi: Small fixes configure.in: Fix for mlockmem() include/my_sys.h: Made key_cache_inited global myisammrg/myrg_close.c: Fixed memory leak myisammrg/myrg_open.c: Initialize queue to avoid memory leak bug mysys/mf_format.c: Added overflow check mysys/mf_keycache.c: Made key_cache_init more secure to use mysys/my_static.h: Make key_cache_inite global sql/ChangeLog: Changes sql/lock.cc: Added logging of locktime sql/log.cc: Added logging of locktime sql/mysql_priv.h: Added locked_in_memory sql/mysqld.cc: Added logging of locktime + locked in memory sql/sql_acl.cc: Added thd to log::write() for faster call sql/sql_base.cc: Use global key_cache variable sql/sql_class.cc: Added result row counting sql/sql_class.h: Added thd to log::write() for faster call sql/sql_db.cc: Added thd to log::write() for faster call sql/sql_delete.cc: Added thd to log::write() for faster call sql/sql_insert.cc: Added thd to log::write() for faster call sql/sql_load.cc: Added thd to log::write() for faster call sql/sql_parse.cc: Added thd to log::write() for faster call sql/sql_rename.cc: Added thd to log::write() for faster call sql/sql_table.cc: Added thd to log::write() for faster call sql/sql_update.cc: Added thd to log::write() for faster call --- sql/sql_table.cc | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 5a983c8cf06..afd7ebabc53 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -117,9 +117,12 @@ int mysql_rm_table(THD *thd,TABLE_LIST *tables, my_bool if_exists) } if (some_tables_deleted) { - mysql_update_log.write(thd->query,thd->query_length); - Query_log_event qinfo(thd, thd->query); - mysql_bin_log.write(&qinfo); + mysql_update_log.write(thd, thd->query,thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query); + mysql_bin_log.write(&qinfo); + } } VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh @@ -526,9 +529,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, if (!tmp_table && !no_log) { // Must be written before unlock - mysql_update_log.write(thd->query, thd->query_length); - Query_log_event qinfo(thd, thd->query); - mysql_bin_log.write(&qinfo); + mysql_update_log.write(thd,thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query); + mysql_bin_log.write(&qinfo); + } } if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { @@ -966,9 +972,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, VOID(pthread_mutex_unlock(&LOCK_open)); if (!error) { - mysql_update_log.write(thd->query,thd->query_length); - Query_log_event qinfo(thd, thd->query); - mysql_bin_log.write(&qinfo); + mysql_update_log.write(thd, thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query); + mysql_bin_log.write(&qinfo); + } send_ok(&thd->net); } @@ -1257,10 +1266,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, my_free((gptr) new_table,MYF(0)); goto err; } - mysql_update_log.write(thd->query,thd->query_length); - Query_log_event qinfo(thd, thd->query); - mysql_bin_log.write(&qinfo); - + mysql_update_log.write(thd, thd->query,thd->query_length); + if (mysql_bin_log.is_open()) + { + Query_log_event qinfo(thd, thd->query); + mysql_bin_log.write(&qinfo); + } goto end_temporary; DBUG_RETURN(0); } @@ -1364,7 +1375,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } thd->proc_info="end"; - mysql_update_log.write(thd->query,thd->query_length); + mysql_update_log.write(thd, thd->query,thd->query_length); + if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query); mysql_bin_log.write(&qinfo); -- cgit v1.2.1