Skip to content

Commit 2b0f26d

Browse files
kobi97krowinski
authored andcommitted
some bug fixes (#25)
1. BinlogSocketConnect refactoring error ( mariadb is not working) 2. binlog_checksum
1 parent 626be13 commit 2b0f26d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/MySQLReplication/BinLog/BinLogSocketConnect.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ private function getBinlogStream()
159159
$this->execute('SET @slave_connect_state = \'' . Config::getMariaDbGtid() . '\'');
160160
$this->execute('SET @slave_gtid_strict_mode = 0');
161161
$this->execute('SET @slave_gtid_ignore_duplicates = 0');
162-
} else if ('' !== Config::getGtid()) {
162+
}
163+
if ('' !== Config::getGtid()) {
163164
$this->setBinLogDumpGtid();
164165
} else {
165166
$this->setBinLogDump();

src/MySQLReplication/Repository/MySQLRepository.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ public function isCheckSum()
7575
{
7676
$res = $this->getConnection()->fetchAssoc('SHOW GLOBAL VARIABLES LIKE "BINLOG_CHECKSUM"');
7777

78-
return isset($res['Value']);
78+
if (!isset($res['Value'])) {
79+
return false;
80+
}
81+
82+
$check_sum = $res['Value'];
83+
84+
return (!empty($check_sum) && strtolower($check_sum) !== 'none');
7985
}
8086

8187
/**

0 commit comments

Comments
 (0)