From 40a7f1d30aea947f2a2e370bcff49a5f5d729807 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jun 2002 20:16:44 -0600 Subject: [PATCH 1/6] spurious binlog error code logging on temp table auto-drop fixed added a new replication test sql/sql_base.cc: f --- mysql-test/r/rpl_alter.result | 4 ++++ mysql-test/t/rpl_alter.test | 21 +++++++++++++++++++++ sql/sql_base.cc | 1 + 3 files changed, 26 insertions(+) create mode 100644 mysql-test/r/rpl_alter.result create mode 100644 mysql-test/t/rpl_alter.test diff --git a/mysql-test/r/rpl_alter.result b/mysql-test/r/rpl_alter.result new file mode 100644 index 00000000000..7883e725e3a --- /dev/null +++ b/mysql-test/r/rpl_alter.result @@ -0,0 +1,4 @@ +n m +1 2 +n +45 diff --git a/mysql-test/t/rpl_alter.test b/mysql-test/t/rpl_alter.test new file mode 100644 index 00000000000..a65605f703e --- /dev/null +++ b/mysql-test/t/rpl_alter.test @@ -0,0 +1,21 @@ +source include/master-slave.inc; +connection master; +use test; +drop database if exists d1; +create database d1; +create table d1.t1 ( n int); +alter table d1.t1 add m int; +insert into d1.t1 values (1,2); +create table d1.t2 (n int); +insert into d1.t2 values (45); +rename table d1.t2 to d1.t3, d1.t1 to d1.t2; +save_master_pos; +connection slave; +sync_with_master; +select * from d1.t2; +select * from d1.t3; +connection master; +drop database d1; +save_master_pos; +connection slave; +sync_with_master; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e4a797efaaf..ee8c1097fb2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -546,6 +546,7 @@ void close_temporary_tables(THD *thd) *--end = 0; // Remove last ',' thd->query_length = (uint)(end-query); Query_log_event qinfo(thd, query); + qinfo.error_code=0; mysql_bin_log.write(&qinfo); thd->query_length = save_query_len; } From 9b4ac8b1c2be75e61efa71cf5c79e9a250d55d6c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jun 2002 17:39:11 +0300 Subject: [PATCH 2/6] Small fix for the instructional message --- scripts/mysql_install_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f7324668bd2..850432fecc7 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -317,8 +317,8 @@ then fi echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "This is done with:" - echo "$bindir/mysqladmin -u root -p password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname -p password 'new-password'" + echo "$bindir/mysqladmin -u root password 'new-password'" + echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." # # Print message about upgrading unless we have created a new db table. From f3d9307262cdf84b07b210ea0d7f8e7d14fdeeb7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jun 2002 12:26:36 +0200 Subject: [PATCH 3/6] Added creation of debug symbols to Build-tools/Do-linux-build Build-tools/Do-linux-build: Create debug symbols so make_binary_distribution adds them to the tarball as well --- Build-tools/Do-linux-build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Build-tools/Do-linux-build b/Build-tools/Do-linux-build index 7a1fc426a30..60cbf3426a8 100755 --- a/Build-tools/Do-linux-build +++ b/Build-tools/Do-linux-build @@ -15,6 +15,7 @@ BUILD/compile-pentium-max $OTHER_LIBC \ --prefix=/usr/local/mysql --with-extra-charset=complex \ --enable-thread-safe-client --enable-local-infile \ --with-server-suffix=-max +nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz scripts/make_binary_distribution make dist Build-tools/Do-rpm --local @@ -22,4 +23,5 @@ BUILD/compile-pentium --with-other-libc=$OTHER_LIBC_DIR \ --with-comment="Official MySQL Binary" \ --prefix=/usr/local/mysql --with-extra-charset=complex \ --enable-thread-safe-client --enable-local-infile +nm -n sql/mysqld | gzip -9 -v 2>&1 > sql/mysqld.sym.gz scripts/make_binary_distribution From f4b230a6c7c90903dd5437607c25b01b4dd528cd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jun 2002 08:54:57 +0200 Subject: [PATCH 4/6] Fixed Build-tools/mysql-copyright-2 to properly replace the copyright header in x86 assemler files instead of eating the whole file Build-tools/mysql-copyright-2: Handle copyright headers in *-x86.s files correctly (they do not use C style comments) --- Build-tools/mysql-copyright-2 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index 5aeb4bb81db..a0d30f308e5 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -89,13 +89,18 @@ sub add_copyright elsif ($ARGV =~ /\.c$/ || $ARGV =~ /\.cc$/ || $ARGV =~ /\.h$/ || - $ARGV =~ /\.yy$/ || - $ARGV =~ /-x86\.s$/) + $ARGV =~ /\.yy$/) { $start_copyright="/* "; $line_copyright= " "; $end_copyright= " */"; } + elsif ($ARGV =~ /-x86\.s$/) + { + $start_copyright="# "; + $line_copyright= "# "; + $end_copyright= ""; + } elsif ($ARGV =~ /\.s$/) { $start_copyright="! "; From 92240b8ca37b80ba29f14f064de9059d9605edee Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jun 2002 09:56:27 +0300 Subject: [PATCH 5/6] Portability fix for HPUX mysys/my_pthread.c: Portability fix BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysys/my_pthread.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 894bad3d0c4..5bc690d4061 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -23,3 +23,4 @@ serg@sergbook.mysql.com sinisa@rhols221.adsl.netsonic.fi zak@balfor.local monty@narttu. +monty@mashka.mysql.fi diff --git a/mysys/my_pthread.c b/mysys/my_pthread.c index b9b05e21375..696b62f8b0e 100644 --- a/mysys/my_pthread.c +++ b/mysys/my_pthread.c @@ -416,8 +416,15 @@ int my_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, struct timespec *abstime) { - int error=pthread_cond_timedwait(cond,mutex,abstime); - return (error == EAGAIN || error == -1) ? ETIMEDOUT : error; + int error=pthread_cond_timedwait(cond, mutex, abstime); + if (error == -1) /* Safety if the lib is fixed */ + { + if (!(error=errno)) + error= ETIMEDOUT; /* Can happen on HPUX */ + } + if (error == EAGAIN) /* Correct errno to Posix */ + error= ETIMEDOUT; + return error; } #endif /* HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT */ From f97e1b6ae19ad9b3d3814edd2475c5a25a7ad9e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jun 2002 15:00:06 +0300 Subject: [PATCH 6/6] Backported fix from 4.0 which caused core dumps for some complex queries. Docs/manual.texi: Fixed example sql/mysqld.cc: Cleanup --- Docs/manual.texi | 2 +- sql/mysqld.cc | 7 ++++--- sql/opt_range.cc | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Docs/manual.texi b/Docs/manual.texi index 353e0727a22..f987ff94f98 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -31150,7 +31150,7 @@ mysql> select TRUNCATE(1.999,1); -> 1.9 mysql> select TRUNCATE(1.999,0); -> 1 -mysql> select TRUNCATE(-1,999,1); +mysql> select TRUNCATE(-1.999,1); -> -1.9 @end example diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 08d0f381534..6aad4848242 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1121,7 +1121,8 @@ void end_thread(THD *thd, bool put_in_cache) inline void kill_broken_server() { /* hack to get around signals ignored in syscalls for problem OS's */ - if (unix_sock == INVALID_SOCKET || (!opt_disable_networking && ip_sock ==INVALID_SOCKET)) + if (unix_sock == INVALID_SOCKET || + (!opt_disable_networking && ip_sock == INVALID_SOCKET)) { select_thread_in_use = 0; kill_server((void*)MYSQL_KILL_SIGNAL); /* never returns */ @@ -1592,8 +1593,8 @@ pthread_handler_decl(handle_shutdown,arg) abort_loop = 1; // unblock select() - so_cancel( ip_sock); - so_cancel( unix_sock); + so_cancel(ip_sock); + so_cancel(unix_sock); return 0; } diff --git a/sql/opt_range.cc b/sql/opt_range.cc index b95b97d670f..42f20c0f767 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1285,7 +1285,8 @@ and_all_keys(SEL_ARG *key1,SEL_ARG *key2,uint clone_flag) } if (key1->type == SEL_ARG::MAYBE_KEY) { - key1->left= &null_element; key1->next=0; + key1->right= key1->left= &null_element; + key1->next= key1->prev= 0; } for (next=key1->first(); next ; next=next->next) {