[mariadb/el5] Rebase to 5.5.33a

Honza Horak hhorak at fedoraproject.org
Mon Oct 14 15:27:33 UTC 2013


commit 8188469cc0fb88d86374b73cdc8f3706d0b4bce4
Author: Honza Horák <hhorak at redhat.com>
Date:   Mon Oct 14 17:24:48 2013 +0200

    Rebase to 5.5.33a

 .gitignore                        |    1 +
 mariadb-cmakehostname.patch       |   14 +++++++
 mariadb-covscan-signexpr.patch    |   16 ++++++++
 mariadb-covscan-stroverflow.patch |   73 +++++++++++++++++++++++++++++++++++++
 mariadb-errno.patch               |   14 ++++----
 mariadb.spec                      |   35 ++++++++++++++++--
 rh-skipped-tests-base.list        |   13 ++-----
 sources                           |    2 +-
 8 files changed, 148 insertions(+), 20 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 9aeebb1..eac70fa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
 /mariadb-5.5.29.tar.gz
 /mariadb-5.5.31.tar.gz
 /mariadb-5.5.32.tar.gz
+/mariadb-5.5.33a.tar.gz
diff --git a/mariadb-cmakehostname.patch b/mariadb-cmakehostname.patch
new file mode 100644
index 0000000..e3fba15
--- /dev/null
+++ b/mariadb-cmakehostname.patch
@@ -0,0 +1,14 @@
+Upstream bug report: https://mariadb.atlassian.net/browse/MDEV-5124
+
+diff -up mariadb-5.5.33a/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake.cmakehostname mariadb-5.5.33a/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake
+--- mariadb-5.5.33a/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake.cmakehostname	2013-10-10 16:21:18.904236776 +0200
++++ mariadb-5.5.33a/storage/tokudb/ft-index/cmake_modules/TokuSetupCTest.cmake	2013-10-10 16:21:29.718243555 +0200
+@@ -60,7 +60,7 @@ macro(hostname out)
+     COMMAND hostname
+     OUTPUT_VARIABLE fullhostname
+     OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} ${fullhostname})
++  string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} "${fullhostname}")
+ endmacro(hostname)
+ 
+ ## gather machine info
diff --git a/mariadb-covscan-signexpr.patch b/mariadb-covscan-signexpr.patch
new file mode 100644
index 0000000..1bbb3db
--- /dev/null
+++ b/mariadb-covscan-signexpr.patch
@@ -0,0 +1,16 @@
+This issue has been found by Coverity - static analysis tool.
+
+mysql-5.5.31/strings/ctype-ucs2.c:1707:sign_extension – Suspicious implicit sign extension: "s[0]" with type "unsigned char" (8 bits, unsigned) is promoted in "(s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "(s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3]" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
+
+diff -up mysql-5.5.31/strings/ctype-ucs2.c.covscan1 mysql-5.5.31/strings/ctype-ucs2.c
+--- mysql-5.5.31/strings/ctype-ucs2.c.covscan1	2013-06-14 12:12:29.663300314 +0200
++++ mysql-5.5.31/strings/ctype-ucs2.c	2013-06-14 12:13:07.809299646 +0200
+@@ -1704,7 +1704,7 @@ my_utf32_uni(CHARSET_INFO *cs __attribut
+ {
+   if (s + 4 > e)
+     return MY_CS_TOOSMALL4;
+-  *pwc= (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]);
++  *pwc= (((my_wc_t)s[0]) << 24) + (s[1] << 16) + (s[2] << 8) + (s[3]);
+   return 4;
+ }
+ 
diff --git a/mariadb-covscan-stroverflow.patch b/mariadb-covscan-stroverflow.patch
new file mode 100644
index 0000000..d671b45
--- /dev/null
+++ b/mariadb-covscan-stroverflow.patch
@@ -0,0 +1,73 @@
+The following problems have been found by Coverity - static analysis tool.
+
+mysql-5.5.31/plugin/semisync/semisync_master.cc:672:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. 
+
+mysql-5.5.31/plugin/semisync/semisync_master.cc:661:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function. 
+
+mysql-5.5.31/plugin/semisync/semisync_master.cc:555:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function.
+
+diff -up mysql-5.5.31/plugin/semisync/semisync_master.cc.covscan-stroverflow mysql-5.5.31/plugin/semisync/semisync_master.cc
+--- mysql-5.5.31/plugin/semisync/semisync_master.cc.covscan-stroverflow	2013-06-17 09:04:47.214621154 +0200
++++ mysql-5.5.31/plugin/semisync/semisync_master.cc	2013-06-17 09:08:32.189617218 +0200
+@@ -552,7 +552,8 @@ int ReplSemiSyncMaster::reportReplyBinlo
+ 
+   if (need_copy_send_pos)
+   {
+-    strcpy(reply_file_name_, log_file_name);
++    strncpy(reply_file_name_, log_file_name, sizeof(reply_file_name_)-1);
++    reply_file_name_[sizeof(reply_file_name_)-1] = '\0';
+     reply_file_pos_ = log_file_pos;
+     reply_file_name_inited_ = true;
+ 
+@@ -658,7 +659,8 @@ int ReplSemiSyncMaster::commitTrx(const
+         if (cmp <= 0)
+ 	{
+           /* This thd has a lower position, let's update the minimum info. */
+-          strcpy(wait_file_name_, trx_wait_binlog_name);
++          strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1);
++          wait_file_name_[sizeof(wait_file_name_)-1] = '\0';
+           wait_file_pos_ = trx_wait_binlog_pos;
+ 
+           rpl_semi_sync_master_wait_pos_backtraverse++;
+@@ -669,7 +671,8 @@ int ReplSemiSyncMaster::commitTrx(const
+       }
+       else
+       {
+-        strcpy(wait_file_name_, trx_wait_binlog_name);
++        strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1);
++        wait_file_name_[sizeof(wait_file_name_)-1] = '\0';
+         wait_file_pos_ = trx_wait_binlog_pos;
+         wait_file_name_inited_ = true;
+ 
+
+mysql-5.5.31/sql/rpl_handler.cc:306:fixed_size_dest – You might overrun the 512 byte fixed-size string "log_info->log_file" by copying "log_file + dirname_length(log_file)" without checking the length. diff -up mysql-5.5.31/sql/rpl_handler.cc.covscan-stroverflow mysql-5.5.31/sql/rpl_handler.cc
+
+--- mysql-5.5.31/sql/rpl_handler.cc.covscan-stroverflow	2013-06-17 10:51:04.940509594 +0200
++++ mysql-5.5.31/sql/rpl_handler.cc	2013-06-17 10:51:08.959509523 +0200
+@@ -303,7 +303,8 @@ int Binlog_storage_delegate::after_flush
+     my_pthread_setspecific_ptr(RPL_TRANS_BINLOG_INFO, log_info);
+   }
+     
+-  strcpy(log_info->log_file, log_file+dirname_length(log_file));
++  strncpy(log_info->log_file, log_file+dirname_length(log_file), sizeof(log_info->log_file)-1);
++  log_info->log_file[sizeof(log_info->log_file)-1] = '\0';
+   log_info->log_pos = log_pos;
+   
+   int ret= 0;
+
+
+mysql-5.5.31/sql/sp_rcontext.h:87:buffer_size_warning – Calling strncpy with a maximum size argument of 512 bytes on destination array "this->m_message" of size 512 bytes might leave the destination string unterminated. 
+
+diff -up mysql-5.5.31/sql/sp_rcontext.h.covscan-stroverflow mysql-5.5.31/sql/sp_rcontext.h
+--- mysql-5.5.31/sql/sp_rcontext.h.covscan-stroverflow	2013-06-17 13:28:32.540344334 +0200
++++ mysql-5.5.31/sql/sp_rcontext.h	2013-06-17 13:29:23.673343443 +0200
+@@ -84,7 +84,8 @@ public:
+     memcpy(m_sql_state, sqlstate, SQLSTATE_LENGTH);
+     m_sql_state[SQLSTATE_LENGTH]= '\0';
+ 
+-    strncpy(m_message, msg, MYSQL_ERRMSG_SIZE);
++    strncpy(m_message, msg, sizeof(m_message)-1);
++    m_message[sizeof(m_message)-1] = '\0';
+   }
+ 
+   void clear()
diff --git a/mariadb-errno.patch b/mariadb-errno.patch
index bcacf6c..8c1c10c 100644
--- a/mariadb-errno.patch
+++ b/mariadb-errno.patch
@@ -1,20 +1,20 @@
 "extern int errno" is just a really bad idea.
 
-diff -up mariadb-5.5.28a/include/my_sys.h.p1 mariadb-5.5.28a/include/my_sys.h
---- mariadb-5.5.28a/include/my_sys.h.p1	2012-12-17 16:06:12.942346553 +0100
-+++ mariadb-5.5.28a/include/my_sys.h	2012-12-17 16:06:51.085361555 +0100
-@@ -189,13 +189,8 @@ extern void my_large_free(uchar *ptr);
+diff -up mariadb-5.5.33a/include/my_sys.h.p1 mariadb-5.5.33a/include/my_sys.h
+--- mariadb-5.5.33a/include/my_sys.h.p1	2013-10-10 13:37:11.391507810 +0200
++++ mariadb-5.5.33a/include/my_sys.h	2013-10-10 13:37:57.395519715 +0200
+@@ -190,13 +190,7 @@ extern void my_large_free(uchar *ptr);
  #define my_safe_alloca(size, min_length) ((size <= min_length) ? my_alloca(size) : my_malloc(size,MYF(MY_FAE)))
  #define my_safe_afree(ptr, size, min_length) ((size <= min_length) ? my_afree(ptr) : my_free(ptr))
  
 -#ifndef errno				/* did we already get it? */
 -#ifdef HAVE_ERRNO_AS_DEFINE
- #include <errno.h>			/* errno is a define */
+-#include <errno.h>			/* errno is a define */
 -#else
 -extern int errno;			/* declare errno */
 -#endif
 -#endif					/* #ifndef errno */
-+
++#include <errno.h>                     /* errno is a define */
  extern char *home_dir;			/* Home directory for user */
+ extern MYSQL_PLUGIN_IMPORT char  *mysql_data_home;
  extern const char *my_progname;		/* program-name (printed in errors) */
- extern const char *my_progname_short;	/* like above but without directory */
diff --git a/mariadb.spec b/mariadb.spec
index 6ee683e..73f85c1 100644
--- a/mariadb.spec
+++ b/mariadb.spec
@@ -1,5 +1,9 @@
+# TokuDB engine is now part of MariaDB, but it is available only for x86_64;
+# variable tokudb allows to build with TokuDB storage engine
+%bcond_with tokudb
+
 Name: mariadb
-Version: 5.5.32
+Version: 5.5.33a
 Release: 1%{?dist}
 
 Summary: A community developed branch of MySQL
@@ -41,6 +45,9 @@ Patch10: mariadb-file-contents.patch
 Patch11: mariadb-string-overflow.patch
 Patch12: mariadb-dh1024.patch
 Patch14: mariadb-basedir.patch
+Patch17: mariadb-covscan-signexpr.patch
+Patch18: mariadb-covscan-stroverflow.patch
+Patch20: mariadb-cmakehostname.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: perl, readline-devel, openssl-devel
@@ -232,6 +239,9 @@ MariaDB is a community developed branch of MySQL.
 %patch11 -p1
 %patch12 -p1
 %patch14 -p1
+%patch17 -p1
+%patch18 -p1
+%patch20 -p1
 
 # workaround for upstream bug #56342
 rm -f mysql-test/t/ssl_8k_key-master.opt
@@ -302,6 +312,8 @@ cmake . -DBUILD_CONFIG=mysql_release \
 	-DWITH_READLINE=ON \
 	-DWITH_SSL=system \
 	-DWITH_ZLIB=system \
+	-DWITH_JEMALLOC=no \
+%{!?with_tokudb:       -DWITHOUT_TOKUDB=ON}\
 	-DWITH_MYSQLD_LDFLAGS="-Wl,-z,relro,-z,now"
 
 make %{?_smp_mflags} VERBOSE=1
@@ -381,8 +393,8 @@ chmod 755 ${RPM_BUILD_ROOT}%{_bindir}/mysql_config
 
 # install INFO_SRC, INFO_BIN into libdir (upstream thinks these are doc files,
 # but that's pretty wacko --- see also mariadb-file-contents.patch)
-mv ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}/INFO_SRC ${RPM_BUILD_ROOT}%{_libdir}/mysql/
-mv ${RPM_BUILD_ROOT}%{_docdir}/%{name}-%{version}/INFO_BIN ${RPM_BUILD_ROOT}%{_libdir}/mysql/
+install -p -m 644 Docs/INFO_SRC ${RPM_BUILD_ROOT}%{_libdir}/mysql/
+install -p -m 644 Docs/INFO_BIN ${RPM_BUILD_ROOT}%{_libdir}/mysql/
 
 mkdir -p $RPM_BUILD_ROOT/var/log
 touch $RPM_BUILD_ROOT/var/log/mysqld.log
@@ -457,6 +469,14 @@ rm -f ${RPM_BUILD_ROOT}%{_sysconfdir}/init.d/mysql
 # remove duplicate logrotate script
 rm -f ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/mysql
 
+# remove doc files that we rather pack using %%doc
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/COPYING
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/COPYING.LESSER
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/INFO_BIN
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/INFO_SRC
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/INSTALL-BINARY
+rm -f ${RPM_BUILD_ROOT}%{_datadir}/doc/README
+
 # remove solaris files
 rm -rf ${RPM_BUILD_ROOT}%{_datadir}/mysql/solaris/
 
@@ -511,6 +531,7 @@ fi
 %{_bindir}/mysqlbinlog
 %{_bindir}/mysqlcheck
 %{_bindir}/mysqldump
+%{?with_tokudb:%{_bindir}/tokuftdump}
 %{_bindir}/mysqlimport
 %{_bindir}/mysqlshow
 %{_bindir}/mysqlslap
@@ -607,6 +628,7 @@ fi
 %{_bindir}/resolveip
 
 %config(noreplace) %{_sysconfdir}/my.cnf.d/server.cnf
+%{?with_tokudb:%config(noreplace) %{_sysconfdir}/my.cnf.d/tokudb.cnf}
 
 %{_libexecdir}/mysqld
 
@@ -699,6 +721,13 @@ fi
 %{_mandir}/man1/mysql_client_test.1*
 
 %changelog
+* Thu Oct 10 2013 Honza Horak <hhorak at redhat.com> 1:5.5.33a-1
+- Rebase to 5.5.33a
+  https://kb.askmonty.org/en/mariadb-5533-changelog/
+  https://kb.askmonty.org/en/mariadb-5533a-changelog/
+- Enable outfile_loaddata test
+- Disable tokudb_innodb_xa_crash test
+
 * Tue Aug 20 2013 Honza Horak <hhorak at redhat.com> 5.5.32-1
 - Rebase to 5.5.32
   https://kb.askmonty.org/en/mariadb-5532-changelog/
diff --git a/rh-skipped-tests-base.list b/rh-skipped-tests-base.list
index 32f477c..44e5155 100644
--- a/rh-skipped-tests-base.list
+++ b/rh-skipped-tests-base.list
@@ -1,14 +1,9 @@
-# Disable the outfile_loaddata test, which as of 5.1.38 is giving
-# platform-dependent results, with the "expected" results being arguably the
-# wrong ones.  This is upstream at http://bugs.mysql.com/bug.php?id=46895
-# (note that upstream has also disabled it, but only for Solaris, so we still
-# need to disable it here).
-# Still broken in 5.5.14, despite alleged fix.
-
-outfile_loaddata          : bug#46895 code wrong, expected results wrong too
-
 # Disable innodb.innodb, which is showing platform-dependent results
 # as of 5.5.9.  Upstream at http://bugs.mysql.com/bug.php?id=60155
 
 innodb.innodb             : bug#60155 has platform-dependent results
 
+# Disable tokudb_innodb_xa_crash temporarily, until it is fixed:
+#
+
+tokudb_innodb_xa_crash    : https://bugzilla.redhat.com/show_bug.cgi?id=1018192
diff --git a/sources b/sources
index 1e9f3ca..54bd63e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-565c2dce6a2fb027c9d0ffbae4934135  mariadb-5.5.32.tar.gz
+00449a034b88490f16bd679b800bb850  mariadb-5.5.33a.tar.gz


More information about the scm-commits mailing list