/**
  * @see https://dev.mysql.com/doc/internals/en/com-binlog-dump-gtid.html
  * @throws BinLogException
  * @throws GtidException
  */
 private function setBinLogDumpGtid()
 {
     $collection = $this->gtidService->makeCollectionFromString($this->config->getGtid());
     $prelude = pack('l', 26 + $collection->getEncodedLength()) . chr(ConstCommand::COM_BINLOG_DUMP_GTID);
     $prelude .= pack('S', 0);
     $prelude .= pack('I', $this->config->getSlaveId());
     $prelude .= pack('I', 3);
     $prelude .= chr(0);
     $prelude .= chr(0);
     $prelude .= chr(0);
     $prelude .= BinaryDataReader::pack64bit(4);
     $prelude .= pack('I', $collection->getEncodedLength());
     $prelude .= $collection->getEncoded();
     $this->writeToSocket($prelude);
     $this->getPacket();
 }
 /**
  * @test
  */
 public function shouldCreateCollection()
 {
     $this->assertInstanceOf('\\MySQLReplication\\Gtid\\GtidCollection', $this->gtidService->makeCollectionFromString('9b1c8d18-2a76-11e5-a26b-000c2976f3f3:1-177592'));
 }