[debian-mysql] Bug#460066: mysql-dfsg-5.0: Support both log_slow_queries and log-slow-queries in mysqldumpslow

Mathias Gug mathiaz at ubuntu.com
Sat Jul 11 01:15:34 UTC 2009


Package: mysql-dfsg-5.0
Severity: normal
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu karmic


The attached patch adds support for both log_slow_queries and
log-slow-queries to mysqlslowdump. It also updates my.cnf to use
log-slow-queries as this is the recommended option by upstream.
log_slow_queries also works and used to be commented out in the default
debian mysql configuration file, which would lead to a broken
mysqlslowdump command.

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-24-server (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
=== modified file 'debian/additions/my.cnf'
--- debian/additions/my.cnf	2009-02-15 16:44:02 +0000
+++ debian/additions/my.cnf	2009-07-10 23:50:24 +0000
@@ -73,7 +79,7 @@
 # Error logging goes to syslog. This is a Debian improvement :)
 #
 # Here you can see queries with especially long duration
-#log_slow_queries	= /var/log/mysql/mysql-slow.log
+#log-slow-queries	= /var/log/mysql/mysql-slow.log
 #long_query_time = 2
 #log-queries-not-using-indexes
 #
=== added file 'debian/patches/57-fix-mysqlslowdump-config.dpatch'
--- debian/patches/57-fix-mysqlslowdump-config.dpatch	1970-01-01 00:00:00 +0000
+++ debian/patches/57-fix-mysqlslowdump-config.dpatch	2009-07-10 23:47:22 +0000
@@ -0,0 +1,18 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+# https://bugs.edge.launchpad.net/ubuntu/+source/mysql-dfsg-5.0/+bug/183762
+# support both log-slow-queries and log_slow_queries options set in my.cnf
+# the latter used to be commented out in the default Debian my.cnf file.
+
+ at DPATCH@
+diff -urNad mysql-dfsg-5.0-5.1.30really5.0.83~/scripts/mysqldumpslow.sh mysql-dfsg-5.0-5.1.30really5.0.83/scripts/mysqldumpslow.sh
+--- mysql-dfsg-5.0-5.1.30really5.0.83~/scripts/mysqldumpslow.sh	2009-05-29 14:19:19.000000000 -0400
++++ mysql-dfsg-5.0-5.1.30really5.0.83/scripts/mysqldumpslow.sh	2009-07-10 19:43:57.000000000 -0400
+@@ -40,7 +40,7 @@
+     warn "basedir=$basedir\n" if $opt{v};
+ 
+     my $datadir = ($defaults =~ m/--datadir=(.*)/)[0];
+-    my $slowlog = ($defaults =~ m/--log-slow-queries=(.*)/)[0];
++    my $slowlog = ($defaults =~ m/--log[-_]slow[-_]queries=(.*)/)[0];
+     if (!$datadir or $opt{i}) {
+ 	# determine the datadir from the instances section of /etc/my.cnf, if any
+ 	my $instances  = `my_print_defaults instances`;



More information about the pkg-mysql-maint mailing list