Hello community,
here is the log from the commit of package mysql
checked in at Mon Aug 21 11:42:32 CEST 2006.
--------
--- mysql/mysql.changes 2006-06-30 15:25:09.000000000 +0200
+++ mysql/mysql.changes 2006-08-18 09:30:41.000000000 +0200
@@ -1,0 +2,50 @@
+Wed Aug 16 16:17:39 CEST 2006 - mmarek@suse.cz
+
+- updated to version 5.0.24
+ * added the --ssl-verify-server-cert option to MySQL client
+ programs and MYSQL_OPT_SSL_VERIFY_SERVER_CERT for
+ mysql_options()
+ * new ssl_ca, ssl_capath, ssl_cert, ssl_cipher, and ssl_key
+ system variables
+ * added --skip-merge option to disable the MERGE storage engine,
+ because it has a minor security problem
+ [http://bugs.mysql.com/20230]
+ * mysql_upgrade script reimplemented in C
+ * bug fixes
+- dropped obsolete CVE-2006-0903.patch and pick_args.patch,
+ added my_libwrap.patch [http://bugs.mysql.com/18246]
+
+-------------------------------------------------------------------
+Tue Aug 1 16:46:22 CEST 2006 - mmarek@suse.cz
+
+- removed Recommends: from mysql-debug, it doesn't work on older
+ dists
+
+-------------------------------------------------------------------
+Mon Jul 31 16:14:05 CEST 2006 - mmarek@suse.cz
+
+- created a new mysql-debug package compiled with --with-debug
+ and removed the --with debug rpmbuild option
+- fixed --core-file option to really work when the server is
+ started by root
+ (coredump.patch) [http://bugs.mysql.com/bug.php?id=21361]
+- added a README.debug describing how to debug mysqld crashes
+- cleaned up rc.mysql a bit
+- the server depends on a minimal mysql-client version to make
+ sure a recent mysqlcheck is available for rc.mysql
+
+-------------------------------------------------------------------
+Mon Jul 31 10:03:39 CEST 2006 - mmarek@suse.cz
+
+- fixed some leaks and overflos in varbinary-upgrade.patch
+
+-------------------------------------------------------------------
+Fri Jul 21 10:28:09 CEST 2006 - mmarek@suse.cz
+
+- workaround an incompatibility with pre-5.0 varbinary fields:
+ update the .frm file and remove trailing zeros and spaces
+ in 'mysqlcheck --check-upgrade'
+ [#188134, http://bugs.mysql.com/bug.php?id=19371]
+ (varbinary-upgrade.patch)
+
+-------------------------------------------------------------------
Old:
----
minmem
mysql-5.0.22-CVE-2006-0903.patch
mysql-5.0.22-pick_args.patch
mysql-5.0.22.tar.bz2
mysql.test
New:
----
README.debug
mysql-5.0.24-coredump.patch
mysql-5.0.24-my_libwrap.patch
mysql-5.0.24-varbinary-upgrade.patch
mysql-5.0.24.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ mysql.spec ++++++
--- /var/tmp/diff_new_pack.GjNCvO/_old 2006-08-21 11:42:03.000000000 +0200
+++ /var/tmp/diff_new_pack.GjNCvO/_new 2006-08-21 11:42:03.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package mysql (Version 5.0.22)
+# spec file for package mysql (Version 5.0.24)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -14,29 +14,33 @@
BuildRequires: gcc-c++ readline-devel tcpd-devel
License: GPL, Other License(s), see package
Group: Productivity/Databases/Servers
-Requires: mysql-client perl-DBD-mysql
+# for mysqlcheck
+Requires: mysql-client >= 5.0.19
+# for mysqlhotcopy
+Requires: perl-DBD-mysql
Autoreqprov: on
-Version: 5.0.22
-Release: 2
+Version: 5.0.24
+Release: 1
URL: http://www.mysql.com
Summary: A True Multiuser, Multithreaded SQL Database Server
PreReq: /usr/sbin/useradd /usr/sbin/groupadd fileutils %install_info_prereq %fillup_prereq %insserv_prereq
-Source: %{name}-%{version}.tar.bz2
+Source: mysql-%{version}.tar.bz2
Source1: rc.mysql
Source2: README.SuSE
# manual can be found in http://mysql.linux.cz/Downloads/Manual/
Source3: manual.pdf-2005-12-16.bz2
Source4: suse-test-run
-#Patch0: %{name}-%{version}-upgrade-in-bootstrap.patch
-Patch1: %{name}-%{version}-testsuite.patch
-Patch2: %{name}-%{version}-cnf.patch
-Patch3: %{name}-%{version}-ppc.patch
-Patch4: %{name}-%{version}-group.patch
-Patch6: %{name}-%{version}-install_db.patch
-Patch7: %{name}-%{version}-4x-compat.patch
-Patch8: %{name}-%{version}-logrotate.patch
-Patch9: %{name}-%{version}-CVE-2006-0903.patch
-Patch10: %{name}-%{version}-pick_args.patch
+Source5: README.debug
+Patch1: mysql-5.0.22-testsuite.patch
+Patch2: mysql-5.0.22-cnf.patch
+Patch3: mysql-5.0.22-ppc.patch
+Patch4: mysql-5.0.22-group.patch
+Patch6: mysql-5.0.22-install_db.patch
+Patch7: mysql-5.0.22-4x-compat.patch
+Patch8: mysql-5.0.22-logrotate.patch
+Patch11: mysql-5.0.24-varbinary-upgrade.patch
+Patch12: mysql-5.0.24-coredump.patch
+Patch13: mysql-5.0.24-my_libwrap.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -158,7 +162,7 @@
License: GPL, Other License(s), see package
URL: http://www.mysql.com
Group: Productivity/Databases/Servers
-Requires: mysql
+Requires: mysql = %{version}
Autoreqprov: on
%description Max
@@ -173,6 +177,27 @@
Michael Widenius
David Axmark
+%package debug
+Summary: MySQL server with debug options turned on
+License: GPL, Other License(s), see package
+URL: http://www.mysql.com
+Group: Productivity/Databases/Servers
+Requires: mysql = %{version}
+
+%description debug
+A version of the mysql-Max server that has some debug code turned on.
+It should be only used to track down problems with the standard
+servers. Note that merely installing this package won't replace the
+standard server. Read /usr/share/doc/packages/mysql/README.debug for
+information on how to use the debug server.
+
+
+
+Authors:
+--------
+ Michael Widenius
+ David Axmark
+
%package test
Summary: MySQL testsuite
License: GPL, Other License(s), see package
@@ -195,7 +220,7 @@
David Axmark
%prep
-%setup -q -n %{name}-%{version}
+%setup -q
cp %{S:3} Docs/manual.pdf.bz2
bunzip2 Docs/manual.pdf.bz2
cp %{S:4} .
@@ -206,10 +231,11 @@
%patch6
%patch7
%patch8
-%patch9
-%patch10
+%patch11
+%patch12
+%patch13
# remove unneeded man manpages
-rm -f man/mysqlman.1 man/safe_mysqld.1
+rm man/mysqlman.1 man/safe_mysqld.1
%build
autoreconf -f -i
@@ -233,14 +259,8 @@
# The --enable-assembler simply does nothing on systems that do not
# support assembler speedups.
export CFLAGS="$RPM_OPT_FLAGS -DPIC -fPIC -DUNDEF_HAVE_INITGROUPS -fno-strict-aliasing"
-export CXXFLAGS="$RPM_OPT_FLAGS \
- -fno-strict-aliasing \
- -felide-constructors \
- -fno-exceptions \
- -fno-rtti \
- -fPIC -DPIC -DUNDEF_HAVE_INITGROUPS"
+export CXXFLAGS="$CFLAGS -fno-exceptions -fno-rtti"
./configure \
- "$@" \
--enable-assembler \
--without-readline \
--enable-large-files \
@@ -253,11 +273,7 @@
--sysconfdir=/etc \
--with-mysqld-user=mysql \
--with-isam \
-%if %{?_with_debug:1}0
- --with-debug \
-%else
--without-debug \
-%endif
--datadir=/usr/share \
--includedir=/usr/include \
--with-extra-charsets=complex \
@@ -265,9 +281,8 @@
--enable-thread-safe-client \
--with-comment="SUSE MySQL RPM" \
--with-libwrap \
- HOSTNAME="/bin/hostname -f"
- # Add this for more debugging support
- # --with-debug
+ HOSTNAME="/bin/hostname -f" \
+ "$@"
# Add this for MyISAM RAID support:
# --with-raid
# benchdir does not fit in above model. Fix when we make a separate package
@@ -299,6 +314,21 @@
mv Docs/manual.pdf Docs/manual.pdf.save
make clean
mv Docs/manual.pdf.save Docs/manual.pdf
+# build mysqld-debug
+BuildMySQL --disable-shared \
+ --${BERKELEY}-berkeley-db \
+ --with-innodb \
+ --with-embedded-server \
+ --with-mysqld-ldflags=-static \
+ --without-extra-tools \
+ --with-server-suffix=-debug \
+ --with-debug
+mv sql/mysqld sql/mysqld-debug
+nm --numeric-sort sql/mysqld-debug > sql/mysqld-debug.sym
+# save manual
+mv Docs/manual.pdf Docs/manual.pdf.save
+make clean
+mv Docs/manual.pdf.save Docs/manual.pdf
# Now build the "normal" mysqld
BuildMySQL --disable-shared \
--with-mysqld-ldflags=-static \
@@ -317,7 +347,7 @@
-s /bin/bash -d /var/lib/mysql mysql 2> /dev/null || :
# Create directory structure
DOC="Docs/INSTALL-BINARY INSTALL-SOURCE README EXCEPTIONS-CLIENT"
-DOCDIR=$RPM_BUILD_ROOT/%{_defaultdocdir}/mysql
+DOCDIR=$RPM_BUILD_ROOT/%{_defaultdocdir}/%{name}
install -d -m 755 ${DOCDIR}/cnf
install -d -m 755 ${DOCDIR}/data
install -d -m 755 ${DOCDIR}/data/mysql
@@ -331,10 +361,10 @@
make install DESTDIR=$RPM_BUILD_ROOT benchdir_root=/usr/share/
# Install shared libraries
(cd $RPM_BUILD_ROOT/usr/%_lib; tar xf $RPM_BUILD_ROOT/shared-libs.tar "*.so*")
-# install saved mysqld-max
-install -m 755 sql/mysqld-max $RPM_BUILD_ROOT/usr/sbin/mysqld-max
+# install saved mysqld-{max,debug}
+install -m 755 sql/mysqld-{max,debug} $RPM_BUILD_ROOT/usr/sbin/
# install symbol files ( for stack trace resolution)
-install -m 644 sql/mysqld-max.sym $RPM_BUILD_ROOT%{_libdir}/mysql/mysqld-max.sym
+install -m 644 sql/mysqld-{max,debug}.sym $RPM_BUILD_ROOT%{_libdir}/mysql/
install -m 644 sql/mysqld.sym $RPM_BUILD_ROOT%{_libdir}/mysql/mysqld.sym
# Preserve *.la from shared build
(cd $RPM_BUILD_ROOT%{_libdir}/mysql
@@ -349,20 +379,12 @@
install -m 660 support-files/my-medium.cnf $RPM_BUILD_ROOT/etc/my.cnf
install -m 640 scripts/mysqlaccess.conf $RPM_BUILD_ROOT/etc/mysqlaccess.conf
install -m 644 ${DOC} ${DOCDIR}
-install -m 644 %{SOURCE2} ${DOCDIR}
+install -m 644 %{SOURCE2} %{SOURCE5} ${DOCDIR}
install -m 644 Docs/manual.pdf ${DOCDIR}
-#install -m 644 Docs/manual.txt ${DOCDIR}
-#install -m 644 Docs/manual.html ${DOCDIR}/html
-#install -m 644 Docs/manual_toc.html ${DOCDIR}/html
-#rm -f ${DOCDIR}/html/index.html
-#ln -s ./manual_toc.html ${DOCDIR}/html/index.html
install -m 644 support-files/my-*.cnf ${DOCDIR}/cnf
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/mysql
-rm -f $RPM_BUILD_ROOT/sbin/rcmysql
-ln -s ../../etc/init.d/mysql $RPM_BUILD_ROOT/usr/sbin/rcmysql
+ln -sf ../../etc/init.d/mysql $RPM_BUILD_ROOT/usr/sbin/rcmysql
#install -m 755 scripts/mysql_install_db ${DOCDIR}
-rm -f $RPM_BUILD_ROOT/usr/bin/make_win_src_distribution
-rm -f $RPM_BUILD_ROOT/usr/bin/make_win_binary_distribution
install -m 755 -d $RPM_BUILD_ROOT/var/lib/mysql/tmp
# this is used by the init script
install -m 700 -d $RPM_BUILD_ROOT/var/lib/mysql/.protected
@@ -372,8 +394,10 @@
chmod +x $RPM_BUILD_ROOT/usr/share/mysql-test/suse-test-run*
# XXX this should go under /var/..., but some tests get confused by a symlink
# var -> ../../../var/...
-#ln -s ../../../var/lib/mysql/mysql-test $RPM_BUILD_ROOT/usr/share/mysql-test/var
+#ln -sf ../../../var/lib/mysql/mysql-test $RPM_BUILD_ROOT/usr/share/mysql-test/var
mkdir $RPM_BUILD_ROOT/usr/share/mysql-test/var
+# not needed, replaced by mysql_upgrade.c
+rm $RPM_BUILD_ROOT/usr/bin/mysql_upgrade_shell
%pre
/usr/sbin/groupadd -r mysql >/dev/null 2>/dev/null || :
@@ -418,7 +442,7 @@
%{insserv_cleanup}
%clean
-rm -rf $RPM_BUILD_ROOT;
+rm -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
@@ -440,6 +464,7 @@
%doc %{_mandir}/man1/mysqld_safe.1.gz
%doc %{_mandir}/man1/mysql_upgrade.1.gz
%doc %{_mandir}/man1/mysqlmanager.1.gz
+%doc %{_mandir}/man1/mysql_explain_log.1.gz
/usr/bin/my_print_defaults
/usr/bin/myisamchk
/usr/bin/myisamlog
@@ -533,12 +558,52 @@
/usr/sbin/mysqld-max
%{_libdir}/mysql/mysqld-max.sym
+%files debug
+%defattr(-, root, root)
+/usr/sbin/mysqld-debug
+%{_libdir}/mysql/mysqld-debug.sym
+
%files test
%defattr(-, root, root)
/usr/share/mysql-test
%dir %attr(755, mysql, mysql) /usr/share/mysql-test/var
%changelog -n mysql
+* Wed Aug 16 2006 - mmarek@suse.cz
+- updated to version 5.0.24
+ * added the --ssl-verify-server-cert option to MySQL client
+ programs and MYSQL_OPT_SSL_VERIFY_SERVER_CERT for
+ mysql_options()
+ * new ssl_ca, ssl_capath, ssl_cert, ssl_cipher, and ssl_key
+ system variables
+ * added --skip-merge option to disable the MERGE storage engine,
+ because it has a minor security problem
+ [http://bugs.mysql.com/20230]
+ * mysql_upgrade script reimplemented in C
+ * bug fixes
+- dropped obsolete CVE-2006-0903.patch and pick_args.patch,
+ added my_libwrap.patch [http://bugs.mysql.com/18246]
+* Tue Aug 01 2006 - mmarek@suse.cz
+- removed Recommends: from mysql-debug, it doesn't work on older
+ dists
+* Mon Jul 31 2006 - mmarek@suse.cz
+- created a new mysql-debug package compiled with --with-debug
+ and removed the --with debug rpmbuild option
+- fixed --core-file option to really work when the server is
+ started by root
+ (coredump.patch) [http://bugs.mysql.com/bug.php?id=21361]
+- added a README.debug describing how to debug mysqld crashes
+- cleaned up rc.mysql a bit
+- the server depends on a minimal mysql-client version to make
+ sure a recent mysqlcheck is available for rc.mysql
+* Mon Jul 31 2006 - mmarek@suse.cz
+- fixed some leaks and overflos in varbinary-upgrade.patch
+* Fri Jul 21 2006 - mmarek@suse.cz
+- workaround an incompatibility with pre-5.0 varbinary fields:
+ update the .frm file and remove trailing zeros and spaces
+ in 'mysqlcheck --check-upgrade'
+ [#188134, http://bugs.mysql.com/bug.php?id=19371]
+ (varbinary-upgrade.patch)
* Fri Jun 30 2006 - mmarek@suse.cz
- use --skip-networking when running running the server with
--skip-grant-tables in rcmysql (problem reported by Lenz Grimmer)
++++++ mysql-5.0.24-coredump.patch ++++++
# The kernel won't generate coredumps after setgid() and setuid()
# unless prctl(PR_SET_DUMPABLE, 1) is called
--- sql/mysqld.cc
+++ sql/mysqld.cc
@@ -126,6 +126,10 @@
#include
#endif
+#ifdef HAVE_LINUX_PRCTL
+#include
+#endif
+
#ifdef __NETWARE__
#define zVOLSTATE_ACTIVE 6
#define zVOLSTATE_DEACTIVE 2
@@ -1362,7 +1366,13 @@
sql_perror("setuid");
unireg_abort(1);
}
-#endif
+#ifdef HAVE_LINUX_PRCTL
+ if (test_flags & TEST_CORE_ON_SIGNAL)
+ {
+ prctl(PR_SET_DUMPABLE, 1);
+ }
+#endif /* HAVE_LINUX_PRCTL */
+#endif /* !__WIN__ !OS2 !__NETWARE__ */
}
--- configure.in
+++ configure.in
@@ -2210,6 +2210,19 @@
fi
AC_MSG_RESULT("$netinet_inc")
+# Check for Linux prctl() to get mysqld coredumps
+# IRIX reportedly has prctl() too, but it works different
+AC_MSG_CHECKING(for Linux prctl())
+AC_TRY_COMPILE(
+[#include ],
+[prctl(PR_SET_DUMPABLE, 1);],
+linux_prctl=yes, linux_prctl=no)
+if test "$linux_prctl" = "yes"
+then
+ AC_DEFINE([HAVE_LINUX_PRCTL], [1], [prctl(PR_SET_DUMPABLE, 1) can be used])
+fi
+AC_MSG_RESULT($linux_prctl)
+
# Only build client code?
AC_ARG_WITH(server,
[ --without-server Only build the client.],
++++++ mysql-5.0.24-my_libwrap.patch ++++++
--- mysys/my_libwrap.c
+++ mysys/my_libwrap.c
@@ -31,12 +31,12 @@
int my_hosts_access(struct request_info *req)
{
- hosts_access(req);
+ return hosts_access(req);
}
char *my_eval_client(struct request_info *req)
{
- eval_client(req);
+ return eval_client(req);
}
#endif /* HAVE_LIBWRAP */
++++++ mysql-5.0.24-varbinary-upgrade.patch ++++++
--- sql/handler.cc
+++ sql/handler.cc
@@ -1887,6 +1887,10 @@
{
return HA_ADMIN_NEEDS_ALTER;
}
+ if ((*field)->type() == FIELD_TYPE_VAR_STRING)
+ {
+ return HA_ADMIN_NEEDS_ALTER;
+ }
}
}
return 0;
--- client/mysqlcheck.c
+++ client/mysqlcheck.c
@@ -515,6 +515,94 @@
return 0;
} /* use_db */
+/*
+ * remove trailing spaces / zeroes from pre-5.0 varbinary fields
+ * actually, this doesn't belog here but into the server (REPAIR TABLE),
+ */
+static int repair_varbinary(char *table, uint length)
+{
+ MYSQL_RES *res;
+ MYSQL_ROW row;
+ char *query, message[100], *ptr;
+ uint query_length= 0, num_cols;
+
+ if (opt_all_in_1)
+ {
+ fputs("repair_varbinary doesn't work with --all-in-1\n", stderr);
+ return 1;
+ }
+ /* SHOW COLUMNS FROM `db`.`table` */
+ query_length= sizeof("SHOW COLUMNS FROM ````")-1 + length;
+ if (!(query =(char *) my_malloc(query_length+1, MYF(MY_WME))))
+ return 1;
+ ptr= strmov(query, "SHOW COLUMNS FROM ");
+ ptr= fix_table_name(ptr, table);
+ if (mysql_real_query(sock, query, query_length))
+ {
+ my_snprintf(message, sizeof(message), "when executing '%s'", query);
+ DBerror(sock, message);
+ my_free(query, MYF(0));
+ return 1;
+ }
+ my_free(query, MYF(0));
+
+ /* UPDATE `db`.`table` SET `col1`=TRIM(TRAILING '\0' FROM `col1`),
+ * `col1`=RTIM(`col1`),
+ * `col2`= ...
+ */
+ res= mysql_store_result(sock);
+
+ /* first compute query_length */
+ query_length= sizeof("UPDATE ```` SET ")-1 + length;
+ num_cols = 0;
+ while ((row= mysql_fetch_row(res)))
+ {
+ if (!strncmp(row[1], "varbinary(", sizeof("varbinary(")-1))
+ {
+ query_length += sizeof("``=TRIM(TRAILING '\\0' FROM ``), ``=RTRIM(``), ")
+ - 1 + 4 * strlen(row[0]);
+ num_cols++;
+ }
+ }
+ if (!num_cols)
+ {
+ /* nothing to do */
+ mysql_free_result(res);
+ return 0;
+ }
+ query_length -= 2; /* no comma-space after last RTRIM */
+
+ /* then rewind and construct the query */
+ if (!(query= (char *) my_malloc(query_length+1, MYF(MY_WME))))
+ {
+ mysql_free_result(res);
+ return 1;
+ }
+ mysql_data_seek(res, 0);
+ ptr= strmov(query, "UPDATE ");
+ ptr= fix_table_name(ptr, table);
+ ptr= strmov(ptr, " SET ");
+ while ((row= mysql_fetch_row(res)))
+ {
+ if (!strncmp(row[1], "varbinary(", sizeof("varbinary(")-1))
+ {
+ ptr= strxmov(ptr, "`", row[0], "`=TRIM(TRAILING '\\0' FROM `",
+ row[0], "`), `", row[0], "`=RTRIM(`", row[0], "`)", NullS);
+ if (--num_cols)
+ ptr= strmov(ptr, ", ");
+ }
+ }
+ mysql_free_result(res);
+ if (mysql_real_query(sock, query, query_length))
+ {
+ my_snprintf(message, sizeof(message), "when executing '%s'", query);
+ DBerror(sock, message);
+ my_free(query, MYF(0));
+ return 1;
+ }
+ my_free(query, MYF(0));
+ return 0;
+}
static int handle_request_for_tables(char *tables, uint length)
{
@@ -573,6 +661,8 @@
}
print_result();
my_free(query, MYF(0));
+ if (what_to_do == DO_REPAIR && repair_varbinary(tables, length) != 0)
+ return 1;
return 0;
}
++++++ mysql-5.0.22.tar.bz2 -> mysql-5.0.24.tar.bz2 ++++++
mysql/mysql-5.0.22.tar.bz2 mysql/mysql-5.0.24.tar.bz2 differ: char 11, line 1
++++++ rc.mysql ++++++
--- mysql/rc.mysql 2006-06-30 15:22:13.000000000 +0200
+++ mysql/rc.mysql 2006-08-18 09:30:41.000000000 +0200
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Copyright (c) 1995-2002 SuSE Linux AG Nuernberg, Germany.
#
# Author: Lenz Grimmer
@@ -49,7 +49,11 @@
# Test, if mysqld or mysql-max actually exist
unset MYSQLD
-if test -x /usr/sbin/mysqld-max
+# use mysqld-debug only if explicitly requested (TODO: sysconfig variable?)
+if test "$MYSQLD_DEBUG" = yes -a -x /usr/sbin/mysqld-debug
+then
+ MYSQLD=/usr/sbin/mysqld-debug
+elif test -x /usr/sbin/mysqld-max
then
MYSQLD=/usr/sbin/mysqld-max
elif test -x /usr/sbin/mysqld
@@ -66,25 +70,8 @@
mysql_daemon_group=mysql
pid_file=/var/lib/mysql/mysqld.pid
socket=/var/lib/mysql/mysql.sock
-MYADMIN=/usr/bin/mysqladmin
+print_defaults=/usr/bin/my_print_defaults
export TMPDIR=/var/lib/mysql/tmp
-if test -z "$basedir"
-then
- basedir=/usr
- bindir=/usr/bin
-else
- bindir="$basedir/bin"
-fi
-
-if test -z "$pid_file"
-then
- pid_file=$datadir/`/bin/hostname`.pid
-else
- case "$pid_file" in
- /* ) ;;
- * ) pid_file="$datadir/$pid_file" ;;
- esac
-fi
mode=$1 # start or stop
@@ -110,44 +97,6 @@
return 0
}
-# Get arguments from the my.cnf file, groups [mysqld] and [mysql_server]
-if test -x ./bin/my_print_defaults
-then
- print_defaults="./bin/my_print_defaults"
-elif test -x $bindir/my_print_defaults
-then
- print_defaults="$bindir/my_print_defaults"
-elif test -x $bindir/mysql_print_defaults
-then
- print_defaults="$bindir/mysql_print_defaults"
-else
- # Try to find basedir in /etc/my.cnf
- conf=/etc/my.cnf
- print_defaults=
- if test -r $conf
- then
- subpat='^[^=]*basedir[^=]*=\(.*\)$'
- dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
- for d in $dirs
- do
- d=`echo $d | sed -e 's/[ ]//g'`
- if test -x "$d/bin/my_print_defaults"
- then
- print_defaults="$d/bin/my_print_defaults"
- break
- fi
- if test -x "$d/bin/mysql_print_defaults"
- then
- print_defaults="$d/bin/mysql_print_defaults"
- break
- fi
- done
- fi
-
- # Hope it's in the PATH ... but I doubt it
- test -z "$print_defaults" && print_defaults="my_print_defaults"
-fi
-
parse_arguments `$print_defaults $defaults mysqld mysql_server`
# Safeguard (relative paths, core dumps..)
@@ -162,24 +111,38 @@
# Test, if safe_mysqld actually exists
SAFE_MYSQLD=/usr/bin/mysqld_safe
test -x $SAFE_MYSQLD || { echo "$SAFE_MYSQLD does not exist "; rc_failed 5; rc_status -v; rc_exit; }
+ debug_flags=""
+ if test "$MYSQLD_DEBUG" = yes; then
+ # add --log, --core-file and --debug
+ # but only if not already set in my.cnf
+ if ! $print_defaults mysqld | \
+ grep -q -e '--log$' -e '--log[[:blank:]=]'
+ then
+ debug_flags="--log=$datadir/mysqld-query.log"
+ fi
+ if ! $print_defaults mysqld | grep -q -e '^--debug\>' &&
+ test "$MYSQLD" = /usr/sbin/mysqld-debug
+ then
+ debug_flags="$debug_flags --debug=d:t:F:L:o,$datadir/mysqld.trace"
+ fi
+ if ! $print_defaults mysqld | grep -q -e '^--core-file\>'
+ then
+ debug_flags="$debug_flags --core-file"
+ fi
+ fi
- # check for ISAM tables
- tables=`find $datadir -name '*.ISM' | sed "s@$datadir/*@@; s@.ISM@@; s@/@.@;"`
- if test "$tables" ; then
- echo
- echo "Some tables still use ISAM format, please convert them to something "
- echo "better (eg. MyISAM). ISAM support will be dropped in future releases. "
- echo "You can use mysql_convert_table_format script to do this conversion. "
- echo
- echo "Tables using ISAM are: "
- echo " $tables "
- echo
- fi
-
- # this file was used in past, but it's batter to place it youtside database directory
- if test -f $datadir/mysql/stamp-4.1 ; then
- rm $datadir/mysql/stamp-4.1
- fi
+ # check for ISAM tables
+ tables=`find $datadir -name '*.ISM' | sed "s@$datadir/*@@; s@.ISM@@; s@/@.@;"`
+ if test "$tables" ; then
+ echo
+ echo "Some tables still use ISAM format, please convert them to something "
+ echo "better (eg. MyISAM). ISAM support will be dropped in future releases. "
+ echo "You can use mysql_convert_table_format script to do this conversion. "
+ echo
+ echo "Tables using ISAM are: "
+ echo " $tables "
+ echo
+ fi
# We assume a fresh install if the directory $datadir/mysql
# does not exist and create the privilege database
@@ -199,6 +162,8 @@
chown $mysql_daemon_user:$mysql_daemon_group $protected
chmod 700 $protected
$SAFE_MYSQLD \
+ --mysqld=${MYSQLD#/usr/sbin/} \
+ $debug_flags \
--skip-grant-tables \
--skip-networking \
--user=$mysql_daemon_user \
@@ -206,18 +171,27 @@
--socket=$protected/mysql.sock \
--group=$mysql_daemon_group &>/dev/null &
wait_for_socket $protected/mysql.sock || rc_failed
- /usr/bin/mysql_upgrade --socket=$protected/mysql.sock ||\
+ /usr/bin/mysql_upgrade \
+ --basedir=$basedir \
+ --socket=$protected/mysql.sock ||\
rc_failed
killproc -p $protected/mysqld.pid -TERM $MYSQLD
# Fix ownerships and permissions for $datadir
chmod 755 $datadir
chown -R $mysql_daemon_user:$mysql_daemon_group $datadir
- rm -f $datadir/{.run-mysql_upgrade,update-stamp-4.1,update-stamp-5.0} # used in the past
+ rm -f $datadir/.run-mysql_upgrade \
+ $datadir/{update-stamp-*,mysql/stamp-4.1} # used in the past
+ if test -f $datadir/mysql/stamp-4.1 ; then
+ rm $datadir/mysql/stamp-4.1
+ fi
+
fi
echo -n "Starting service MySQL "
$SAFE_MYSQLD \
+ --mysqld=${MYSQLD#/usr/sbin/} \
+ $debug_flags \
--user=$mysql_daemon_user \
--pid-file=$pid_file \
--socket=$socket \
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org