aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2007-11-20 01:28:49 +0000
committerMicah Anderson <micah@riseup.net>2007-11-20 01:28:49 +0000
commit19dbc0aaee22e66d40b83d01a0ad24b9b09cee92 (patch)
tree37a602b2304f736bd25ab27a088dd0b2fe6e2418
parentea79f006da7c02794a36c1ad7e6ba29b2c4b5d12 (diff)
downloadbackupninja-19dbc0aaee22e66d40b83d01a0ad24b9b09cee92.tar.gz
backupninja-19dbc0aaee22e66d40b83d01a0ad24b9b09cee92.tar.bz2
add patch from matthew palmer to enhance mysql database selection (Closes: #452039)
-rw-r--r--AUTHORS3
-rw-r--r--ChangeLog4
-rw-r--r--handlers/mysql.in2
3 files changed, 7 insertions, 2 deletions
diff --git a/AUTHORS b/AUTHORS
index 79e338a..ea31cba 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -22,4 +22,5 @@ Martin Krafft madduck@debian.org -- admingroup patch
Anarcat -- lotsa patches
Jamie McClelland -- cstream patches
ale -- ldap cleanup
-Sami Haahtinen <ressu@ressukka.net> \ No newline at end of file
+Sami Haahtinen <ressu@ressukka.net>
+Matthew Palmer -- mysql enhancements
diff --git a/ChangeLog b/ChangeLog
index 7682a29..983341e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,10 @@ version 0.9.5 -- unreleased
the data from a backup, but still backup the table structure. This is very
useful in cases where tables contain large amounts of cache data. See the
example.mysql for options, thanks Daniel Bonniot (Closes: #408829)
+ . Enhance code for selecting databases by asking MySQL not to give us the
+ header (-N), to not draw pretty boxes around the output (-B), send the query
+ via -e instead of a pipe and ensure MySQL listens to -B. Thanks to
+ Matthew Palmer (Closes: #452039).
pgsql:
. Support configuring PGSQLUSER for real, and document it a bit; this
broken support actually prevented pgsql handler to work for VServers
diff --git a/handlers/mysql.in b/handlers/mysql.in
index 64b6f49..defb72a 100644
--- a/handlers/mysql.in
+++ b/handlers/mysql.in
@@ -238,7 +238,7 @@ then
fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"
fi
else
- databases=`echo 'show databases' | su $user -c "$MYSQL $defaultsfile" | grep -v Database`
+ databases=$(su $user -c "$MYSQL $defaultsfile -N -B -e 'show databases'" | sed 's/|//g;/\+----/d')
if [ $? -ne 0 ]
then
fatal "Authentication problem, maybe user/password is wrong or mysqld is not running?"