summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compat-mysql55.spec52
-rw-r--r--libmysql.version5
-rw-r--r--mysql-chain-certs.patch32
-rw-r--r--mysql-cipherspec.patch115
-rw-r--r--mysql-dh1024.patch63
-rw-r--r--mysql-dubious-exports.patch173
-rw-r--r--mysql-embedded-crash.patch19
-rw-r--r--mysql-errno.patch8
-rw-r--r--mysql-file-contents.patch27
-rw-r--r--mysql-home.patch16
-rw-r--r--mysql-install-test.patch41
-rw-r--r--mysql-logrotate.patch66
-rw-r--r--mysql-netdevname.patch59
-rw-r--r--mysql-plugin-bool.patch40
-rw-r--r--mysql-plugin-test.patch96
-rw-r--r--mysql-s390-tsc.patch18
-rw-r--r--mysql-stack-guard.patch12
-rw-r--r--mysql-string-overflow.patch57
-rw-r--r--mysql-strmov.patch8
-rw-r--r--mysql-va-list.patch55
-rw-r--r--mysql-versioning.patch8
21 files changed, 807 insertions, 163 deletions
diff --git a/compat-mysql55.spec b/compat-mysql55.spec
index d7bc763..679e8e5 100644
--- a/compat-mysql55.spec
+++ b/compat-mysql55.spec
@@ -1,5 +1,11 @@
+%if 0%{?fedora} >= 12 || 0%{?rhel} >= 6
+%global with_dtrace 1
+%else
+%global with_dtrace 0
+%endif
+
Name: compat-mysql55
-Version: 5.5.11
+Version: 5.5.30
Release: 1%{?dist}
Summary: MySQL shared libraries
Group: Applications/Databases
@@ -28,23 +34,23 @@ Patch5: mysql-stack-guard.patch
Patch6: mysql-chain-certs.patch
Patch7: mysql-versioning.patch
Patch8: mysql-dubious-exports.patch
-# Patch9: mysql-disable-test.patch
-Patch10: mysql-embedded-crash.patch
-Patch11: mysql-home.patch
-Patch12: mysql-plugin-bool.patch
-Patch13: mysql-s390-tsc.patch
-
-# RC patch for backports
-Patch21: mysql-readline.patch
+Patch10: mysql-plugin-bool.patch
+Patch11: mysql-s390-tsc.patch
+Patch14: mysql-va-list.patch
+Patch15: mysql-netdevname.patch
+Patch16: mysql-logrotate.patch
+Patch17: mysql-plugin-test.patch
+Patch18: mysql-cipherspec.patch
+Patch19: mysql-file-contents.patch
+Patch20: mysql-string-overflow.patch
+Patch21: mysql-dh1024.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gperf, perl, readline-devel, openssl-devel
BuildRequires: gcc-c++, cmake, ncurses-devel, zlib-devel, libaio-devel
-%if 0%{?fedora} >= 12
+%if %{with_dtrace}
BuildRequires: systemtap-sdt-devel >= 1.3
%endif
-# This is required old EL4
-BuildRequires: bison
%description
@@ -79,13 +85,16 @@ rm -f Docs/mysql.info
%patch6 -p1
%patch7 -p1
%patch8 -p1
-# %patch9 -p1
%patch10 -p1
%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-# Backports specific patches
-%patch21 -p1 -b .readline
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
+%patch19 -p1
+%patch20 -p1
+%patch21 -p1
# upstream has fallen down badly on symbol versioning, do it ourselves
cp %{SOURCE8} libmysql/libmysql.version
@@ -124,16 +133,12 @@ cmake . -DBUILD_CONFIG=mysql_release \
-DINSTALL_SUPPORTFILESDIR=share/mysql \
-DMYSQL_UNIX_ADDR="/var/lib/mysql/mysql.sock" \
-DENABLED_LOCAL_INFILE=ON \
-%if 0%{?fedora} >= 12
+%if %{with_dtrace}
-DENABLE_DTRACE=ON \
%endif
-DWITH_EMBEDDED_SERVER=ON \
-DWITH_READLINE=ON \
-%if 0%{?fedora} >= 9 || 0%{?rhel} >= 5
-DWITH_SSL=system \
-%else
- -DWITH_SSL=bundled \
-%endif
-DWITH_ZLIB=system
make %{?_smp_mflags} VERBOSE=1
@@ -208,6 +213,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Feb 11 2013 Remi Collet <RPMS@FamilleCollet.com> - 5.5.30-1
+- update to 5.5.30
+
* Fri Apr 15 2011 Remi Collet <RPMS@FamilleCollet.com> - 5.5.11-1
- first RPM
diff --git a/libmysql.version b/libmysql.version
index dc32cd7..35dbc64 100644
--- a/libmysql.version
+++ b/libmysql.version
@@ -117,6 +117,9 @@ libmysqlclient_16 {
# de-facto API as well. We're not going to export the deprecated version
# make_scrambled_password, however.
my_make_scrambled_password;
+# This really shouldn't be exported, but some applications use it as a
+# workaround for inadequate threading support; see bug #846602
+ THR_KEY_mysys;
local:
*;
};
@@ -142,4 +145,6 @@ libmysqlclient_18 {
mysql_net_realloc;
# PHP's mysqli.so requires this (via the ER() macro)
mysql_client_errors;
+# mydumper requires this (added by remi)
+ my_net_read;
};
diff --git a/mysql-chain-certs.patch b/mysql-chain-certs.patch
index 3b20a28..164c22e 100644
--- a/mysql-chain-certs.patch
+++ b/mysql-chain-certs.patch
@@ -10,22 +10,10 @@ Fedora builds, I'm not feeling motivated to try to fix yassl for this.
See RH bug #598656. Filed upstream at http://bugs.mysql.com/bug.php?id=54158
-diff -Naur mysql-5.1.47.orig/vio/viosslfactories.c mysql-5.1.47/vio/viosslfactories.c
---- mysql-5.1.47.orig/vio/viosslfactories.c 2010-05-06 11:28:07.000000000 -0400
-+++ mysql-5.1.47/vio/viosslfactories.c 2010-05-26 23:23:46.000000000 -0400
-@@ -100,7 +100,7 @@
- (long) ctx, cert_file, key_file));
- if (cert_file)
- {
-- if (SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
-+ if (SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
- {
- *error= SSL_INITERR_CERT;
- DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
-diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/src/ssl.cpp
---- mysql-5.1.47.orig/extra/yassl/src/ssl.cpp 2010-05-06 11:24:26.000000000 -0400
-+++ mysql-5.1.47/extra/yassl/src/ssl.cpp 2010-05-26 23:29:13.000000000 -0400
-@@ -1606,10 +1606,10 @@
+diff -Naur mysql-5.5.28.orig/extra/yassl/src/ssl.cpp mysql-5.5.28/extra/yassl/src/ssl.cpp
+--- mysql-5.5.28.orig/extra/yassl/src/ssl.cpp 2012-08-29 04:50:46.000000000 -0400
++++ mysql-5.5.28/extra/yassl/src/ssl.cpp 2012-09-29 12:45:19.682287214 -0400
+@@ -1627,10 +1627,10 @@
}
@@ -39,3 +27,15 @@ diff -Naur mysql-5.1.47.orig/extra/yassl/src/ssl.cpp mysql-5.1.47/extra/yassl/sr
}
+diff -Naur mysql-5.5.28.orig/vio/viosslfactories.c mysql-5.5.28/vio/viosslfactories.c
+--- mysql-5.5.28.orig/vio/viosslfactories.c 2012-08-29 04:50:46.000000000 -0400
++++ mysql-5.5.28/vio/viosslfactories.c 2012-09-29 12:46:35.124975585 -0400
+@@ -106,7 +106,7 @@
+ key_file= cert_file;
+
+ if (cert_file &&
+- SSL_CTX_use_certificate_file(ctx, cert_file, SSL_FILETYPE_PEM) <= 0)
++ SSL_CTX_use_certificate_chain_file(ctx, cert_file) <= 0)
+ {
+ *error= SSL_INITERR_CERT;
+ DBUG_PRINT("error",("%s from file '%s'", sslGetErrString(*error), cert_file));
diff --git a/mysql-cipherspec.patch b/mysql-cipherspec.patch
new file mode 100644
index 0000000..5210055
--- /dev/null
+++ b/mysql-cipherspec.patch
@@ -0,0 +1,115 @@
+Some test items assume the default SSL cipher is DHE-RSA-AES256-SHA,
+which is no longer the case as of openssl 1.0.1.
+This patch enhances connect command by an option to specify a cipher
+and tests are adjusted to specify the expected cipher explicitly.
+Upstream bug report: http://bugs.mysql.com/bug.php?id=64461
+
+diff -up mysql-5.5.28/client/mysqltest.cc.p18 mysql-5.5.28/client/mysqltest.cc
+--- mysql-5.5.28/client/mysqltest.cc.p18 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/client/mysqltest.cc 2012-12-06 14:25:46.370001422 +0100
+@@ -5458,6 +5458,7 @@ void do_connect(struct st_command *comma
+ my_bool con_ssl= 0, con_compress= 0;
+ my_bool con_pipe= 0, con_shm= 0, con_cleartext_enable= 0;
+ struct st_connection* con_slot;
++ char *con_cipher=NULL;
+
+ static DYNAMIC_STRING ds_connection_name;
+ static DYNAMIC_STRING ds_host;
+@@ -5548,6 +5549,8 @@ void do_connect(struct st_command *comma
+ con_shm= 1;
+ else if (!strncmp(con_options, "CLEARTEXT", 9))
+ con_cleartext_enable= 1;
++ else if (!strncmp(con_options, "CIPHER:", 7))
++ con_cipher = con_options + 7;
+ else
+ die("Illegal option to connect: %.*s",
+ (int) (end - con_options), con_options);
+@@ -5595,8 +5598,11 @@ void do_connect(struct st_command *comma
+ if (con_ssl)
+ {
+ #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
++ /* default cipher */
++ if (con_cipher == NULL && opt_ssl_cipher != NULL)
++ con_cipher = opt_ssl_cipher;
+ mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
+- opt_ssl_capath, opt_ssl_cipher);
++ opt_ssl_capath, con_cipher);
+ #if MYSQL_VERSION_ID >= 50000
+ /* Turn on ssl_verify_server_cert only if host is "localhost" */
+ opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
+diff -up mysql-5.5.28/mysql-test/t/openssl_1.test.p18 mysql-5.5.28/mysql-test/t/openssl_1.test
+--- mysql-5.5.28/mysql-test/t/openssl_1.test.p18 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/t/openssl_1.test 2012-12-06 14:25:46.371001424 +0100
+@@ -20,13 +20,13 @@ grant select on test.* to ssl_user4@loca
+ grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
+ flush privileges;
+
+-connect (con1,localhost,ssl_user1,,,,,SSL);
+-connect (con2,localhost,ssl_user2,,,,,SSL);
+-connect (con3,localhost,ssl_user3,,,,,SSL);
+-connect (con4,localhost,ssl_user4,,,,,SSL);
++connect (con1,localhost,ssl_user1,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
++connect (con2,localhost,ssl_user2,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
++connect (con3,localhost,ssl_user3,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
++connect (con4,localhost,ssl_user4,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
+ --replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+ --error ER_ACCESS_DENIED_ERROR
+-connect (con5,localhost,ssl_user5,,,,,SSL);
++connect (con5,localhost,ssl_user5,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
+
+ connection con1;
+ # Check ssl turned on
+@@ -125,7 +125,7 @@ drop table t1;
+ # verification of servers certificate by setting both ca certificate
+ # and ca path to NULL
+ #
+---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
++--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
+ --echo End of 5.0 tests
+
+ #
+@@ -250,7 +250,7 @@ select 'is still running; no cipher requ
+
+ GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
+ FLUSH PRIVILEGES;
+-connect(con1,localhost,bug42158,,,,,SSL);
++connect(con1,localhost,bug42158,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
+ SHOW STATUS LIKE 'Ssl_cipher';
+ disconnect con1;
+ connection default;
+diff -up mysql-5.5.28/mysql-test/t/ssl_8k_key.test.p18 mysql-5.5.28/mysql-test/t/ssl_8k_key.test
+--- mysql-5.5.28/mysql-test/t/ssl_8k_key.test.p18 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/t/ssl_8k_key.test 2012-12-06 14:25:46.371001424 +0100
+@@ -2,7 +2,7 @@
+ #
+ # Bug#29784 YaSSL assertion failure when reading 8k key.
+ #
+---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
++--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem --ssl-cipher=DHE-RSA-AES256-SHA -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
+
+ ## This test file is for testing encrypted communication only, not other
+ ## encryption routines that the SSL library happens to provide!
+diff -up mysql-5.5.28/mysql-test/t/ssl_compress.test.p18 mysql-5.5.28/mysql-test/t/ssl_compress.test
+--- mysql-5.5.28/mysql-test/t/ssl_compress.test.p18 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/t/ssl_compress.test 2012-12-06 14:25:46.371001424 +0100
+@@ -7,7 +7,7 @@
+ # Save the initial number of concurrent sessions
+ --source include/count_sessions.inc
+
+-connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS);
++connect (ssl_compress_con,localhost,root,,,,,SSL COMPRESS CIPHER:DHE-RSA-AES256-SHA);
+
+ # Check ssl turned on
+ SHOW STATUS LIKE 'Ssl_cipher';
+diff -up mysql-5.5.28/mysql-test/t/ssl.test.p18 mysql-5.5.28/mysql-test/t/ssl.test
+--- mysql-5.5.28/mysql-test/t/ssl.test.p18 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/t/ssl.test 2012-12-06 14:25:46.371001424 +0100
+@@ -6,7 +6,7 @@
+ # Save the initial number of concurrent sessions
+ --source include/count_sessions.inc
+
+-connect (ssl_con,localhost,root,,,,,SSL);
++connect (ssl_con,localhost,root,,,,,SSL CIPHER:DHE-RSA-AES256-SHA);
+
+ # Check ssl turned on
+ SHOW STATUS LIKE 'Ssl_cipher';
diff --git a/mysql-dh1024.patch b/mysql-dh1024.patch
new file mode 100644
index 0000000..620ee0b
--- /dev/null
+++ b/mysql-dh1024.patch
@@ -0,0 +1,63 @@
+Change the DH key length from 512 to 1024 bits to meet minimum requirements
+of FIPS 140-2. (In principle we could use the larger size only when FIPS
+mode is on, but it doesn't seem worth the trouble.)
+
+The new parameter value was generated using "openssl dhparam -C 1024".
+
+
+diff -Naur mysql-5.5.28.orig/vio/viosslfactories.c mysql-5.5.28/vio/viosslfactories.c
+--- mysql-5.5.28.orig/vio/viosslfactories.c 2012-08-29 04:50:46.000000000 -0400
++++ mysql-5.5.28/vio/viosslfactories.c 2012-11-15 11:19:38.575701435 -0500
+@@ -20,27 +20,32 @@
+ static my_bool ssl_algorithms_added = FALSE;
+ static my_bool ssl_error_strings_loaded= FALSE;
+
+-static unsigned char dh512_p[]=
++static unsigned char dh1024_p[]=
+ {
+- 0xDA,0x58,0x3C,0x16,0xD9,0x85,0x22,0x89,0xD0,0xE4,0xAF,0x75,
+- 0x6F,0x4C,0xCA,0x92,0xDD,0x4B,0xE5,0x33,0xB8,0x04,0xFB,0x0F,
+- 0xED,0x94,0xEF,0x9C,0x8A,0x44,0x03,0xED,0x57,0x46,0x50,0xD3,
+- 0x69,0x99,0xDB,0x29,0xD7,0x76,0x27,0x6B,0xA2,0xD3,0xD4,0x12,
+- 0xE2,0x18,0xF4,0xDD,0x1E,0x08,0x4C,0xF6,0xD8,0x00,0x3E,0x7C,
+- 0x47,0x74,0xE8,0x33,
++ 0xBF,0x5C,0xFA,0xD1,0xDD,0xBB,0xB3,0x0A,0x58,0x29,0x05,0xF5,
++ 0x7D,0x64,0xB2,0xE1,0xCE,0xE8,0xE0,0xE1,0x7A,0xB6,0xBC,0x5B,
++ 0x21,0x56,0xDF,0x2C,0x82,0x60,0xDC,0x31,0xCA,0x1E,0x02,0xFE,
++ 0xC4,0xE7,0x24,0x63,0x31,0xE4,0x67,0x1C,0x0B,0xFF,0x86,0x12,
++ 0x0D,0x2E,0xE6,0x35,0x0A,0x07,0x4F,0xE7,0x3F,0xDE,0xFE,0xF0,
++ 0x13,0x1C,0xA2,0x2B,0xF4,0xEE,0x2C,0x90,0x10,0x57,0x6B,0x2B,
++ 0xB9,0x1E,0x1B,0x47,0xB0,0x25,0xBF,0x45,0x86,0xDA,0x87,0x35,
++ 0x2C,0xF5,0x6A,0x41,0xA2,0x57,0xD8,0x16,0x5E,0x82,0x91,0x99,
++ 0x33,0xA0,0x8B,0x9D,0x34,0xCE,0x03,0x01,0x80,0x32,0x07,0x3B,
++ 0xF2,0x93,0xFC,0x3A,0x25,0xEC,0xB3,0xED,0x5C,0x4E,0x57,0xF2,
++ 0x3C,0x2E,0x0D,0xB1,0x59,0xA2,0x08,0x93,
+ };
+
+-static unsigned char dh512_g[]={
++static unsigned char dh1024_g[]={
+ 0x02,
+ };
+
+-static DH *get_dh512(void)
++static DH *get_dh1024(void)
+ {
+ DH *dh;
+ if ((dh=DH_new()))
+ {
+- dh->p=BN_bin2bn(dh512_p,sizeof(dh512_p),NULL);
+- dh->g=BN_bin2bn(dh512_g,sizeof(dh512_g),NULL);
++ dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL);
++ dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL);
+ if (! dh->p || ! dh->g)
+ {
+ DH_free(dh);
+@@ -255,7 +260,7 @@
+ }
+
+ /* DH stuff */
+- dh=get_dh512();
++ dh=get_dh1024();
+ SSL_CTX_set_tmp_dh(ssl_fd->ssl_context, dh);
+ DH_free(dh);
+
diff --git a/mysql-dubious-exports.patch b/mysql-dubious-exports.patch
index 3342bf8..4a88d1d 100644
--- a/mysql-dubious-exports.patch
+++ b/mysql-dubious-exports.patch
@@ -2,11 +2,40 @@ Prefix mysql_ to the real names of several symbols that have to be exported
from libmysqlclient because mysql-connector-odbc and/or PHP depend on them.
This limits the intrusion on application namespace.
+Also, remove all traces of make_scrambled_password and
+make_scrambled_password_323, so that references to these functions draw
+compile-time warnings, per a suggestion from Paul Howarth in bug #690346.
+It doesn't seem worth trying to get rid of all the internal symbols exposed
+by mysql.h, but these two are relatively easy to get rid of.
-diff -Naur mysql-5.5.8.orig/include/errmsg.h mysql-5.5.8/include/errmsg.h
---- mysql-5.5.8.orig/include/errmsg.h 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/errmsg.h 2010-12-27 14:29:59.184552374 -0500
-@@ -24,6 +24,7 @@
+
+diff -up mysql-5.5.28/client/mysqladmin.cc.p8 mysql-5.5.28/client/mysqladmin.cc
+--- mysql-5.5.28/client/mysqladmin.cc.p8 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/client/mysqladmin.cc 2012-12-06 14:16:14.598520859 +0100
+@@ -21,6 +21,7 @@
+ #include <my_pthread.h> /* because of signal() */
+ #include <sys/stat.h>
+ #include <mysql.h>
++#include <password.h> /* my_make_scrambled_password_323, my_make_scrambled_password */
+ #include <sql_common.h>
+ #include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
+
+@@ -989,9 +990,9 @@ static int execute_commands(MYSQL *mysql
+ }
+ }
+ if (old)
+- make_scrambled_password_323(crypted_pw, typed_password);
++ my_make_scrambled_password_323(crypted_pw, typed_password, strlen(typed_password));
+ else
+- make_scrambled_password(crypted_pw, typed_password);
++ my_make_scrambled_password(crypted_pw, typed_password, strlen(typed_password));
+ }
+ else
+ crypted_pw[0]=0; /* No password */
+diff -up mysql-5.5.28/include/errmsg.h.p8 mysql-5.5.28/include/errmsg.h
+--- mysql-5.5.28/include/errmsg.h.p8 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/include/errmsg.h 2012-12-06 14:16:14.598520859 +0100
+@@ -24,6 +24,7 @@ extern "C" {
#endif
void init_client_errs(void);
void finish_client_errs(void);
@@ -14,10 +43,62 @@ diff -Naur mysql-5.5.8.orig/include/errmsg.h mysql-5.5.8/include/errmsg.h
extern const char *client_errors[]; /* Error messages */
#ifdef __cplusplus
}
-diff -Naur mysql-5.5.8.orig/include/my_sys.h mysql-5.5.8/include/my_sys.h
---- mysql-5.5.8.orig/include/my_sys.h 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/my_sys.h 2010-12-27 14:27:23.956926896 -0500
-@@ -227,6 +227,7 @@
+diff -up mysql-5.5.28/include/mysql_com.h.p8 mysql-5.5.28/include/mysql_com.h
+--- mysql-5.5.28/include/mysql_com.h.p8 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/include/mysql_com.h 2012-12-06 14:16:14.599520860 +0100
+@@ -452,6 +452,7 @@ my_bool my_net_init(NET *net, Vio* vio);
+ void my_net_local_init(NET *net);
+ void net_end(NET *net);
+ void net_clear(NET *net, my_bool clear_buffer);
++#define net_realloc mysql_net_realloc /* namespace sanity */
+ my_bool net_realloc(NET *net, size_t length);
+ my_bool net_flush(NET *net);
+ my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
+@@ -533,14 +534,12 @@ double my_rnd(struct rand_struct *);
+ void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
+
+ void hash_password(unsigned long *to, const char *password, unsigned int password_len);
+-void make_scrambled_password_323(char *to, const char *password);
+ void scramble_323(char *to, const char *message, const char *password);
+ my_bool check_scramble_323(const unsigned char *reply, const char *message,
+ unsigned long *salt);
+ void get_salt_from_password_323(unsigned long *res, const char *password);
+ void make_password_from_salt_323(char *to, const unsigned long *salt);
+
+-void make_scrambled_password(char *to, const char *password);
+ void scramble(char *to, const char *message, const char *password);
+ my_bool check_scramble(const unsigned char *reply, const char *message,
+ const unsigned char *hash_stage2);
+diff -up mysql-5.5.28/include/mysql.h.pp.p8 mysql-5.5.28/include/mysql.h.pp
+--- mysql-5.5.28/include/mysql.h.pp.p8 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/include/mysql.h.pp 2012-12-06 14:16:14.598520859 +0100
+@@ -86,7 +86,7 @@ my_bool my_net_init(NET *net, Vio* vio);
+ void my_net_local_init(NET *net);
+ void net_end(NET *net);
+ void net_clear(NET *net, my_bool clear_buffer);
+-my_bool net_realloc(NET *net, size_t length);
++my_bool mysql_net_realloc(NET *net, size_t length);
+ my_bool net_flush(NET *net);
+ my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
+ my_bool net_write_command(NET *net,unsigned char command,
+@@ -128,13 +128,11 @@ void randominit(struct rand_struct *, un
+ double my_rnd(struct rand_struct *);
+ void create_random_string(char *to, unsigned int length, struct rand_struct *rand_st);
+ void hash_password(unsigned long *to, const char *password, unsigned int password_len);
+-void make_scrambled_password_323(char *to, const char *password);
+ void scramble_323(char *to, const char *message, const char *password);
+ my_bool check_scramble_323(const unsigned char *reply, const char *message,
+ unsigned long *salt);
+ void get_salt_from_password_323(unsigned long *res, const char *password);
+ void make_password_from_salt_323(char *to, const unsigned long *salt);
+-void make_scrambled_password(char *to, const char *password);
+ void scramble(char *to, const char *message, const char *password);
+ my_bool check_scramble(const unsigned char *reply, const char *message,
+ const unsigned char *hash_stage2);
+diff -up mysql-5.5.28/include/my_sys.h.p8 mysql-5.5.28/include/my_sys.h
+--- mysql-5.5.28/include/my_sys.h.p8 2012-12-06 14:09:15.218170154 +0100
++++ mysql-5.5.28/include/my_sys.h 2012-12-06 14:16:14.598520859 +0100
+@@ -218,6 +218,7 @@ extern uint my_large_page_size;
/* charsets */
#define MY_ALL_CHARSETS_SIZE 2048
@@ -25,7 +106,7 @@ diff -Naur mysql-5.5.8.orig/include/my_sys.h mysql-5.5.8/include/my_sys.h
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
extern CHARSET_INFO compiled_charsets[];
-@@ -914,6 +915,9 @@
+@@ -895,6 +896,9 @@ extern uint get_charset_number(const cha
extern uint get_collation_number(const char *name);
extern const char *get_charset_name(uint cs_number);
@@ -35,26 +116,54 @@ diff -Naur mysql-5.5.8.orig/include/my_sys.h mysql-5.5.8/include/my_sys.h
extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
-diff -Naur mysql-5.5.8.orig/include/mysql.h.pp mysql-5.5.8/include/mysql.h.pp
---- mysql-5.5.8.orig/include/mysql.h.pp 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/mysql.h.pp 2010-12-27 14:27:23.956926896 -0500
-@@ -86,7 +86,7 @@
- void my_net_local_init(NET *net);
- void net_end(NET *net);
- void net_clear(NET *net, my_bool clear_buffer);
--my_bool net_realloc(NET *net, size_t length);
-+my_bool mysql_net_realloc(NET *net, size_t length);
- my_bool net_flush(NET *net);
- my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
- my_bool net_write_command(NET *net,unsigned char command,
-diff -Naur mysql-5.5.8.orig/include/mysql_com.h mysql-5.5.8/include/mysql_com.h
---- mysql-5.5.8.orig/include/mysql_com.h 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/mysql_com.h 2010-12-27 14:27:23.957927198 -0500
-@@ -448,6 +448,7 @@
- void my_net_local_init(NET *net);
- void net_end(NET *net);
- void net_clear(NET *net, my_bool clear_buffer);
-+#define net_realloc mysql_net_realloc /* namespace sanity */
- my_bool net_realloc(NET *net, size_t length);
- my_bool net_flush(NET *net);
- my_bool my_net_write(NET *net,const unsigned char *packet, size_t len);
+diff -up mysql-5.5.28/sql/password.c.p8 mysql-5.5.28/sql/password.c
+--- mysql-5.5.28/sql/password.c.p8 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql/password.c 2012-12-06 14:16:14.599520860 +0100
+@@ -155,23 +155,6 @@ void my_make_scrambled_password_323(char
+
+
+ /*
+- Wrapper around my_make_scrambled_password_323() to maintain client lib ABI
+- compatibility.
+- In server code usage of my_make_scrambled_password_323() is preferred to
+- avoid strlen().
+- SYNOPSIS
+- make_scrambled_password_323()
+- to OUT store scrambled password here
+- password IN NULL-terminated string with user-supplied password
+-*/
+-
+-void make_scrambled_password_323(char *to, const char *password)
+-{
+- my_make_scrambled_password_323(to, password, strlen(password));
+-}
+-
+-
+-/*
+ Scramble string with password.
+ Used in pre 4.1 authentication phase.
+ SYNOPSIS
+@@ -434,23 +417,6 @@ void my_make_scrambled_password(char *to
+
+
+ /*
+- Wrapper around my_make_scrambled_password() to maintain client lib ABI
+- compatibility.
+- In server code usage of my_make_scrambled_password() is preferred to
+- avoid strlen().
+- SYNOPSIS
+- make_scrambled_password()
+- buf OUT buffer of size 2*SHA1_HASH_SIZE + 2 to store hex string
+- password IN NULL-terminated password string
+-*/
+-
+-void make_scrambled_password(char *to, const char *password)
+-{
+- my_make_scrambled_password(to, password, strlen(password));
+-}
+-
+-
+-/*
+ Produce an obscure octet sequence from password and random
+ string, recieved from the server. This sequence corresponds to the
+ password, but password can not be easily restored from it. The sequence
diff --git a/mysql-embedded-crash.patch b/mysql-embedded-crash.patch
deleted file mode 100644
index b445fce..0000000
--- a/mysql-embedded-crash.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Fix crash in embedded mysql library when mysql_library_init() is invoked
-with argc = 0, as is supposed to be a supported thing to do.
-Patch from upstream bug #57931.
-
-
-diff -Naur mysql-5.5.8.orig/libmysqld/lib_sql.cc mysql-5.5.8/libmysqld/lib_sql.cc
---- mysql-5.5.8.orig/libmysqld/lib_sql.cc 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/libmysqld/lib_sql.cc 2011-01-12 23:10:55.837471629 -0500
-@@ -510,8 +510,8 @@
- return 1;
- defaults_argc= *argcp;
- defaults_argv= *argvp;
-- remaining_argc= argc;
-- remaining_argv= argv;
-+ remaining_argc= *argcp;
-+ remaining_argv= *argvp;
-
- /* Must be initialized early for comparison of options name */
- system_charset_info= &my_charset_utf8_general_ci;
diff --git a/mysql-errno.patch b/mysql-errno.patch
index 93e61de..ce9d7a1 100644
--- a/mysql-errno.patch
+++ b/mysql-errno.patch
@@ -1,10 +1,10 @@
"extern int errno" is just a really bad idea.
-diff -Naur mysql-5.5.8.orig/include/my_sys.h mysql-5.5.8/include/my_sys.h
---- mysql-5.5.8.orig/include/my_sys.h 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/my_sys.h 2010-12-20 21:20:12.622190325 -0500
-@@ -201,13 +201,8 @@
+diff -up mysql-5.5.28/include/my_sys.h.p1 mysql-5.5.28/include/my_sys.h
+--- mysql-5.5.28/include/my_sys.h.p1 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/include/my_sys.h 2012-12-06 14:09:15.218170154 +0100
+@@ -197,13 +197,8 @@ extern void my_large_free(uchar *ptr);
#define my_afree(PTR) my_free(PTR)
#endif /* HAVE_ALLOCA */
diff --git a/mysql-file-contents.patch b/mysql-file-contents.patch
new file mode 100644
index 0000000..73c680d
--- /dev/null
+++ b/mysql-file-contents.patch
@@ -0,0 +1,27 @@
+Upstream chooses to install INFO_SRC and INFO_BIN into the docs dir, which
+breaks at least two packaging commandments, so we put them into $libdir
+instead. That means we have to hack the file_contents regression test
+to know about this.
+
+Recommendation they change is at http://bugs.mysql.com/bug.php?id=61425
+
+
+diff -Naur mysql-5.5.21.orig/mysql-test/t/file_contents.test mysql-5.5.21/mysql-test/t/file_contents.test
+--- mysql-5.5.21.orig/mysql-test/t/file_contents.test 2012-01-31 06:28:15.000000000 -0500
++++ mysql-5.5.21/mysql-test/t/file_contents.test 2012-02-27 17:18:57.716087918 -0500
+@@ -31,6 +31,15 @@
+ } else {
+ # RedHat: version number in directory name
+ $dir_docs = glob "$dir_docs/MySQL-server*";
++
++ # All the above is entirely wacko, because these files are not docs;
++ # they should be kept in libdir instead. mtr does not provide a nice
++ # way to find libdir though, so we have to kluge it like this:
++ if (-d "/usr/lib64/mysql") {
++ $dir_docs = "/usr/lib64/mysql";
++ } else {
++ $dir_docs = "/usr/lib/mysql";
++ }
+ }
+ } else {
+ # tar.gz package, Windows, or developer work (in BZR)
diff --git a/mysql-home.patch b/mysql-home.patch
deleted file mode 100644
index 054d389..0000000
--- a/mysql-home.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-mysql 5.5's new cmake-based build scripts forgot about defining
-DEFAULT_HOME_ENV. Upstream at http://bugs.mysql.com/bug.php?id=59280
-
-
-diff -Naur mysql-5.5.8.orig/mysys/CMakeLists.txt mysql-5.5.8/mysys/CMakeLists.txt
---- mysql-5.5.8.orig/mysys/CMakeLists.txt 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/mysys/CMakeLists.txt 2011-01-13 11:58:42.583471734 -0500
-@@ -69,6 +69,8 @@
- SET(MYSYS_SOURCES ${MYSYS_SOURCES} my_port.c)
- ENDIF()
-
-+ADD_DEFINITIONS( -DDEFAULT_HOME_ENV=MYSQL_HOME)
-+
- ADD_CONVENIENCE_LIBRARY(mysys ${MYSYS_SOURCES})
- TARGET_LINK_LIBRARIES(mysys dbug strings ${ZLIB_LIBRARY}
- ${LIBNSL} ${LIBM} ${LIBRT})
diff --git a/mysql-install-test.patch b/mysql-install-test.patch
index 5980aea..a31a280 100644
--- a/mysql-install-test.patch
+++ b/mysql-install-test.patch
@@ -1,27 +1,46 @@
Improve the documentation that will be installed in the mysql-test RPM.
-diff -Naur mysql-5.1.43.orig/mysql-test/README mysql-5.1.43/mysql-test/README
---- mysql-5.1.43.orig/mysql-test/README 2010-01-15 12:14:43.000000000 -0500
-+++ mysql-5.1.43/mysql-test/README 2010-02-13 21:18:06.000000000 -0500
-@@ -6,6 +6,16 @@
- actually have a co-existing MySQL installation. The tests will not
- conflict with it.
+diff -Naur mysql-5.5.20.orig/mysql-test/README mysql-5.5.20/mysql-test/README
+--- mysql-5.5.20.orig/mysql-test/README 2011-12-16 14:52:05.000000000 -0500
++++ mysql-5.5.20/mysql-test/README 2012-02-10 17:06:19.531082253 -0500
+@@ -1,14 +1,26 @@
+ This directory contains a test suite for the MySQL daemon. To run
+-the currently existing test cases, simply execute ./mysql-test-run in
+-this directory. It will fire up the newly built mysqld and test it.
++the currently existing test cases, execute ./mysql-test-run in
++this directory.
+-Note that you do not have to have to do "make install", and you could
+-actually have a co-existing MySQL installation. The tests will not
+-conflict with it.
+-
+-All tests must pass. If one or more of them fail on your system, please
+-read the following manual section for instructions on how to report the
+-problem:
+For use in Red Hat distributions, you should run the script as user mysql,
+so the best bet is something like
+ cd /usr/share/mysql-test
-+ sudo -u mysql ./mysql-test-run
++ sudo -u mysql ./mysql-test-run --skip-test-list=rh-skipped-tests.list
+This will use the installed mysql executables, but will run a private copy
+of the server process (using data files within /usr/share/mysql-test),
+so you need not start the mysqld service beforehand.
++
++The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are
++known to fail on one or more Red-Hat-supported platforms. You can omit it
++if you want to check whether such failures occur for you. Documentation
++about the reasons for omitting such tests can be found in the file
++rh-skipped-tests.list.
++
+To clean up afterwards, remove the created "var" subdirectory, eg
+ sudo -u mysql rm -rf /usr/share/mysql-test/var
+
- All tests must pass. If one or more of them fail on your system, please
- read the following manual section for instructions on how to report the
- problem:
-@@ -25,7 +35,8 @@
++If one or more tests fail on your system, please read the following manual
++section for instructions on how to report the problem:
+
+ http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
+
+@@ -25,7 +37,8 @@
With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
diff --git a/mysql-logrotate.patch b/mysql-logrotate.patch
new file mode 100644
index 0000000..f76237d
--- /dev/null
+++ b/mysql-logrotate.patch
@@ -0,0 +1,66 @@
+Adjust the mysql-log-rotate script in several ways:
+
+* Use the correct log file pathname for Red Hat installations.
+* Enable creation of the log file by logrotate (needed since
+ /var/log/ isn't writable by mysql user); and set the same 640
+ permissions we normally use.
+* Comment out the actual rotation commands, so that user must edit
+ the file to enable rotation. This is unfortunate, but the fact
+ that the script will probably fail without manual configuration
+ (to set a root password) means that we can't really have it turned
+ on by default. Fortunately, in most configurations the log file
+ is low-volume and so rotation is not critical functionality.
+
+See discussions at RH bugs 799735, 547007
+
+
+diff -Naur mysql-5.5.22.orig/support-files/mysql-log-rotate.sh mysql-5.5.22/support-files/mysql-log-rotate.sh
+--- mysql-5.5.22.orig/support-files/mysql-log-rotate.sh 2012-03-02 14:44:46.000000000 -0500
++++ mysql-5.5.22/support-files/mysql-log-rotate.sh 2012-03-23 22:33:29.092043705 -0400
+@@ -3,7 +3,7 @@
+ # in the [safe_mysqld] section as follows:
+ #
+ # [safe_mysqld]
+-# err-log=@localstatedir@/mysqld.log
++# err-log=/var/log/mysqld.log
+ #
+ # If the root user has a password you have to create a
+ # /root/.my.cnf configuration file with the following
+@@ -18,19 +18,21 @@
+ # ATTENTION: This /root/.my.cnf should be readable ONLY
+ # for root !
+
+-@localstatedir@/mysqld.log {
+- # create 600 mysql mysql
+- notifempty
+- daily
+- rotate 3
+- missingok
+- compress
+- postrotate
+- # just if mysqld is really running
+- if test -x @bindir@/mysqladmin && \
+- @bindir@/mysqladmin ping &>/dev/null
+- then
+- @bindir@/mysqladmin flush-logs
+- fi
+- endscript
+-}
++# Then, un-comment the following lines to enable rotation of mysql's log file:
++
++#/var/log/mysqld.log {
++# create 640 mysql mysql
++# notifempty
++# daily
++# rotate 3
++# missingok
++# compress
++# postrotate
++# # just if mysqld is really running
++# if test -x @bindir@/mysqladmin && \
++# @bindir@/mysqladmin ping &>/dev/null
++# then
++# @bindir@/mysqladmin flush-logs
++# fi
++# endscript
++#}
diff --git a/mysql-netdevname.patch b/mysql-netdevname.patch
new file mode 100644
index 0000000..af17f13
--- /dev/null
+++ b/mysql-netdevname.patch
@@ -0,0 +1,59 @@
+diff -up mysql-5.5.15/mysys/my_gethwaddr.c.netdevname mysql-5.5.15/mysys/my_gethwaddr.c
+--- mysql-5.5.15/mysys/my_gethwaddr.c.netdevname 2011-07-13 21:09:02.000000000 +0200
++++ mysql-5.5.15/mysys/my_gethwaddr.c 2011-11-01 12:32:35.356119715 +0100
+@@ -68,28 +68,47 @@ err:
+ #include <sys/ioctl.h>
+ #include <net/ethernet.h>
+
++#define MAX_IFS 64
++
+ my_bool my_gethwaddr(uchar *to)
+ {
+ int fd, res= 1;
+ struct ifreq ifr;
+ char zero_array[ETHER_ADDR_LEN] = {0};
++ struct ifconf ifc;
++ struct ifreq ifs[MAX_IFS], *ifri, *ifend;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ goto err;
+
+- bzero(&ifr, sizeof(ifr));
+- strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1);
++ ifc.ifc_len = sizeof(ifs);
++ ifc.ifc_req = ifs;
++ if (ioctl(fd, SIOCGIFCONF, &ifc) < 0)
++ {
++ close(fd);
++ goto err;
++ }
++
++ memcpy(to, zero_array, ETHER_ADDR_LEN);
+
+- do
++ ifend = ifs + (ifc.ifc_len / sizeof(struct ifreq));
++ for (ifri = ifc.ifc_req; ifri < ifend; ifri++)
+ {
+- if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0)
++ if (ifri->ifr_addr.sa_family == AF_INET)
+ {
+- memcpy(to, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+- res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1;
++ bzero(&ifr, sizeof(ifr));
++ strncpy(ifr.ifr_name, ifri->ifr_name, sizeof(ifr.ifr_name));
++
++ /* Get HW address */
++ if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0)
++ {
++ memcpy(to, &ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
++ if (!(res= memcmp(to, zero_array, ETHER_ADDR_LEN) ? 0 : 1))
++ break;
++ }
+ }
+- } while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6');
+-
++ }
+ close(fd);
+ err:
+ return res;
diff --git a/mysql-plugin-bool.patch b/mysql-plugin-bool.patch
index a8458f4..abea580 100644
--- a/mysql-plugin-bool.patch
+++ b/mysql-plugin-bool.patch
@@ -4,22 +4,10 @@ machines where char is unsigned print "255" instead. Filed upstream at
http://bugs.mysql.com/bug.php?id=59905
-diff -Naur mysql-5.5.8.orig/sql/sql_plugin.cc mysql-5.5.8/sql/sql_plugin.cc
---- mysql-5.5.8.orig/sql/sql_plugin.cc 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/sql/sql_plugin.cc 2011-02-01 20:34:10.218305349 -0500
-@@ -2024,7 +2024,7 @@
- goto err;
- result= (int) tmp;
- }
-- *(my_bool *) save= -result;
-+ *(my_bool *) save= result ? true : false;
- return 0;
- err:
- return 1;
-diff -Naur mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
---- mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result 2010-12-03 12:58:25.000000000 -0500
-+++ mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result 2011-02-01 21:53:20.006302245 -0500
-@@ -45,7 +45,7 @@
+diff -up mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result.p10 mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result
+--- mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result.p10 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result 2012-12-06 14:20:53.078755855 +0100
+@@ -45,7 +45,7 @@ set session rpl_semi_sync_master_enabled
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled
@@ -28,10 +16,10 @@ diff -Naur mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_ena
select @@session.rpl_semi_sync_master_enabled;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable
show global variables like 'rpl_semi_sync_master_enabled';
-diff -Naur mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
---- mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result 2011-02-01 21:53:59.689249491 -0500
-@@ -45,7 +45,7 @@
+diff -up mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result.p10 mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result
+--- mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result.p10 2012-08-29 10:50:47.000000000 +0200
++++ mysql-5.5.28/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result 2012-12-06 14:20:53.078755855 +0100
+@@ -45,7 +45,7 @@ set session rpl_semi_sync_slave_enabled=
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
select @@global.rpl_semi_sync_slave_enabled;
@@global.rpl_semi_sync_slave_enabled
@@ -40,3 +28,15 @@ diff -Naur mysql-5.5.8.orig/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enab
select @@session.rpl_semi_sync_slave_enabled;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable
show global variables like 'rpl_semi_sync_slave_enabled';
+diff -up mysql-5.5.28/sql/sql_plugin.cc.p10 mysql-5.5.28/sql/sql_plugin.cc
+--- mysql-5.5.28/sql/sql_plugin.cc.p10 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql/sql_plugin.cc 2012-12-06 14:20:53.078755855 +0100
+@@ -2094,7 +2094,7 @@ static int check_func_bool(THD *thd, str
+ goto err;
+ result= (int) tmp;
+ }
+- *(my_bool *) save= -result;
++ *(my_bool *) save= result ? true : false;
+ return 0;
+ err:
+ return 1;
diff --git a/mysql-plugin-test.patch b/mysql-plugin-test.patch
new file mode 100644
index 0000000..5d08c32
--- /dev/null
+++ b/mysql-plugin-test.patch
@@ -0,0 +1,96 @@
+mysql_plugin.test fails when run in mysql-test RPM, though the build-time
+regression test is OK. This patch is from the pre-existing upstream bug
+report, except we also fix the part that tries to scribble on the
+read-only-to-us plugin directory.
+
+rhbz #789530, upstream at http://bugs.mysql.com/bug.php?id=62907
+
+
+diff -up mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt.plugin mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt
+--- mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt.plugin 2012-01-31 12:28:15.000000000 +0100
++++ mysql-5.5.21/mysql-test/t/mysql_plugin-master.opt 2012-03-14 16:54:19.060951822 +0100
+@@ -1 +1 @@
+---plugin-dir=$DAEMONEXAMPLE_DIR
++--plugin-dir=$MYSQLTEST_VARDIR/plugin
+diff -up mysql-5.5.21/mysql-test/t/mysql_plugin.test.plugin mysql-5.5.21/mysql-test/t/mysql_plugin.test
+--- mysql-5.5.21/mysql-test/t/mysql_plugin.test.plugin 2012-01-31 12:28:15.000000000 +0100
++++ mysql-5.5.21/mysql-test/t/mysql_plugin.test 2012-03-14 17:11:40.769295981 +0100
+@@ -25,8 +25,10 @@
+ # Add the datadir, basedir, plugin_dir to the bootstrap command
+ let $MYSQLD_DATADIR= `select @@datadir`;
+ let $MYSQL_BASEDIR= `select @@basedir`;
++let $MYSQLD_TMP_BASEDIR= $MYSQLTEST_VARDIR/tmp;
+ let $MYSQL_ERRMSG_BASEDIR=`select @@lc_messages_dir`;
+ let $PLUGIN_DIR=`select @@plugin_dir`;
++let $PLUGIN_BASEDIR=$DAEMONEXAMPLE_DIR;
+
+ --disable_abort_on_error
+
+@@ -51,10 +53,11 @@ use File::Basename;
+ {
+ print FILE "let \$DAEMONEXAMPLE_DIR= $not_found;\n";
+ }
+- if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
+- {
+- print FILE "let \$PLUGIN_DIR= $not_found;\n";
+- }
++# This test doesn't work because $ENV{PLUGIN_DIR} is empty
++# if ((!-e $plugindir_ini) || (!-r $plugindir_ini))
++# {
++# print FILE "let \$PLUGIN_DIR= $not_found;\n";
++# }
+ close FILE;
+ EOF
+
+@@ -66,10 +69,14 @@ remove_file $MYSQL_TMP_DIR/mysqld.inc;
+ # mysql version, so errmsg.sys will be copied to "basedir/share", we create
+ # and remove this structure.
+
+---mkdir $MYSQLD_BASEDIR/share
+---mkdir $MYSQLD_BASEDIR/share/mysql
+---copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/errmsg.sys
+---copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_BASEDIR/share/mysql/errmsg.sys
++--mkdir $MYSQLD_TMP_BASEDIR/share
++--mkdir $MYSQLD_TMP_BASEDIR/share/mysql
++--mkdir $PLUGIN_DIR
++--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_TMP_BASEDIR/share/errmsg.sys
++--copy_file $MYSQL_ERRMSG_BASEDIR/english/errmsg.sys $MYSQLD_TMP_BASEDIR/share/mysql/errmsg.sys
++--copy_file $PLUGIN_BASEDIR/libdaemon_example.so $PLUGIN_DIR/libdaemon_example.so
++--copy_file $PLUGIN_BASEDIR/daemon_example.ini $PLUGIN_DIR/daemon_example.ini
++
+
+ # The mysql_plugin tool now accepts --my-print-defaults which points to the
+ # executable my_print_defaults.exe we can get this path from the variable
+@@ -100,7 +107,7 @@ if ($PLUGIN_DIR == '')
+
+ # Build client command for reuse.
+
+-let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
++let $MYSQL_PLUGIN_CMD= $MYSQL_PLUGIN --datadir=$MYSQLD_DATADIR --basedir=$MYSQLD_TMP_BASEDIR --plugin-dir=$PLUGIN_DIR --mysqld=$MYSQLD_BASEDIR --my-print-defaults=$MYSQL_MY_PRINT_DEFAULTS_BASEDIR;
+
+ --echo #
+ --echo # Ensure the plugin isn't loaded.
+@@ -202,7 +209,7 @@ EOF
+ # we must copy the example daemon to a new location renaming it.
+
+ let $DAEMON_RELOAD = lib$DAEMONEXAMPLE;
+---copy_file $PLUGIN_DIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
++--copy_file $PLUGIN_BASEDIR/$DAEMONEXAMPLE $PLUGIN_DIR/$DAEMON_RELOAD
+ --copy_file include/libdaemon_example.ini $PLUGIN_DIR/libdaemon_example.ini
+
+ # Now reload it and see that it is a different name.
+@@ -395,8 +402,11 @@ EOF
+ --remove_file $expect_file
+
+ # Cleanup the share folder in the binary path.
+---remove_file $MYSQLD_BASEDIR/share/errmsg.sys
+---rmdir $MYSQLD_BASEDIR/share/mysql
+---rmdir $MYSQLD_BASEDIR/share
++--remove_file $PLUGIN_DIR/daemon_example.ini
++--remove_file $PLUGIN_DIR/libdaemon_example.so
++--rmdir $PLUGIN_DIR
++--remove_file $MYSQLD_TMP_BASEDIR/share/errmsg.sys
++--rmdir $MYSQLD_TMP_BASEDIR/share/mysql
++--rmdir $MYSQLD_TMP_BASEDIR/share
+
+ --enable_abort_on_error
diff --git a/mysql-s390-tsc.patch b/mysql-s390-tsc.patch
index 00811a4..f995266 100644
--- a/mysql-s390-tsc.patch
+++ b/mysql-s390-tsc.patch
@@ -2,10 +2,10 @@ Support s390/s390x in performance schema's cycle-counting functions.
Filed upstream at http://bugs.mysql.com/bug.php?id=59953
-diff -Naur mysql-5.5.8.orig/include/my_rdtsc.h mysql-5.5.8/include/my_rdtsc.h
---- mysql-5.5.8.orig/include/my_rdtsc.h 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/my_rdtsc.h 2011-02-04 11:16:45.431459913 -0500
-@@ -124,6 +124,7 @@
+diff -up mysql-5.5.28/include/my_rdtsc.h.p11 mysql-5.5.28/include/my_rdtsc.h
+--- mysql-5.5.28/include/my_rdtsc.h.p11 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/include/my_rdtsc.h 2012-12-06 14:22:13.651823354 +0100
+@@ -125,6 +125,7 @@ C_MODE_END
#define MY_TIMER_ROUTINE_MACH_ABSOLUTE_TIME 25
#define MY_TIMER_ROUTINE_GETSYSTEMTIMEASFILETIME 26
#define MY_TIMER_ROUTINE_ASM_SUNPRO_X86_64 27
@@ -13,10 +13,10 @@ diff -Naur mysql-5.5.8.orig/include/my_rdtsc.h mysql-5.5.8/include/my_rdtsc.h
#endif
-diff -Naur mysql-5.5.8.orig/mysys/my_rdtsc.c mysql-5.5.8/mysys/my_rdtsc.c
---- mysql-5.5.8.orig/mysys/my_rdtsc.c 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/mysys/my_rdtsc.c 2011-02-04 11:16:45.432465577 -0500
-@@ -224,6 +224,13 @@
+diff -up mysql-5.5.28/mysys/my_rdtsc.c.p11 mysql-5.5.28/mysys/my_rdtsc.c
+--- mysql-5.5.28/mysys/my_rdtsc.c.p11 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/mysys/my_rdtsc.c 2012-12-06 14:22:13.672823375 +0100
+@@ -224,6 +224,13 @@ ulonglong my_timer_cycles(void)
clock_gettime(CLOCK_SGI_CYCLE, &tp);
return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec;
}
@@ -30,7 +30,7 @@ diff -Naur mysql-5.5.8.orig/mysys/my_rdtsc.c mysql-5.5.8/mysys/my_rdtsc.c
#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME)
/* gethrtime may appear as either cycle or nanosecond counter */
return (ulonglong) gethrtime();
-@@ -533,6 +540,8 @@
+@@ -533,6 +540,8 @@ void my_timer_init(MY_TIMER_INFO *mti)
mti->cycles.routine= MY_TIMER_ROUTINE_ASM_GCC_SPARC32;
#elif defined(__sgi) && defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_SGI_CYCLE)
mti->cycles.routine= MY_TIMER_ROUTINE_SGI_CYCLE;
diff --git a/mysql-stack-guard.patch b/mysql-stack-guard.patch
index 0634560..c01c1a7 100644
--- a/mysql-stack-guard.patch
+++ b/mysql-stack-guard.patch
@@ -8,10 +8,10 @@ mysqld.cc; is it important to fix any of the others?
Filed upstream at http://bugs.mysql.com/bug.php?id=35019
-diff -Naur mysql-5.5.8.orig/sql/mysqld.cc mysql-5.5.8/sql/mysqld.cc
---- mysql-5.5.8.orig/sql/mysqld.cc 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/sql/mysqld.cc 2010-12-20 22:01:08.939186906 -0500
-@@ -2602,6 +2602,70 @@
+diff -up mysql-5.5.28/sql/mysqld.cc.p5 mysql-5.5.28/sql/mysqld.cc
+--- mysql-5.5.28/sql/mysqld.cc.p5 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql/mysqld.cc 2012-12-06 14:13:59.765407494 +0100
+@@ -2599,6 +2599,70 @@ static void init_signals(void)
}
@@ -82,7 +82,7 @@ diff -Naur mysql-5.5.8.orig/sql/mysqld.cc mysql-5.5.8/sql/mysqld.cc
static void start_signal_handler(void)
{
int error;
-@@ -2612,15 +2676,7 @@
+@@ -2609,15 +2673,7 @@ static void start_signal_handler(void)
#if !defined(HAVE_DEC_3_2_THREADS)
pthread_attr_setscope(&thr_attr,PTHREAD_SCOPE_SYSTEM);
(void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
@@ -99,7 +99,7 @@ diff -Naur mysql-5.5.8.orig/sql/mysqld.cc mysql-5.5.8/sql/mysqld.cc
#endif
mysql_mutex_lock(&LOCK_thread_count);
-@@ -4361,36 +4417,8 @@
+@@ -4398,36 +4454,8 @@ int mysqld_main(int argc, char **argv)
unireg_abort(1); // Will do exit
init_signals();
diff --git a/mysql-string-overflow.patch b/mysql-string-overflow.patch
new file mode 100644
index 0000000..eaa40f6
--- /dev/null
+++ b/mysql-string-overflow.patch
@@ -0,0 +1,57 @@
+These issues were found by Coverity static analysis tool, for more info
+see messages by particular fixes (messages belong to 5.1.61).
+
+Filed upstream at http://bugs.mysql.com/bug.php?id=64631
+
+
+Error: BUFFER_SIZE_WARNING:
+/builddir/build/BUILD/mysql-5.1.61/sql/sql_prepare.cc:2749: buffer_size_warning: Calling strncpy with a maximum size argument of 512 bytes on destination array "this->stmt->last_error" of size 512 bytes might leave the destination string unterminated.
+
+diff -up mysql-5.5.28/sql/sql_prepare.cc.p20 mysql-5.5.28/sql/sql_prepare.cc
+--- mysql-5.5.28/sql/sql_prepare.cc.p20 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql/sql_prepare.cc 2012-12-06 14:27:28.647087401 +0100
+@@ -2879,7 +2879,7 @@ void mysql_stmt_get_longdata(THD *thd, c
+ {
+ stmt->state= Query_arena::STMT_ERROR;
+ stmt->last_errno= thd->stmt_da->sql_errno();
+- strncpy(stmt->last_error, thd->stmt_da->message(), MYSQL_ERRMSG_SIZE);
++ strncpy(stmt->last_error, thd->stmt_da->message(), sizeof(stmt->last_error)-1);
+ }
+ thd->stmt_da= save_stmt_da;
+ thd->warning_info= save_warinig_info;
+
+
+Error: STRING_OVERFLOW:
+/builddir/build/BUILD/mysql-5.1.61/sql/sql_trigger.cc:2194: fixed_size_dest: You might overrun the 512 byte fixed-size string "this->m_parse_error_message" by copying "error_message" without checking the length.
+/builddir/build/BUILD/mysql-5.1.61/sql/sql_trigger.cc:2194: 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.28/sql/sql_trigger.cc.p20 mysql-5.5.28/sql/sql_trigger.cc
+--- mysql-5.5.28/sql/sql_trigger.cc.p20 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql/sql_trigger.cc 2012-12-06 14:27:28.648087398 +0100
+@@ -2260,7 +2260,7 @@ void Table_triggers_list::mark_fields_us
+ void Table_triggers_list::set_parse_error_message(char *error_message)
+ {
+ m_has_unparseable_trigger= true;
+- strcpy(m_parse_error_message, error_message);
++ strncpy(m_parse_error_message, error_message, sizeof(m_parse_error_message)-1);
+ }
+
+
+
+
+Error: STRING_OVERFLOW:
+/builddir/build/BUILD/mysql-5.1.61/storage/innodb_plugin/handler/ha_innodb.cc:6544: fixed_size_dest: You might overrun the 512 byte fixed-size string "name2" by copying "name" without checking the length.
+/builddir/build/BUILD/mysql-5.1.61/storage/innodb_plugin/handler/ha_innodb.cc:6544: 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.28/storage/innobase/handler/ha_innodb.cc.p20 mysql-5.5.28/storage/innobase/handler/ha_innodb.cc
+--- mysql-5.5.28/storage/innobase/handler/ha_innodb.cc.p20 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/storage/innobase/handler/ha_innodb.cc 2012-12-06 14:27:28.653087416 +0100
+@@ -7054,7 +7054,7 @@ ha_innobase::create(
+
+ ut_a(strlen(name) < sizeof(name2));
+
+- strcpy(name2, name);
++ strncpy(name2, name, sizeof(name2)-1);
+
+ normalize_table_name(norm_name, name2);
+
diff --git a/mysql-strmov.patch b/mysql-strmov.patch
index 3d8ccec..2a78619 100644
--- a/mysql-strmov.patch
+++ b/mysql-strmov.patch
@@ -13,10 +13,10 @@ of any real performance gain from optimizing these calls. So I'm keeping
this patch.
-diff -Naur mysql-5.5.8.orig/include/m_string.h mysql-5.5.8/include/m_string.h
---- mysql-5.5.8.orig/include/m_string.h 2010-12-03 12:58:24.000000000 -0500
-+++ mysql-5.5.8/include/m_string.h 2010-12-20 21:39:13.905186372 -0500
-@@ -74,15 +74,6 @@
+diff -up mysql-5.5.28/include/m_string.h.p2 mysql-5.5.28/include/m_string.h
+--- mysql-5.5.28/include/m_string.h.p2 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/include/m_string.h 2012-12-06 14:12:31.225333542 +0100
+@@ -77,15 +77,6 @@ extern "C" {
extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *);
diff --git a/mysql-va-list.patch b/mysql-va-list.patch
new file mode 100644
index 0000000..552457c
--- /dev/null
+++ b/mysql-va-list.patch
@@ -0,0 +1,55 @@
+Fix unportable usage associated with va_list arguments. Passing "0" to
+a va_list argument only works if va_list is an integer or pointer type,
+which is not required by the C spec, and is not true on ARM for instance.
+Per bug #744707.
+
+
+diff -up mysql-5.5.28/sql-common/client_plugin.c.p12 mysql-5.5.28/sql-common/client_plugin.c
+--- mysql-5.5.28/sql-common/client_plugin.c.p12 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/sql-common/client_plugin.c 2012-12-06 14:22:54.494857607 +0100
+@@ -233,11 +233,13 @@ int mysql_client_plugin_init()
+ {
+ MYSQL mysql;
+ struct st_mysql_client_plugin **builtin;
++ va_list unused;
+
+ if (initialized)
+ return 0;
+
+ bzero(&mysql, sizeof(mysql)); /* dummy mysql for set_mysql_extended_error */
++ bzero(&unused, sizeof(unused)); /* suppress uninitialized-value warnings */
+
+ pthread_mutex_init(&LOCK_load_client_plugin, MY_MUTEX_INIT_SLOW);
+ init_alloc_root(&mem_root, 128, 128);
+@@ -249,7 +251,7 @@ int mysql_client_plugin_init()
+ pthread_mutex_lock(&LOCK_load_client_plugin);
+
+ for (builtin= mysql_client_builtins; *builtin; builtin++)
+- add_plugin(&mysql, *builtin, 0, 0, 0);
++ add_plugin(&mysql, *builtin, 0, 0, unused);
+
+ pthread_mutex_unlock(&LOCK_load_client_plugin);
+
+@@ -293,9 +295,13 @@ struct st_mysql_client_plugin *
+ mysql_client_register_plugin(MYSQL *mysql,
+ struct st_mysql_client_plugin *plugin)
+ {
++ va_list unused;
++
+ if (is_not_initialized(mysql, plugin->name))
+ return NULL;
+
++ bzero(&unused, sizeof(unused)); /* suppress uninitialized-value warnings */
++
+ pthread_mutex_lock(&LOCK_load_client_plugin);
+
+ /* make sure the plugin wasn't loaded meanwhile */
+@@ -307,7 +313,7 @@ mysql_client_register_plugin(MYSQL *mysq
+ plugin= NULL;
+ }
+ else
+- plugin= add_plugin(mysql, plugin, 0, 0, 0);
++ plugin= add_plugin(mysql, plugin, 0, 0, unused);
+
+ pthread_mutex_unlock(&LOCK_load_client_plugin);
+ return plugin;
diff --git a/mysql-versioning.patch b/mysql-versioning.patch
index aaaa828..6374b6c 100644
--- a/mysql-versioning.patch
+++ b/mysql-versioning.patch
@@ -4,10 +4,10 @@ forgotten the issue entirely. So we now maintain our own list of exported
symbols and jam it into the build with this hack.
-diff -Naur mysql-5.5.8.orig/libmysql/CMakeLists.txt mysql-5.5.8/libmysql/CMakeLists.txt
---- mysql-5.5.8.orig/libmysql/CMakeLists.txt 2010-12-03 12:58:26.000000000 -0500
-+++ mysql-5.5.8/libmysql/CMakeLists.txt 2010-12-21 21:00:07.135311386 -0500
-@@ -197,7 +197,7 @@
+diff -up mysql-5.5.28/libmysql/CMakeLists.txt.p7 mysql-5.5.28/libmysql/CMakeLists.txt
+--- mysql-5.5.28/libmysql/CMakeLists.txt.p7 2012-08-29 10:50:46.000000000 +0200
++++ mysql-5.5.28/libmysql/CMakeLists.txt 2012-12-06 14:15:03.905461517 +0100
+@@ -209,7 +209,7 @@ IF(NOT DISABLE_SHARED)
SET(libmysql_link_flags)
ENDIF()
SET_TARGET_PROPERTIES(libmysql PROPERTIES LINK_FLAGS