Wrap check for binlog_format in version directive to avoid error on MySQL 5.0.

This commit is contained in:
Daniel Nichter
2012-02-06 13:39:11 -07:00
parent 4d5d4da4b7
commit 2dfa2fd54f

View File

@@ -5887,11 +5887,12 @@ sub main {
# instead, it should check if it's already set to STATEMENT.
# This is becase starting with MySQL 5.1.29, changing the format
# requires a SUPER user.
my $sql = 'SELECT @@binlog_format';
my $sql = '/*!50108 SELECT @@binlog_format */';
PTDEBUG && _d($dbh, $sql);
my ($original_binlog_format) = $dbh->selectrow_array($sql);
PTDEBUG && _d('Original binlog_format:', $original_binlog_format);
if ( $original_binlog_format !~ /STATEMENT/i ) {
if ( $original_binlog_format
&& $original_binlog_format !~ /STATEMENT/i ) {
$sql = q{/*!50108 SET @@binlog_format := 'STATEMENT'*/};
eval {
PTDEBUG && _d($dbh, $sql);