From 3facc8222e7cb33bf05c47b1b9aec41c42bc6568 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 17 Jun 2008 19:04:10 -0600 Subject: [PATCH 01/10] Bug #37024: Wrong location of messagefiles make_binary_distribution.sh got clobbered by the 5.0 version during a merge. This caused a few packaging problems, including message files put in the wrong place and some missing files. Fix is just to revert back to the 5.1 version from before the merge. Problem introduced in ChangeSet 1.2606.2.1 2008/05/13 15:56:07 kent@kent-amd64.(none) This change was made in the 5.1.25 release clone in BK, but never made it to the main mysql-5.1 BK tree. I am adding it to mysql-5.1 bzr. --- scripts/make_binary_distribution.sh | 449 +++++++++++++++------------- 1 file changed, 237 insertions(+), 212 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 50cff8578c9..0a58f8b8ef1 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -14,36 +14,61 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This is a script to create a TAR or ZIP binary distribution out of a -# built source tree. The output file will be put at the top level of -# the source tree, as "mysql-....{tar.gz,zip}" +############################################################################## # -# The temporary directory path given to "--tmp=" has to be -# absolute and with no spaces. +# This is a script to create a TAR or ZIP binary distribution out of a +# built source tree. The output file will be put at the top level of +# the source tree, as "mysql-....{tar.gz,zip}" +# +# 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". This is because the build system explicitly calls +# make with pkgdatadir=, etc. +# +# In GNU make/automake terms +# +# "pkglibdir" is set to the same as "libdir" +# "pkgincludedir" is set to the same as "includedir" +# "pkgdatadir" is set to the same as "datadir" +# "pkgplugindir" is set to "$pkglibdir/plugin" +# "pkgsuppdir" is set to "@prefix@/support-files", +# normally the same as "datadir" +# +# The temporary directory path given to "--tmp=" has to be +# absolute and with no spaces. +# +# Note that for best result, the original "make" should be done with +# the same arguments as used for "make install" below, especially the +# 'pkglibdir', as the RPATH should to be set correctly. +# +############################################################################## + +############################################################################## +# +# Read the command line arguments that control this script +# +############################################################################## machine=@MACHINE_TYPE@ system=@SYSTEM_TYPE@ -version=@VERSION@ SOURCE=`pwd` CP="cp -p" MV="mv" -STRIP=1 -DEBUG=0 +STRIP=1 # Option ignored SILENT=0 -MACHINE="" PLATFORM="" TMP=/tmp SUFFIX="" -NDBCLUSTER="" +NDBCLUSTER="" # Option ignored for arg do case "$arg" in - --debug) DEBUG=1;; --tmp=*) TMP=`echo "$arg" | sed -e "s;--tmp=;;"` ;; --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;; --no-strip) STRIP=0 ;; - --machine=*) MACHINE=`echo "$arg" | sed -e "s;--machine=;;"` ;; + --machine=*) machine=`echo "$arg" | sed -e "s;--machine=;;"` ;; --platform=*) PLATFORM=`echo "$arg" | sed -e "s;--platform=;;"` ;; --silent) SILENT=1 ;; --with-ndbcluster) NDBCLUSTER=1 ;; @@ -54,53 +79,52 @@ for arg do esac done -# Remove vendor from $system -system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` +# ---------------------------------------------------------------------- +# Adjust "system" output from "uname" to be more human readable +# ---------------------------------------------------------------------- -# Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) -system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` -system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` -system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` -system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` -system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` -system=`echo $system | sed -e 's/osf5.1b/tru64/g'` -system=`echo $system | sed -e 's/linux-gnu/linux/g'` -system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` -system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` +if [ x"$PLATFORM" = x"" ] ; then + # FIXME move this to the build tools + # Remove vendor from $system + system=`echo $system | sed -e 's/[a-z]*-\(.*\)/\1/g'` -if [ x"$MACHINE" != x"" ] ; then - machine=$MACHINE + # Map OS names to "our" OS names (eg. darwin6.8 -> osx10.2) + system=`echo $system | sed -e 's/darwin6.*/osx10.2/g'` + system=`echo $system | sed -e 's/darwin7.*/osx10.3/g'` + system=`echo $system | sed -e 's/darwin8.*/osx10.4/g'` + system=`echo $system | sed -e 's/\(aix4.3\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.1\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.2\).*/\1/g'` + system=`echo $system | sed -e 's/\(aix5.3\).*/\1/g'` + system=`echo $system | sed -e 's/osf5.1b/tru64/g'` + system=`echo $system | sed -e 's/linux-gnu/linux/g'` + system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` + system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` + + PLATFORM="$system-$machine" fi -if [ x"$PLATFORM" != x"" ] ; then - platform="$PLATFORM" -else - platform="$system-$machine" -fi +# Print the platform name for build logs +echo "PLATFORM NAME: $PLATFORM" -# FIXME This should really be integrated with automake and not duplicate the -# installation list. +case $PLATFORM in + *netware*) BASE_SYSTEM="netware" ;; +esac +# Change the distribution to a long descriptive name +NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX + +# ---------------------------------------------------------------------- +# Define BASE, and remove the old BASE directory if any +# ---------------------------------------------------------------------- BASE=$TMP/my_dist$SUFFIX - if [ -d $BASE ] ; then rm -rf $BASE fi -BS="" -BIN_FILES="" -BASE_SYSTEM="any" -MYSQL_SHARE=$BASE/share/mysql - -case $system in - *netware*) - BASE_SYSTEM="netware" - BS=".nlm" - MYSQL_SHARE=$BASE/share - ;; -esac +# ---------------------------------------------------------------------- +# Find the TAR to use +# ---------------------------------------------------------------------- # This is needed to prefer GNU tar over platform tar because that can't # always handle long filenames @@ -127,24 +151,149 @@ which_1 () } tar=`which_1 gnutar gtar` -if [ "$?" = "1" -o x"$tar" = x"" ] ; then +if [ $? -ne 0 -o x"$tar" = x"" ] ; then tar=tar fi +############################################################################## +# +# Handle the Unix/Linux packaging using "make install" +# +############################################################################## + +if [ x"$BASE_SYSTEM" != x"netware" ] ; then + + # ---------------------------------------------------------------------- + # Terminate on any base level error + # ---------------------------------------------------------------------- + set -e + + # ---------------------------------------------------------------------- + # Really ugly, one script, "mysql_install_db", needs prefix set to ".", + # i.e. makes access relative the current directory. This matches + # the documentation, so better not change this. And for another script, + # "mysql.server", we make some relative, others not. + # ---------------------------------------------------------------------- + + cd scripts + rm -f mysql_install_db + @MAKE@ mysql_install_db \ + prefix=. \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=./share \ + localstatedir=./data + cd .. + + cd support-files + rm -f mysql.server + @MAKE@ mysql.server \ + bindir=./bin \ + sbindir=./bin \ + scriptdir=./bin \ + libexecdir=./bin \ + pkgdatadir=@pkgdatadir@ + cd .. + + # ---------------------------------------------------------------------- + # Do a install that we later are to pack. Use the same paths as in + # the build for the relevant directories. + # ---------------------------------------------------------------------- + @MAKE@ DESTDIR=$BASE install \ + pkglibdir=@pkglibdir@ \ + pkgincludedir=@pkgincludedir@ \ + pkgdatadir=@pkgdatadir@ \ + pkgplugindir=@pkgplugindir@ \ + pkgsuppdir=@pkgsuppdir@ \ + mandir=@mandir@ \ + infodir=@infodir@ + + # ---------------------------------------------------------------------- + # Rename top directory, and set DEST to the new directory + # ---------------------------------------------------------------------- + mv $BASE@prefix@ $BASE/$NEW_NAME + DEST=$BASE/$NEW_NAME + + # ---------------------------------------------------------------------- + # If we compiled with gcc, copy libgcc.a to the dist as libmygcc.a + # ---------------------------------------------------------------------- + if [ x"@GXX@" = x"yes" ] ; then + 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 $DEST/lib/libmygcc.a + else + echo "Warning: Compiler result '$gcclib' not found / no file!" + fi + fi + + # FIXME let this script be in "bin/", where it is in the RPMs? + # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html + mkdir $DEST/scripts + mv $DEST/bin/mysql_install_db $DEST/scripts/ + + # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 + + # Copy readme and license files + cp README Docs/INSTALL-BINARY $DEST/ + if [ -f COPYING -a -f EXCEPTIONS-CLIENT ] ; then + cp COPYING EXCEPTIONS-CLIENT $DEST/ + elif [ -f LICENSE.mysql ] ; then + cp LICENSE.mysql $DEST/ + else + echo "ERROR: no license files found" + exit 1 + fi + + # FIXME should be handled by make file, and to other dir + mkdir -p $DEST/bin $DEST/support-files + cp scripts/mysqlaccess.conf $DEST/bin/ + cp support-files/magic $DEST/support-files/ + + # Create empty data directories, set permission (FIXME why?) + mkdir $DEST/data $DEST/data/mysql $DEST/data/test + chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test + + # ---------------------------------------------------------------------- + # Create the result tar file + # ---------------------------------------------------------------------- + + echo "Using $tar to create archive" + OPT=cvf + if [ x$SILENT = x1 ] ; then + OPT=cf + fi + + echo "Creating and compressing archive" + rm -f $NEW_NAME.tar.gz + (cd $BASE ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz + echo "$NEW_NAME.tar.gz created" + + echo "Removing temporary directory" + rm -rf $BASE + exit 0 +fi + + +############################################################################## +# +# Handle the Netware case, until integrated above +# +############################################################################## + +BS=".nlm" +MYSQL_SHARE=$BASE/share + mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ $BASE/mysql-test/suite -if [ $BASE_SYSTEM != "netware" ] ; then - mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ - $BASE/man/man1 $BASE/man/man8 $BASE/data $BASE/data/mysql $BASE/data/test - - chmod o-rwx $BASE/data $BASE/data/* -fi - # Copy files if they exists, warn for those that don't. # Note that when listing files to copy, we might list the file name # twice, once in the directory location where it is built, and a @@ -176,12 +325,13 @@ copyfileto $BASE COPYING COPYING.LIB README Docs/INSTALL-BINARY \ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolveip$BS extra/my_print_defaults$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ - myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \ - myisam/myisam_ftdump$BS \ + storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ + storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ sql/mysqld$BS sql/mysqld-debug$BS \ sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ + client/mysqlslap$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ client/mysqlbinlog$BS client/mysql_upgrade$BS \ @@ -191,42 +341,16 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ "; # Platform-specific bin dir files: -if [ $BASE_SYSTEM = "netware" ] ; then - BIN_FILES="$BIN_FILES \ +BIN_FILES="$BIN_FILES \ netware/mysqld_safe$BS netware/mysql_install_db$BS \ - netware/init_db.sql netware/test_db.sql netware/mysql_explain_log$BS \ + netware/init_db.sql netware/test_db.sql \ netware/mysqlhotcopy$BS netware/libmysql$BS netware/init_secure_db.sql \ "; -# For all other platforms: -else - BIN_FILES="$BIN_FILES \ - server-tools/instance-manager/.libs/mysqlmanager \ - client/mysqltestmanagerc \ - client/mysqltestmanager-pwgen tools/mysqltestmanager \ - client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \ - client/.libs/mysqldump client/.libs/mysqlimport \ - client/.libs/mysqltest client/.libs/mysqlcheck \ - client/.libs/mysqlbinlog client/.libs/mysqltestmanagerc \ - client/.libs/mysqltestmanager-pwgen tools/.libs/mysqltestmanager \ - tests/.libs/mysql_client_test \ - libmysqld/examples/.libs/mysql_client_test_embedded \ - libmysqld/examples/.libs/mysqltest_embedded \ - "; -fi copyfileto $BASE/bin $BIN_FILES -if [ x$STRIP = x1 ] ; then - strip $BASE/bin/* -fi - -# Copy not binary files -copyfileto $BASE/bin sql/mysqld.sym.gz - -if [ $BASE_SYSTEM = "netware" ] ; then - $CP netware/*.pl $BASE/scripts - $CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl -fi +$CP netware/*.pl $BASE/scripts +$CP scripts/mysqlhotcopy $BASE/scripts/mysqlhotcopy.pl copyfileto $BASE/lib \ libmysql/.libs/libmysqlclient.a \ @@ -248,31 +372,17 @@ copyfileto $BASE/lib \ zlib/.libs/libz.a # convert the .a to .lib for NetWare -if [ $BASE_SYSTEM = "netware" ] ; then - for i in $BASE/lib/*.a - do - libname=`basename $i .a` - $MV $i $BASE/lib/$libname.lib - done - rm -f $BASE/lib/*.la -fi +for i in $BASE/lib/*.a +do + libname=`basename $i .a` + $MV $i $BASE/lib/$libname.lib +done +rm -f $BASE/lib/*.la -copyfileto $BASE/include include/* + +copyfileto $BASE/include config.h include/* rm -f $BASE/include/Makefile* $BASE/include/*.in $BASE/include/config-win.h -if [ $BASE_SYSTEM != "netware" ] ; then - rm -f $BASE/include/config-netware.h -fi - -if [ $BASE_SYSTEM != "netware" ] ; then - if [ -d tests ] ; then - $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests - fi - if [ -d man ] ; then - $CP man/*.1 $BASE/man/man1 - $CP man/*.8 $BASE/man/man8 - fi -fi copyfileto $BASE/support-files support-files/* @@ -291,43 +401,29 @@ copyfileto $BASE/mysql-test \ $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.sql $BASE/mysql-test/include $CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/t/*.def $BASE/mysql-test/t +$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ + mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \ + mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \ + mysql-test/std_data/Index.xml \ + mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \ + mysql-test/std_data/*.cnf mysql-test/std_data/*.MY* \ + $BASE/mysql-test/std_data $CP mysql-test/t/*.test mysql-test/t/*.imtest \ mysql-test/t/*.disabled mysql-test/t/*.opt \ mysql-test/t/*.slave-mi mysql-test/t/*.sh mysql-test/t/*.sql $BASE/mysql-test/t $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r -# Copy the additional suites and data "as is", they are in flux -$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) -$tar cf - mysql-test/std_data | ( cd $BASE ; $tar xf - ) +# Copy the additional suites "as is", they are in flux +$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) # Clean up if we did this from a bk tree if [ -d mysql-test/SCCS ] ; then find $BASE/mysql-test -name SCCS -print | xargs rm -rf fi -if [ $BASE_SYSTEM != "netware" ] ; then - chmod a+x $BASE/bin/* - copyfileto $BASE/bin scripts/* - $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ \ - ./bin \@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ \ - @HOSTNAME@ \@pkgdatadir\@ ./share \ - < scripts/mysql_install_db.sh > $BASE/scripts/mysql_install_db - $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \ - \@sbindir\@ ./bin \@libexecdir\@ ./bin \ - \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@ /usr/local/mysql/data \ - \@HOSTNAME\@ @HOSTNAME@ \ - < support-files/mysql.server.sh > $BASE/support-files/mysql.server - $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe - mv $BASE/support-files/binary-configure $BASE/configure - chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-log-rotate \ - $BASE/support-files/*.server $BASE/configure - $CP -r sql-bench/* $BASE/sql-bench - rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la - rm -f $BASE/bin/*.sql -fi - rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ $BASE/bin/setsomevars $BASE/support-files/Makefile* \ @@ -336,29 +432,19 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ # # Copy system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql -fi +./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql # # Remove system dependent files # -if [ $BASE_SYSTEM = "netware" ] ; then - rm -f $BASE/support-files/magic \ +rm -f $BASE/support-files/magic \ $BASE/support-files/mysql.server \ $BASE/support-files/mysql*.spec \ $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ $BASE/support-files/build-tags \ $BASE/support-files/MySQL-shared-compat.spec \ - $BASE/support-files/ndb-config-2-node.ini \ $BASE/INSTALL-BINARY -fi - -# Make safe_mysqld a symlink to mysqld_safe for backwards portability -if [ $BASE_SYSTEM != "netware" ] ; then - (cd $BASE/bin ; ln -s mysqld_safe safe_mysqld ) -fi # Clean up if we did this from a bk tree if [ -d $BASE/sql-bench/SCCS ] ; then @@ -366,78 +452,17 @@ if [ -d $BASE/sql-bench/SCCS ] ; then find $BASE/sql-bench -name SCCS -print | xargs rm -rf fi -# NDB Cluster -if [ x$NDBCLUSTER = x1 ]; then - ( cd ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - ( cd mysql-test/ndb ; @MAKE@ DESTDIR=$BASE/ndb-stage install ) - $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. - $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. - $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP $BASE/ndb-stage@pkgdatadir@/* $BASE/share/mysql/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include - $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 - rm -rf $BASE/ndb-stage -fi - -# Change the distribution to a long descriptive name -NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-$version-$platform$SUFFIX - -# Print the platform name for build logs -echo "PLATFORM NAME: $platform" - BASE2=$TMP/$NEW_NAME rm -rf $BASE2 mv $BASE $BASE2 BASE=$BASE2 + # -# If we are compiling with gcc, copy libgcc.a to the distribution as libmygcc.a +# Create a zip file for NetWare users # - -if [ x"@GXX@" = x"yes" ] ; then - 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 - -#if we are debugging, do not do tar/gz -if [ x$DEBUG = x1 ] ; then - exit -fi - -if [ $BASE_SYSTEM != "netware" ] ; then - - # - # Create the result tar file - # - - echo "Using $tar to create archive" - - OPT=cvf - if [ x$SILENT = x1 ] ; then - OPT=cf - fi - - echo "Creating and compressing archive" - rm -f $NEW_NAME.tar.gz - (cd $TMP ; $tar $OPT - $NEW_NAME) | gzip -9 > $NEW_NAME.tar.gz - echo "$NEW_NAME.tar.gz created" - -else - - # - # Create a zip file for NetWare users - # - - rm -f $NEW_NAME.zip - (cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) - echo "$NEW_NAME.zip created" - -fi +rm -f $NEW_NAME.zip +(cd $TMP; zip -r "$SOURCE/$NEW_NAME.zip" $NEW_NAME) +echo "$NEW_NAME.zip created" echo "Removing temporary directory" rm -rf $BASE From 211e9c08ae3eace791cb2f1dd3cf11761426ba63 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 17 Jun 2008 19:05:56 -0600 Subject: [PATCH 02/10] fix typo This change was committed to the 5.1.25 release clone, but never made it to the mysql-5.1 BK tree. I'm committing it to mysql-5.1 bzr now. --- mysql-test/r/repair.result | 2 +- sql/sql_table.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index dce37230d42..609733b2b02 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -130,7 +130,7 @@ test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" to fix # REPAIR old table USE_FRM should fail REPAIR TABLE t1 USE_FRM; Table Op Msg_type Msg_text -t1 repair error Failed reparing incompatible .FRM file +t1 repair error Failed repairing incompatible .frm file # Run REPAIR TABLE to upgrade .frm file REPAIR TABLE t1; Table Op Msg_type Msg_text diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7c847e0817c..9993ef0d854 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4024,7 +4024,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, if (table->s->frm_version != FRM_VER_TRUE_VARCHAR) { error= send_check_errmsg(thd, table_list, "repair", - "Failed reparing incompatible .FRM file"); + "Failed repairing incompatible .frm file"); goto end; } From f13393db226d6bd77f02d1fac111f09a5126623d Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 05:08:41 +0200 Subject: [PATCH 03/10] Fixed bug #37004. The value of JOIN::tables must be set to 0 when there is no matching min/max row. mysql-test/r/subselect.result: Added a test case for bug #37004. mysql-test/t/subselect.test: Added a test case for bug #37004. --- mysql-test/r/subselect.result | 7 +++++++ mysql-test/t/subselect.test | 12 ++++++++++++ sql/sql_select.cc | 2 ++ 3 files changed, 21 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ce4ac00b791..923bc2254bd 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4391,3 +4391,10 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); s1 a DROP TABLE t1; +CREATE TABLE t1(c int, KEY(c)); +CREATE TABLE t2(a int, b int); +INSERT INTO t2 VALUES (1, 10), (2, NULL); +INSERT INTO t1 VALUES (1), (3); +SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); +a b +DROP TABLE t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index ee3a7428d4a..daaba671f34 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3273,3 +3273,15 @@ INSERT INTO t1 VALUES ('a'); SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); DROP TABLE t1; +# +# Bug #37004: NOT IN subquery with MAX over an empty set +# + +CREATE TABLE t1(c int, KEY(c)); +CREATE TABLE t2(a int, b int); +INSERT INTO t2 VALUES (1, 10), (2, NULL); +INSERT INTO t1 VALUES (1), (3); + +SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); + +DROP TABLE t1,t2; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2ef7aa13dd8..2ee92018410 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -888,6 +888,7 @@ JOIN::optimize() { DBUG_PRINT("info",("No matching min/max row")); zero_result_cause= "No matching min/max row"; + tables= 0; error=0; DBUG_RETURN(0); } @@ -901,6 +902,7 @@ JOIN::optimize() { DBUG_PRINT("info",("No matching min/max row")); zero_result_cause= "No matching min/max row"; + tables= 0; error=0; DBUG_RETURN(0); } From 7887a52d5ccd02b6fe39128d5474f5807b65c148 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 05:12:28 +0200 Subject: [PATCH 04/10] Bug#35480: BOM detection code crashes mysql CLI with zero-sized input MySQL client crashed if no input was passed to it. client/mysql.cc: Check if there's any data before reading it! --- client/mysql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysql.cc b/client/mysql.cc index 234180c3c75..2ef987492b7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1821,7 +1821,7 @@ static int read_and_execute(bool interactive) the very beginning of a text file when you save the file using "Unicode UTF-8" format. */ - if (!line_number && + if (line && !line_number && (uchar) line[0] == 0xEF && (uchar) line[1] == 0xBB && (uchar) line[2] == 0xBF) From b564002d2b6ca01bd28362b76a2c3b199e051605 Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 06:44:22 +0200 Subject: [PATCH 05/10] Bug#36434: ha_innodb.so is installed in the wrong directory ha_innodb.so was incorrectly installed in the lib/mysql directory rather than in lib/mysql/plugin. Amending CS for 31736. storage/innobase/Makefile.am: Install innobase to plugin-dir, not lib-dir. --- storage/innobase/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/Makefile.am b/storage/innobase/Makefile.am index 563522cd032..b5e5c5375dc 100644 --- a/storage/innobase/Makefile.am +++ b/storage/innobase/Makefile.am @@ -159,7 +159,7 @@ libinnobase_a_CXXFLAGS= $(AM_CFLAGS) libinnobase_a_CFLAGS = $(AM_CFLAGS) EXTRA_LTLIBRARIES = ha_innodb.la -pkglib_LTLIBRARIES = @plugin_innobase_shared_target@ +pkgplugin_LTLIBRARIES= @plugin_innobase_shared_target@ ha_innodb_la_LDFLAGS = -module -rpath $(pkgplugindir) ha_innodb_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN From b4a45a712179865d2415a9e7df6761aa126dab2a Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Thu, 19 Jun 2008 12:39:48 +0200 Subject: [PATCH 06/10] re 36818: rpl_server_id1 fails expecting slave has stopped On a slow environment like valgrind the test is vulnerable because it does not check if slave has stopped at time of the new session is requested `start slave;' -- disabling test till it is fixed. mysql-test/suite/rpl/t/disabled.def: disable rpl_server_id1 until test is fixed. --- mysql-test/suite/rpl/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index e107651c6d0..a356d45c2cc 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -12,3 +12,4 @@ rpl_redirect : Failure is sporadic and and the test is superfluous (mats) rpl_innodb_bug28430 : Failure on Solaris Bug #36793 +rpl_server_id1 : Bug #36818 rpl_server_id1 fails expecting slave has stopped (azundris) From e66ba2a74b59f6cb1b9fa876e75ce44fba7c1aee Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Thu, 19 Jun 2008 21:47:59 +0300 Subject: [PATCH 07/10] Bug#36443 Server crashes when executing insert when insert trigger on table The crash appeared to be a result of allocating an instance of Discrete_interval automatically that that was referred in out-of-declaration scope. Fixed with correcting backing up and restoring scheme of auto_inc_intervals_forced, introduced by bug#33029, by means of shallow copying; added simulation code that forces executing those fixes of the former bug that targeted at master-and-slave having incompatible bug#33029-prone versions. mysql-test/suite/bugs/r/rpl_bug33029.result: new results file mysql-test/suite/bugs/t/rpl_bug33029.test: test merely checks no crash happens on slave. sql/slave.cc: forcing to execute special logics implemented for bug#33029 if simulate_bug33029 the debug option is set. sql/sql_class.cc: swaps of backed and the actual auto_inc_intervals_forced basing on shallow coping. sql/structs.h: Removing the deep _copy() and methods associated with it; adding methods to Discrete_intervals_list: private `=', copy constructor to prevent using; private set_members(); public copy_shallow(), swap(), get_{head, tail, current}(); empty_no_free() through set_members(). --- mysql-test/suite/bugs/r/rpl_bug33029.result | 15 ++++++ mysql-test/suite/bugs/t/rpl_bug33029.test | 25 ++++++++++ sql/slave.cc | 1 + sql/sql_class.cc | 8 ++-- sql/structs.h | 53 +++++++++++++-------- 5 files changed, 77 insertions(+), 25 deletions(-) create mode 100644 mysql-test/suite/bugs/r/rpl_bug33029.result create mode 100644 mysql-test/suite/bugs/t/rpl_bug33029.test diff --git a/mysql-test/suite/bugs/r/rpl_bug33029.result b/mysql-test/suite/bugs/r/rpl_bug33029.result new file mode 100644 index 00000000000..d11ae1cc0be --- /dev/null +++ b/mysql-test/suite/bugs/r/rpl_bug33029.result @@ -0,0 +1,15 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table `t1` (`id` int not null auto_increment primary key); +create trigger `trg` before insert on `t1` for each row begin end; +set @@global.debug="+d,simulate_bug33029"; +stop slave; +start slave; +insert into `t1` values (); +select * from t1; +id +1 diff --git a/mysql-test/suite/bugs/t/rpl_bug33029.test b/mysql-test/suite/bugs/t/rpl_bug33029.test new file mode 100644 index 00000000000..494cef42ce0 --- /dev/null +++ b/mysql-test/suite/bugs/t/rpl_bug33029.test @@ -0,0 +1,25 @@ +# +# Bug #36443 Server crashes when executing insert when insert trigger on table +# +# Emulating the former bug#33029 situation to see that there is no crash anymore. +# + + +source include/master-slave.inc; + +create table `t1` (`id` int not null auto_increment primary key); +create trigger `trg` before insert on `t1` for each row begin end; + +sync_slave_with_master; +set @@global.debug="+d,simulate_bug33029"; + +stop slave; +start slave; + +connection master; + +insert into `t1` values (); + +sync_slave_with_master; +select * from t1; + diff --git a/sql/slave.cc b/sql/slave.cc index dcc808625c0..a6d7758c8de 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4136,6 +4136,7 @@ bool rpl_master_erroneous_autoinc(THD *thd) if (active_mi && active_mi->rli.sql_thd == thd) { Relay_log_info *rli= &active_mi->rli; + DBUG_EXECUTE_IF("simulate_bug33029", return TRUE;); return rpl_master_has_bug(rli, 33029, FALSE); } return FALSE; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index afa9777e00a..b54aea94424 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2882,8 +2882,8 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup, */ if (rpl_master_erroneous_autoinc(this)) { - backup->auto_inc_intervals_forced= auto_inc_intervals_forced; - auto_inc_intervals_forced.empty(); + DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0); + auto_inc_intervals_forced.swap(&backup->auto_inc_intervals_forced); } #endif @@ -2931,8 +2931,8 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) */ if (rpl_master_erroneous_autoinc(this)) { - auto_inc_intervals_forced= backup->auto_inc_intervals_forced; - backup->auto_inc_intervals_forced.empty(); + backup->auto_inc_intervals_forced.swap(&auto_inc_intervals_forced); + DBUG_ASSERT(backup->auto_inc_intervals_forced.nb_elements() == 0); } #endif diff --git a/sql/structs.h b/sql/structs.h index 809175fdde4..0a20eee0e9a 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -314,31 +314,22 @@ private: */ Discrete_interval *current; uint elements; // number of elements - - /* helper function for copy construct and assignment operator */ - void copy_(const Discrete_intervals_list& from) - { - for (Discrete_interval *i= from.head; i; i= i->next) - { - Discrete_interval j= *i; - append(&j); - } + void set_members(Discrete_interval *h, Discrete_interval *t, + Discrete_interval *c, uint el) + { + head= h; + tail= t; + current= c; + elements= el; } + void operator=(Discrete_intervals_list &); /* prevent use of these */ + Discrete_intervals_list(const Discrete_intervals_list &); + public: Discrete_intervals_list() : head(NULL), current(NULL), elements(0) {}; - Discrete_intervals_list(const Discrete_intervals_list& from) - { - copy_(from); - } - void operator=(const Discrete_intervals_list& from) - { - empty(); - copy_(from); - } void empty_no_free() { - head= current= NULL; - elements= 0; + set_members(NULL, NULL, NULL, 0); } void empty() { @@ -350,7 +341,24 @@ public: } empty_no_free(); } - + void copy_shallow(const Discrete_intervals_list * dli) + { + head= dli->get_head(); + tail= dli->get_tail(); + current= dli->get_current(); + elements= dli->nb_elements(); + } + void swap (Discrete_intervals_list * dli) + { + Discrete_interval *h, *t, *c; + uint el; + h= dli->get_head(); + t= dli->get_tail(); + c= dli->get_current(); + el= dli->nb_elements(); + dli->copy_shallow(this); + set_members(h, t, c, el); + } const Discrete_interval* get_next() { Discrete_interval *tmp= current; @@ -364,4 +372,7 @@ public: ulonglong minimum() const { return (head ? head->minimum() : 0); }; ulonglong maximum() const { return (head ? tail->maximum() : 0); }; uint nb_elements() const { return elements; } + Discrete_interval* get_head() const { return head; }; + Discrete_interval* get_tail() const { return tail; }; + Discrete_interval* get_current() const { return current; }; }; From 69860e7e358fe72780a09e222b773f08d20d7af3 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 20 Jun 2008 14:54:48 +0200 Subject: [PATCH 08/10] Raise version number after cloning 5.1.26 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index af23b6035eb..e684fad4584 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.26-rc) +AM_INIT_AUTOMAKE(mysql, 5.1.28) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10 From 574c57ccecb9f3131f7c2b5d5b0400cdaaaae41b Mon Sep 17 00:00:00 2001 From: "Tatiana A. Nurnberg" Date: Fri, 20 Jun 2008 18:58:14 +0200 Subject: [PATCH 09/10] Bug#33812: mysql client incorrectly parsing DELIMITER Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. client/mysql.cc: Remove unnecessary and incorrect code that tried to pull delimiter commands out of the middle of statements. mysql-test/r/mysql.result: show we no longer parse DELIMITER when we shouldn't. mysql-test/t/mysql_delimiter.sql: show we no longer parse DELIMITER when we shouldn't. --- client/mysql.cc | 31 ------------------------------- mysql-test/r/mysql.result | 2 ++ mysql-test/t/mysql_delimiter.sql | 6 ++++++ 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 2ef987492b7..20ad769e9b4 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2101,37 +2101,6 @@ static bool add_line(String &buffer,char *line,char *in_string, continue; } } - else if (!*ml_comment && !*in_string && - (end_of_line - pos) >= 10 && - !my_strnncoll(charset_info, (uchar*) pos, 10, - (const uchar*) "delimiter ", 10)) - { - // Flush previously accepted characters - if (out != line) - { - buffer.append(line, (uint32) (out - line)); - out= line; - } - - // Flush possible comments in the buffer - if (!buffer.is_empty()) - { - if (com_go(&buffer, 0) > 0) // < 0 is not fatal - DBUG_RETURN(1); - buffer.length(0); - } - - /* - Delimiter wants the get rest of the given line as argument to - allow one to change ';' to ';;' and back - */ - buffer.append(pos); - if (com_delimiter(&buffer, pos) > 0) - DBUG_RETURN(1); - - buffer.length(0); - break; - } else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter)) { // Found a statement. Continue parsing after the delimiter diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index a4d96c1c243..6fe35d5c9f9 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -38,6 +38,8 @@ t2 t3 Tables_in_test t1 +delimiter +1 _ Test delimiter : from command line a diff --git a/mysql-test/t/mysql_delimiter.sql b/mysql-test/t/mysql_delimiter.sql index db679c3b06b..8caa7cebc2f 100644 --- a/mysql-test/t/mysql_delimiter.sql +++ b/mysql-test/t/mysql_delimiter.sql @@ -59,3 +59,9 @@ source t/mysql_delimiter_19799.sql use test// show tables// delimiter ; # Reset delimiter + +# +# Bug #33812: mysql client incorrectly parsing DELIMITER +# +select a as delimiter from t1 +delimiter ; # Reset delimiter From 8152b54291ced9887c9628209f427a7492ac8234 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Fri, 20 Jun 2008 19:06:03 +0200 Subject: [PATCH 10/10] Correct the version number, after cloning 5.1.26 the next one is 27 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index e684fad4584..4441362020a 100644 --- a/configure.in +++ b/configure.in @@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in mysqlbinlog::check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.1.28) +AM_INIT_AUTOMAKE(mysql, 5.1.27) AM_CONFIG_HEADER([include/config.h:config.h.in]) PROTOCOL_VERSION=10