From 1d772c91e063e1a47677ea00a290c51af292c3b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Dec 2007 18:19:35 -0700 Subject: [PATCH 1/6] Bug #32679: mysqld_safe looks for errmsg.sys in wrong path The fix for bug 28544 moved our package data from ./share/mysql to ./share. mysqld_safe had the old directory hard-coded. The fix is to use the @pkgdatadir@ and @prefix@ values, to adapt to different ways of building the package. scripts/make_binary_distribution.sh: Document that our build system explicitly overrides the @pkgfoo@ (e.g., pkgdatadir, pkglibdir, etc.) variables when 'make' is called. scripts/mysqld_safe.sh: Replace hard-coded "./share/mysql" with something like echo @pkgdatadir@ | sed -e s/^@prefix@//. Since the fix for bug 28544, this has been broken for mysql 5.1+, where the package data dir is "./share" instead of "./share/mysql". --- mysql-test/r/bdb_notembedded.result | 35 ++++++++++++++++++++++++++ mysql-test/t/bdb_notembedded.test | 38 +++++++++++++++++++++++++++++ scripts/make_binary_distribution.sh | 3 ++- scripts/mysqld_safe.sh | 15 +++++++++--- 4 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 mysql-test/r/bdb_notembedded.result create mode 100644 mysql-test/t/bdb_notembedded.test diff --git a/mysql-test/r/bdb_notembedded.result b/mysql-test/r/bdb_notembedded.result new file mode 100644 index 00000000000..14cb5fad915 --- /dev/null +++ b/mysql-test/r/bdb_notembedded.result @@ -0,0 +1,35 @@ +set autocommit=1; +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; insert into bug16206 values(2) +drop table bug16206; +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +show binlog events; +Log_name Pos Event_type Server_id End_log_pos Info +f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4 +f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb +f n Query 1 n use `test`; insert into bug16206 values(0) +f n Query 1 n use `test`; insert into bug16206 values(1) +f n Query 1 n use `test`; BEGIN +f n Query 1 n use `test`; insert into bug16206 values(2) +f n Query 1 n use `test`; COMMIT +f n Query 1 n use `test`; insert into bug16206 values(3) +drop table bug16206; +set autocommit=0; +End of 5.0 tests diff --git a/mysql-test/t/bdb_notembedded.test b/mysql-test/t/bdb_notembedded.test new file mode 100644 index 00000000000..24e64ebbfb2 --- /dev/null +++ b/mysql-test/t/bdb_notembedded.test @@ -0,0 +1,38 @@ +-- source include/not_embedded.inc +-- source include/have_bdb.inc + +# +# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode +# +set autocommit=1; + +let $VERSION=`select version()`; + +reset master; +create table bug16206 (a int); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +reset master; +create table bug16206 (a int) engine= bdb; +insert into bug16206 values(0); +insert into bug16206 values(1); +start transaction; +insert into bug16206 values(2); +commit; +insert into bug16206 values(3); +--replace_result $VERSION VERSION +--replace_column 1 f 2 n 5 n +show binlog events; +drop table bug16206; + +set autocommit=0; + + +--echo End of 5.0 tests diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 8d3e2133a45..f7b7f8e5a7e 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -23,7 +23,8 @@ # Note that the structure created by this script is slightly different from # what a normal "make install" would produce. No extra "mysql" sub directory # will be created, i.e. no "$prefix/include/mysql", "$prefix/lib/mysql" or -# "$prefix/share/mysql". +# "$prefix/share/mysql". This is because the build system explicitly calls +# make with pkgdatadir=, etc. # # In GNU make/automake terms # diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 99dcafbbf71..5e7a177a546 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -200,16 +200,24 @@ parse_arguments() { # # First, try to find BASEDIR and ledir (where mysqld is) -# +# + +if echo '@pkgdatadir@' | grep '^@prefix@' > /dev/null +then + relpkgdata=`echo '@pkgdatadir@' | sed -e 's,^@prefix@,,' -e 's,^/,,' -e 's,^,./,'` +else + # pkgdatadir is not relative to prefix + relpkgdata='@pkgdatadir@' +fi MY_PWD=`pwd` # Check for the directories we would expect from a binary release install -if test -f ./share/mysql/english/errmsg.sys -a -x ./bin/mysqld +if test -f "$relpkgdata"/english/errmsg.sys -a -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is # Check for the directories we would expect from a source install -elif test -f ./share/mysql/english/errmsg.sys -a -x ./libexec/mysqld +elif test -f "$relpkgdata"/english/errmsg.sys -a -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is @@ -219,6 +227,7 @@ else ledir=@libexecdir@ fi + # # Second, try to find the data directory # From 07aab86f5f1e25d25b1df2f43264048da86b509e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Dec 2007 19:51:06 +0100 Subject: [PATCH 2/6] scripts/make_binary_distribution.sh: Fix the code to get the "libgcc" file name so that the failure of Intel's ICC to provide this information does not cause any problems. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler scripts/make_binary_distribution.sh: The (old) code to get the "libgcc" file name does not really work when using Intel's ICC. ICC accepts the "--print-libgcc-file" option but ignores it, does not produce any output. However, ICC tricks automake into taking it for a GCC ("GXX" variable is set, see http://www.gnu.org/software/autoconf/manual/html_node/C_002b_002b-Compiler.html#C_002b_002b-Compiler and its discussion of the "AC_PROG_CXX" macro). There are two possible approaches: a) Check "$CC" or "$CXX" to tell ICC from GCC, and do not ask ICC for the "libgcc" file name. b) Just ask it, but protect that code so that its failure does not cause any damage. This patch takes the second route: 1) Put the call "@CC@ ... --print-libgcc-file" into a pipeline, followed by "|| true", so that (for the shell semantics) the command cannot fail. (ICC will exit non-zero because it is not given a source file.) 2) Explicitly redirect any error messages. 3) Do not use the compiler's return code but rather the (non)empty variable to check success. 4) Ensure that the contents really is a file before taking it as a file name. Item 1) is especially important when the tool gets a "set -e" (this happens in 5.1, currently) which would make the failing compiler call a fatal thing. This fixes bug#33536 Option "--print-libgcc-file" does not work with ICC compiler --- scripts/make_binary_distribution.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 917ac0a19c1..24a99df2248 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -322,11 +322,13 @@ BASE=$BASE2 # if [ x"@GXX@" = x"yes" ] ; then - gcclib=`@CC@ @CFLAGS@ --print-libgcc-file` - if [ $? -ne 0 ] ; then - echo "Warning: Couldn't find libgcc.a!" - else + gcclib=`@CC@ @CFLAGS@ --print-libgcc-file 2>/dev/null` || true + if [ -z "$gcclib" ] ; then + echo "Warning: Compiler doesn't tell libgcc.a!" + elif [ -f "$gcclib" ] ; then $CP $gcclib $BASE/lib/libmygcc.a + else + echo "Warning: Compiler result '$gcclib' not found / no file!" fi fi From 68fd74d7644c525bacb41510b1874ba9bc1bce9a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Dec 2007 16:10:17 +0100 Subject: [PATCH 3/6] scripts/make_binary_distribution.sh After-merge fix for bug#33536: The target to copy to is now called "$DEST". scripts/make_binary_distribution.sh: After-merge fix for bug#33536: The target to copy to is now called "$DEST". --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 1e9ec362d76..029679ceec9 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -222,7 +222,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then if [ -z "$gcclib" ] ; then echo "Warning: Compiler doesn't tell libgcc.a!" elif [ -f "$gcclib" ] ; then - $CP $gcclib $BASE/lib/libmygcc.a + $CP $gcclib $DEST/lib/libmygcc.a else echo "Warning: Compiler result '$gcclib' not found / no file!" fi From 16159170b600c7f19f53a812beb6be01e4cfb1b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Jan 2008 15:01:21 +0100 Subject: [PATCH 4/6] Bug#30366 NDB fails to start on OS X, PPC, 64 bit - The errno variable should only be used when the previous socket write failed, it should be regarded as undefined at other times OutputStream.cpp: Only use "errno" after the attempt to write to the socket has failed storage/ndb/src/common/util/OutputStream.cpp: Only use "errno" after the attempt to write to the socket has failed --- storage/ndb/src/common/util/OutputStream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/ndb/src/common/util/OutputStream.cpp b/storage/ndb/src/common/util/OutputStream.cpp index 0943e47e33f..cd619380e5a 100644 --- a/storage/ndb/src/common/util/OutputStream.cpp +++ b/storage/ndb/src/common/util/OutputStream.cpp @@ -62,7 +62,7 @@ SocketOutputStream::print(const char * fmt, ...){ if(ret >= 0) m_timeout_remain-=time; - if(errno==ETIMEDOUT || m_timeout_remain<=0) + if((ret < 0 && errno==ETIMEDOUT) || m_timeout_remain<=0) { m_timedout= true; ret= -1; @@ -84,7 +84,7 @@ SocketOutputStream::println(const char * fmt, ...){ if(ret >= 0) m_timeout_remain-=time; - if (errno==ETIMEDOUT || m_timeout_remain<=0) + if ((ret < 0 && errno==ETIMEDOUT) || m_timeout_remain<=0) { m_timedout= true; ret= -1; From b3233513685b92697e17f1760b9d68da3ab269e9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Jan 2008 17:01:58 +0100 Subject: [PATCH 5/6] Bug#33375 all_set corrupted on table object - make sure to reset the read and write sets handler.cc, log_event.cc: - make sure to reset the read and write sets sql/handler.cc: - make sure to reset the read and write sets sql/log_event.cc: - make sure to reset the read and write sets --- sql/handler.cc | 2 ++ sql/log_event.cc | 20 +++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index a4926071598..3b1667b0d59 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3710,6 +3710,8 @@ int handler::ha_reset() DBUG_ASSERT(inited == NONE); /* Free cache used by filesort */ free_io_cache(table); + /* reset the bitmaps to point to defaults */ + table->default_column_bitmaps(); DBUG_RETURN(reset()); } diff --git a/sql/log_event.cc b/sql/log_event.cc index 00e3dc89f6b..b438bc3f840 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7837,7 +7837,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) { DBUG_PRINT("info",("ha_index_init returns error %d",error)); table->file->print_error(error, MYF(0)); - DBUG_RETURN(error); + goto err; } /* Fill key data for the row */ @@ -7870,7 +7870,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) DBUG_PRINT("info",("no record matching the key found in the table")); table->file->print_error(error, MYF(0)); table->file->ha_index_end(); - DBUG_RETURN(error); + goto err; } /* @@ -7898,7 +7898,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) if (table->key_info->flags & HA_NOSAME) { table->file->ha_index_end(); - DBUG_RETURN(0); + goto ok; } /* @@ -7930,7 +7930,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) DBUG_PRINT("info",("no record matching the given row found")); table->file->print_error(error, MYF(0)); table->file->ha_index_end(); - DBUG_RETURN(error); + goto err; } } @@ -7951,7 +7951,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) DBUG_PRINT("info",("error initializing table scan" " (ha_rnd_init returns %d)",error)); table->file->print_error(error, MYF(0)); - DBUG_RETURN(error); + goto err; } /* Continue until we find the right record or have made a full loop */ @@ -7975,7 +7975,7 @@ int Rows_log_event::find_row(const Relay_log_info *rli) " (rnd_next returns %d)",error)); table->file->print_error(error, MYF(0)); table->file->ha_rnd_end(); - DBUG_RETURN(error); + goto err; } } while (restart_count < 2 && record_compare(table)); @@ -7995,10 +7995,16 @@ int Rows_log_event::find_row(const Relay_log_info *rli) table->file->ha_rnd_end(); DBUG_ASSERT(error == HA_ERR_END_OF_FILE || error == HA_ERR_RECORD_DELETED || error == 0); - DBUG_RETURN(error); + goto err; } +ok: + table->default_column_bitmaps(); DBUG_RETURN(0); + +err: + table->default_column_bitmaps(); + DBUG_RETURN(error); } #endif From 5ade517a49283cd591d5d0389b5ff5b4b932e1d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 29 Jan 2008 21:32:43 +0100 Subject: [PATCH 6/6] Ensure that man pages for "embedded" are included in the source.tar.gz This fixes bug#34145. BUILD/compile-dist: If the call to "configure" does not specify the "embedded" server, all man pages for "embedded" will be deleted: Re-add "--with-embedded-server". This fixes bug#34145. --- BUILD/compile-dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BUILD/compile-dist b/BUILD/compile-dist index d9103e0a419..74690fb0c95 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -39,6 +39,8 @@ then fi # Make sure to enable all features that affect "make dist" +# Remember that configure restricts the man pages to the configured features ! ./configure \ + --with-embedded-server \ --with-ndbcluster make