From 02226f4979fbbc251ddc4aebf77c7544d8663079 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 31 Jul 2014 13:05:18 +0200 Subject: [PATCH] Update to MySQL 5.6.20 Signed-off-by: Bjorn Munch Signed-off-by: Honza Horak --- .gitignore | 1 + community-mysql-5.6.16-mysql-install.patch | 111 ++------------------- community-mysql-pluginerrmsg.patch | 52 +++++----- community-mysql.spec | 54 ++++------ mysql-prepare-db-dir.sh | 2 +- mysql-scripts-common.sh | 0 mysql.init.in | 8 +- sources | 2 +- 8 files changed, 64 insertions(+), 166 deletions(-) mode change 100755 => 100644 mysql-scripts-common.sh diff --git a/.gitignore b/.gitignore index 02af558..86c7f42 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /mysql-5.6.16.tar.gz /mysql-5.6.17.tar.gz /mysql-5.6.19.tar.gz +/mysql-5.6.20.tar.gz diff --git a/community-mysql-5.6.16-mysql-install.patch b/community-mysql-5.6.16-mysql-install.patch index 943009e..232687d 100644 --- a/community-mysql-5.6.16-mysql-install.patch +++ b/community-mysql-5.6.16-mysql-install.patch @@ -1,17 +1,8 @@ diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in -index 440a977..7d068fc 100644 +index 1fa5164..4aa49ca 100644 --- a/scripts/mysql_install_db.pl.in +++ b/scripts/mysql_install_db.pl.in -@@ -75,6 +97,8 @@ Usage: $0 [OPTIONS] - --help Display this help and exit. - --ldata=path The path to the MySQL data directory. Same as --datadir. - --no-defaults Don't read default options from any option file. -+ --keep-my-cnf Don't try to create my.cnf based on template. -+ Useful for systems with working, updated my.cnf. - EOF1 - if ( $^O !~ m/^(MSWin32|cygwin)$/ ) { - print <{srcdir} and $opt->{basedir} ) +@@ -439,7 +440,7 @@ if ( $opt->{srcdir} and $opt->{basedir} ) { error($opt,"Specify either --basedir or --srcdir, not both"); } +-if ( $opt->{'keep-my-cnf'} ) +if ( $opt->{rpm} || $opt->{'keep-my-cnf'} ) -+{ -+ $keep_my_cnf = 1; -+} - if ( $opt->{srcdir} ) { - $opt->{builddir} = $opt->{srcdir} unless $opt->{builddir}; -@@ -425,7 +462,7 @@ my $config_file; - my $copy_cfg_file; - - # ---------------------------------------------------------------------- --# This will be the default config file -+# This will be the default config file (unless creation is unwanted) - # ---------------------------------------------------------------------- - - my $cnfext = ( $^O =~ m/^(MSWin32|cygwin)$/ ) ? "ini" : "cnf"; -@@ -434,6 +471,11 @@ $config_file= "$basedir/my.$cnfext"; - - my $cfg_template= find_in_basedir($opt,"file","my-default.$cnfext", - ".", "share","share/mysql","support-files"); -+# Distros might move files -+if ((! -r $cfg_template) && (-r "@pkgdatadir@/my-default.cnf")) { -+ $cfg_template = "@pkgdatadir@/my-default.cnf"; -+} -+ - -e $cfg_template or cannot_find_file("my-default.$cnfext"); - - $copy_cfg_file= $config_file; -@@ -443,22 +485,21 @@ if (-e $copy_cfg_file) - $copy_cfg_file =~ s/my.$cnfext/my-new.$cnfext/; - # Too early to print warning here, the user may not notice + $keep_my_cnf = 1; } --open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template"); --if (open (CFG, "> $copy_cfg_file")) --{ -- while () -- { -- # Remove lines beginning with # *** which are template comments -- print CFG $_ unless /^# \*\*\*/; -+ -+if ( ! $keep_my_cnf ) { -+ open (TEMPL, $cfg_template) or error($opt, "Could not open config template $cfg_template"); -+ if (open (CFG, "> $copy_cfg_file")) { -+ while () { -+ # Remove lines beginning with # *** which are template comments -+ print CFG $_ unless /^# \*\*\*/; -+ } -+ close CFG; -+ } else { -+ warning($opt,"Could not write to config file $copy_cfg_file: $!"); -+ $failed_write_cfg= 1; - } -- close CFG; -+ close TEMPL; - } --else --{ -- warning($opt,"Could not write to config file $copy_cfg_file: $!"); -- $failed_write_cfg= 1; --} --close TEMPL; - - # ---------------------------------------------------------------------- - # Now we can get arguments from the groups [mysqld] and [mysql_install_db] -@@ -621,7 +662,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ ) +@@ -664,7 +665,7 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ ) } # ---------------------------------------------------------------------- @@ -110,7 +28,7 @@ index 440a977..7d068fc 100644 # ---------------------------------------------------------------------- # FIXME The shell variant uses "mkdir -p": -@@ -654,7 +695,7 @@ if ($opt_user) +@@ -697,7 +698,7 @@ if ($opt_user) } } @@ -119,18 +37,3 @@ index 440a977..7d068fc 100644 { mkdir($dir, 0700) unless -d $dir; if ($opt_user and -w "/") -@@ -848,7 +889,13 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") ) - "", - "Support MySQL by buying support/licenses at http://shop.mysql.com"); - -- if ($copy_cfg_file eq $config_file and !$failed_write_cfg) -+ if ($keep_my_cnf) -+ { -+ report($opt, -+ "Note: new default config file not created.", -+ "Please make sure your config file is current"); -+ } -+ elsif ($copy_cfg_file eq $config_file and !$failed_write_cfg) - { - report($opt, - "New default config file was created as $config_file and", diff --git a/community-mysql-pluginerrmsg.patch b/community-mysql-pluginerrmsg.patch index ae8c231..a781172 100644 --- a/community-mysql-pluginerrmsg.patch +++ b/community-mysql-pluginerrmsg.patch @@ -12,9 +12,10 @@ MySQL bug report: http://bugs.mysql.com/bug.php?id=51771 MariaDB bug report: https://mariadb.atlassian.net/browse/MDEV-4573 MariaDB fix: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3802 -diff -up mysql-5.6.14/include/mysql.h.p34 mysql-5.6.14/include/mysql.h ---- mysql-5.6.14/include/mysql.h.p34 2013-09-10 09:38:25.000000000 +0200 -+++ mysql-5.6.14/include/mysql.h 2013-10-09 15:33:04.523541478 +0200 +diff --git a/include/mysql.h b/include/mysql.h +index 38b54de..0b13e92 100644 +--- a/include/mysql.h ++++ b/include/mysql.h @@ -134,6 +134,7 @@ typedef unsigned long long my_ulonglong; /* backward compatibility define - to be removed eventually */ @@ -23,32 +24,34 @@ diff -up mysql-5.6.14/include/mysql.h.p34 mysql-5.6.14/include/mysql.h typedef struct st_mysql_rows { struct st_mysql_rows *next; /* list of rows */ -diff -up mysql-5.6.14/mysql-test/r/plugin.result.p34 mysql-5.6.14/mysql-test/r/plugin.result ---- mysql-5.6.14/mysql-test/r/plugin.result.p34 2013-09-10 09:38:27.000000000 +0200 -+++ mysql-5.6.14/mysql-test/r/plugin.result 2013-10-09 15:33:04.523541478 +0200 -@@ -162,3 +162,5 @@ SELECT @@SESSION.example_double_thdvar; - @@SESSION.example_double_thdvar - 1000.500000 - UNINSTALL PLUGIN example; +diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result +index a3d7437..8ea475d 100644 +--- a/mysql-test/r/plugin.result ++++ b/mysql-test/r/plugin.result +@@ -232,3 +232,5 @@ DROP PROCEDURE p_install; + SET DEBUG_SYNC='RESET'; + disconnect con1; + disconnect con2; +UNINSTALL PLUGIN MyISAM; +ERROR HY000: Built-in plugins cannot be deleted -diff -up mysql-5.6.14/mysql-test/t/plugin.test.p34 mysql-5.6.14/mysql-test/t/plugin.test ---- mysql-5.6.14/mysql-test/t/plugin.test.p34 2013-09-10 09:38:27.000000000 +0200 -+++ mysql-5.6.14/mysql-test/t/plugin.test 2013-10-09 15:33:04.524541479 +0200 -@@ -160,3 +160,10 @@ SET SESSION example_double_thdvar = 1000 - SELECT @@SESSION.example_double_thdvar; +diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test +index de68d36..bf9fb7d 100644 +--- a/mysql-test/t/plugin.test ++++ b/mysql-test/t/plugin.test +@@ -277,3 +277,9 @@ disconnect con1; + disconnect con2; - UNINSTALL PLUGIN example; + --disable_connect_log + +# +# MDEV-4573 UNINSTALL PLUGIN misleading error message for non-dynamic plugins +# +--error ER_PLUGIN_DELETE_BUILTIN +UNINSTALL PLUGIN MyISAM; -+ -diff -up mysql-5.6.14/sql/share/errmsg-utf8.txt.p34 mysql-5.6.14/sql/share/errmsg-utf8.txt ---- mysql-5.6.14/sql/share/errmsg-utf8.txt.p34 2013-09-10 09:38:26.000000000 +0200 -+++ mysql-5.6.14/sql/share/errmsg-utf8.txt 2013-10-09 15:33:04.525541480 +0200 +diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt +index 15acc66..35e2c3c 100644 +--- a/sql/share/errmsg-utf8.txt ++++ b/sql/share/errmsg-utf8.txt @@ -6235,7 +6235,7 @@ WARN_NO_MASTER_INFO WARN_OPTION_IGNORED eng "<%-.64s> option ignored" @@ -58,10 +61,11 @@ diff -up mysql-5.6.14/sql/share/errmsg-utf8.txt.p34 mysql-5.6.14/sql/share/errms eng "Built-in plugins cannot be deleted" ger "Eingebaute Plugins können nicht gelöscht werden" WARN_PLUGIN_BUSY -diff -up mysql-5.6.14/sql/sql_plugin.cc.p34 mysql-5.6.14/sql/sql_plugin.cc ---- mysql-5.6.14/sql/sql_plugin.cc.p34 2013-10-09 15:33:04.527541481 +0200 -+++ mysql-5.6.14/sql/sql_plugin.cc 2013-10-09 15:34:30.760598323 +0200 -@@ -1979,9 +1979,7 @@ bool mysql_uninstall_plugin(THD *thd, co +diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc +index f134e4f..7e34432 100644 +--- a/sql/sql_plugin.cc ++++ b/sql/sql_plugin.cc +@@ -2008,9 +2008,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) } if (!plugin->plugin_dl) { diff --git a/community-mysql.spec b/community-mysql.spec index 9983bf6..7269213 100644 --- a/community-mysql.spec +++ b/community-mysql.spec @@ -50,7 +50,7 @@ # later when building to another location (like SCL) %global logrotateddir %{_sysconfdir}/logrotate.d %global logfiledir %{_localstatedir}/log -%global logfile %{_localstatedir}/log/%{name}.log +%global logfile %{_localstatedir}/log/mysqld.log # Home directory of mysql user should be same for all packages that create it %global mysqluserhome /var/lib/mysql @@ -59,8 +59,8 @@ %global sameevp %{?epoch:%{epoch}:}%{version}-%{release} Name: %{pkgname} -Version: 5.6.19 -Release: 5%{?dist} +Version: 5.6.20 +Release: 1%{?dist} Summary: MySQL client programs and shared libraries Group: Applications/Databases URL: http://www.mysql.com @@ -109,7 +109,6 @@ Patch57: %{pkgname}-5.6.19-gcc49-aarch64-opt.patch Patch70: %{pkgname}-5.6.13-major.patch BuildRequires: cmake -BuildRequires: dos2unix BuildRequires: libaio-devel BuildRequires: libedit-devel BuildRequires: libevent-devel @@ -148,7 +147,7 @@ Conflicts: mariadb Obsoletes: mysql-cluster < 5.1.44 # Filtering: https://fedoraproject.org/wiki/Packaging:AutoProvidesAndRequiresFiltering -%if 0%{?__requires_exclude:1} +%if 0%{?fedora} > 14 || 0%{?rhel} > 6 %global __requires_exclude ^perl\\((hostnames|lib::mtr|lib::v1|mtr_|My::) %global __provides_exclude_from ^(%{_datadir}/(mysql|mysql-test)/.*|%{_libdir}/mysql/plugin/.*\\.so)$ %else @@ -357,6 +356,10 @@ the MySQL sources. %patch70 -p1 %endif +# Avoid dtrace dep +sed -i -e "1d" mysql-test/std_data/dtrace.d +chmod 0644 mysql-test/std_data/dtrace.d + # Modify tests to pass on all archs pushd mysql-test add_test () { @@ -410,20 +413,6 @@ cp %{SOURCE2} %{SOURCE3} %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} \ # build out of source mkdir build && pushd build -# significant performance gains can be achieved by compiling with -O3 optimization -# rhbz#1051069 -%ifarch ppc64 -CFLAGS=`echo $CFLAGS| sed -e "s|-O2|-O3|g" ` -%endif -CXXFLAGS="$CFLAGS" -export CFLAGS CXXFLAGS - -%if 0%{?_hardened_build} -# building with PIE -LDFLAGS="$LDFLAGS -pie -Wl,-z,relro,-z,now" -export LDFLAGS -%endif - # The INSTALL_xxx macros have to be specified relative to CMAKE_INSTALL_PREFIX # so we can't use %%{_datadir} and so forth here. cmake .. -DBUILD_CONFIG=mysql_release \ @@ -557,19 +546,6 @@ install -p -m 0644 %{SOURCE7} %{basename:%{SOURCE7}} # Install the list of skipped tests to be available for user runs install -p -m 0644 mysql-test/%{skiplist} %{buildroot}%{_datadir}/mysql-test -# Upstream bugs: http://bugs.mysql.com/68517 http://bugs.mysql.com/68521 -chmod 0644 %{buildroot}%{_datadir}/%{name}/innodb_memcached_config.sql -find %{buildroot}%{_datadir}/mysql-test/{r,suite,t} -type f -print0 | xargs --null chmod 0644 -chmod 0644 %{buildroot}%{_datadir}/mysql-test/include/{start_mysqld,shutdown_mysqld,check_ipv4_mapped}.inc -for f in std_data/checkDBI_DBD-mysql.pl suite/engines/rr_trx/run_stress_tx_rr.pl \ - suite/funcs_1/lib/DataGen_local.pl suite/funcs_1/lib/DataGen_modify.pl \ - suite/funcs_2/lib/gen_charset_utf8.pl suite/opt_trace/validate_json.py \ - suite/rpl/extension/bhs.pl suite/rpl/extension/checksum.pl ; do - chmod 0755 %{buildroot}%{_datadir}/mysql-test/$f -done -chmod 0644 %{buildroot}%{_datadir}/sql-bench/graph-compare-results -dos2unix -k %{buildroot}%{_datadir}/sql-bench/innotest* - # These are in fact identical rm %{buildroot}%{_mandir}/man1/{mysqltest,mysql_client_test}_embedded.1 cp -p %{buildroot}%{_mandir}/man1/mysqltest.1 %{buildroot}%{_mandir}/man1/mysqltest_embedded.1 @@ -906,6 +882,20 @@ fi %endif %changelog +* Thu Jul 31 2014 Bjorn Munch - 5.6.20-1 +- Update to MySQL 5.6.20, for various fixes described at + https://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-20.html +- Rebase install and pluginerrmsg patch +- Drop dos2unix from buildreq, files fixed upstream +- No need to add -O3, it's default +- LDFLAGS is passed by cmake option, not from environment +- Using __requires_exclude in conditional don't seems to work, swap + to dist macros +- Avoid unwanted dtrace dep +- Fix mysql.init and mysql-prepare-db-dir +- Logfile name must match value from /etc/my.cnf (and be known + by SELinux policy) + * Tue Jul 22 2014 Honza Horak - 5.6.19-5 - Hardcoded paths removed to work fine in chroot - Spec rewrite to be more similar to oterh MySQL implementations diff --git a/mysql-prepare-db-dir.sh b/mysql-prepare-db-dir.sh index 0507f52..e1dad61 100644 --- a/mysql-prepare-db-dir.sh +++ b/mysql-prepare-db-dir.sh @@ -69,7 +69,7 @@ if [ ! -d "$datadir/mysql" ] ; then # Now create the database echo "Initializing @NICE_PROJECT_NAME@ database" - @bindir@/mysql_install_db --datadir="$datadir" --user="$myuser" + @bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser" ret=$? if [ $ret -ne 0 ] ; then echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2 diff --git a/mysql-scripts-common.sh b/mysql-scripts-common.sh old mode 100755 new mode 100644 diff --git a/mysql.init.in b/mysql.init.in index 91e2f98..d6b43d3 100644 --- a/mysql.init.in +++ b/mysql.init.in @@ -39,7 +39,7 @@ MYGROUP=mysql lockfile=/var/lock/subsys/$prog # get options from my.cnf -source "@libexecdir@/mariadb-scripts-common" +source "@libexecdir@/mysql-scripts-common" start(){ [ -x $exec ] || exit 5 @@ -62,8 +62,8 @@ start(){ action $"Starting $prog: " /bin/true ret=0 else - @libexecdir@/mariadb-prepare-db-dir $MYUSER $MYGROUP || return 4 - @libexecdir@/mariadb-check-socket || return 1 + @libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP || return 4 + @libexecdir@/mysql-check-socket || return 1 # Pass all the options determined above, to ensure consistent behavior. # In many cases mysqld_safe would arrive at the same conclusions anyway @@ -78,7 +78,7 @@ start(){ safe_pid=$! # Wait until the daemon is up - @libexecdir@/mariadb-wait-ready "$safe_pid" + @libexecdir@/mysql-wait-ready "$safe_pid" ret=$? if [ $ret -eq 0 ]; then diff --git a/sources b/sources index 660dc7b..14e48be 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a663c5b3c710043c74f97902a1ed62c0 mysql-5.6.19.tar.gz +71ed71ecc53222a2f03523cd13cf2141 mysql-5.6.20.tar.gz