From 909596e030134e96a4cb403c92ed57570b6b7157 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Apr 2003 19:05:00 +0200 Subject: [PATCH 1/3] - don't add separate debug symbol file to the binary distribution, if it's built with debugging enabled or not stripped (save disk space) --- Build-tools/Do-compile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index add2ac86c81..b83eadcac63 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -276,7 +276,11 @@ if ($opt_stage <= 3) my $flags= ""; log_timestamp(); log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz"); - log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat"); + # No need to add the debug symbols, if the binaries are not stripped (saves space) + unless ($opt_with_debug || $opt_no_strip) + { + log_system("nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz | cat"); + } $flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug); check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created"); From da0844b15fec2629c207dc13f33495f9c40eeb96 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Apr 2003 10:35:13 +0500 Subject: [PATCH 2/3] #244 bugfix (thread stack error message in embedded library) sql/mysql_priv.h: stack checking suppressed in EMBEDDED case sql/sql_parse.cc: code of check_stack_overrun ifdefed --- sql/mysql_priv.h | 5 +++++ sql/sql_parse.cc | 2 ++ 2 files changed, 7 insertions(+) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c6e205f4729..9617d19caae 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -330,7 +330,12 @@ void mysql_execute_command(void); bool do_command(THD *thd); bool dispatch_command(enum enum_server_command command, THD *thd, char* packet, uint packet_length); +#ifndef EMBEDDED_LIBRARY bool check_stack_overrun(THD *thd,char *dummy); +#else +#define check_stack_overrun(A, B) 0 +#endif + bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables); void table_cache_init(void); void table_cache_free(void); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9e222c4f944..0ffdb68a179 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2697,6 +2697,7 @@ static bool check_merge_table_access(THD *thd, char *db, #define used_stack(A,B) (long) (B - A) #endif +#ifndef EMBEDDED_LIBRARY bool check_stack_overrun(THD *thd,char *buf __attribute__((unused))) { long stack_used; @@ -2710,6 +2711,7 @@ bool check_stack_overrun(THD *thd,char *buf __attribute__((unused))) } return 0; } +#endif /* EMBEDDED_LIBRARY */ #define MY_YACC_INIT 1000 // Start with big alloc #define MY_YACC_MAX 32000 // Because of 'short' From 8cad4f7090f50c19a1e0a247c57d9d965b7b7a6e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Apr 2003 15:16:12 +0200 Subject: [PATCH 3/3] fix for #254 (3.23 master, 4.0 slave. Slave loss temp tables everytime FLUSH LOGS on master). This fix is less bad than the bug, it will cause a problem only maybe if the master dies the hard way (I say maybe because I could not cause a problem, and I don't see how it could happen). sql/log_event.cc: fix for #254 (3.23 master, 4.0 slave. Slave loss temp tables everytime FLUSH LOGS on master). This fix is less bad than the bug, it will cause a problem only maybe if the master dies the hard way. (I say maybe because I could not cause a problem, and I don't see how it could happen). --- sql/log_event.cc | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 2040cebf17e..3b499b8d502 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1949,6 +1949,10 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, IMPLEMENTATION - To handle the case where the master died without a stop event, we clean up all temporary tables + locks that we got. + However, we don't clean temporary tables if the master was 3.23 + (this is because a 3.23 master writes a Start_log_event at every + binlog rotation; if we were not careful we would remove temp tables + on the slave when FLUSH LOGS is issued on the master). TODO - Remove all active user locks @@ -1959,13 +1963,18 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, int Start_log_event::exec_event(struct st_relay_log_info* rli) { - /* All temporary tables was deleted on the master */ - close_temporary_tables(thd); - /* - If we have old format, load_tmpdir is cleaned up by the I/O thread - */ if (!rli->mi->old_format) + { + /* + If 4.0 master, all temporary tables have been deleted on the master; + if 3.23 master, this is far from sure. + */ + close_temporary_tables(thd); + /* + If we have old format, load_tmpdir is cleaned up by the I/O thread + */ cleanup_load_tmpdir(); + } return Log_event::exec_event(rli); } @@ -1980,7 +1989,14 @@ int Start_log_event::exec_event(struct st_relay_log_info* rli) int Stop_log_event::exec_event(struct st_relay_log_info* rli) { - // do not clean up immediately after rotate event + /* + do not clean up immediately after rotate event; + QQ: this should be a useless test: the only case when it is false is when + shutdown occured just after FLUSH LOGS. It has nothing to do with Rotate? + By the way, immediately after a Rotate + the I/O thread does not write the Stop to the relay log, + so we won't come here in that case. + */ if (rli->master_log_pos > BIN_LOG_HEADER_SIZE) { close_temporary_tables(thd);