Fix crash during startup of embedded mysqld library

This commit is contained in:
Tom Lane 2011-01-13 00:40:24 -05:00 committed by Michal Schorm
parent 288764ba3f
commit 9f11c7960c
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,19 @@
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;

View File

@ -1,6 +1,6 @@
Name: mysql
Version: 5.5.8
Release: 3%{?dist}
Release: 4%{?dist}
Summary: MySQL client programs and shared libraries
Group: Applications/Databases
URL: http://www.mysql.com
@ -40,6 +40,7 @@ Patch6: mysql-chain-certs.patch
Patch7: mysql-versioning.patch
Patch8: mysql-dubious-exports.patch
Patch9: mysql-disable-test.patch
Patch10: mysql-embedded-crash.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gperf, perl, readline-devel, openssl-devel
@ -177,6 +178,7 @@ the MySQL sources.
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
# workaround for upstream bug #56342
rm -f mysql-test/t/ssl_8k_key-master.opt
@ -596,6 +598,10 @@ fi
%{_mandir}/man1/mysql_client_test.1*
%changelog
* Thu Jan 13 2011 Tom Lane <tgl@redhat.com> 5.5.8-4
- Fix crash during startup of embedded mysqld library
Resolves: #667365
* Mon Jan 3 2011 Tom Lane <tgl@redhat.com> 5.5.8-3
- my_print_help, load_defaults, free_defaults, and handle_options all turn
out to be documented/recommended in Paul DuBois' MySQL book, so we'd better