krowinski /
php-mysql-replication
| 1 | <?php |
||
| 2 | declare(strict_types=1); |
||
| 3 | |||
| 4 | namespace MySQLReplication\Event; |
||
| 5 | |||
| 6 | use MySQLReplication\Event\DTO\GTIDLogDTO; |
||
| 7 | |||
| 8 | class GtidEvent extends EventCommon |
||
| 9 | { |
||
| 10 | public function makeGTIDLogDTO(): GTIDLogDTO |
||
| 11 | { |
||
| 12 | $commit_flag = 1 === $this->binaryDataReader->readUInt8(); |
||
| 13 | $sid = unpack('H*', $this->binaryDataReader->read(16))[1]; |
||
| 14 | $gno = $this->binaryDataReader->readUInt64(); |
||
| 15 | |||
| 16 | $gtid = vsprintf('%s%s%s%s%s%s%s%s-%s%s%s%s-%s%s%s%s-%s%s%s%s-%s%s%s%s%s%s%s%s%s%s%s%s', str_split($sid)) . ':' . $gno; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 17 | |||
| 18 | $this->eventInfo->getBinLogCurrent()->setGtid($gtid); |
||
| 19 | |||
| 20 | return new GTIDLogDTO( |
||
| 21 | $this->eventInfo, |
||
| 22 | $commit_flag, |
||
| 23 | $gtid |
||
| 24 | ); |
||
| 25 | } |
||
| 26 | } |