From 334e04f2d2dfd908cece3bcd30f3c16978aeadb8 Mon Sep 17 00:00:00 2001 From: krowinski Date: Mon, 29 Jan 2024 21:49:29 +0100 Subject: [PATCH] port and version check --- docker-compose.yml | 4 ++-- example/benchmark.php | 2 +- example/dump_events.php | 2 +- tests/Integration/BaseCase.php | 4 ++-- tests/Integration/BasicTest.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 188863f..2bc7764 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ services: replication-test-mysql-percona: container_name: replication-test-mysql-percona hostname: replication-test-mysql-percona - image: mysql:8.2 + image: mysql:8.0 platform: linux/amd64 command: [ '--character-set-server=utf8mb4', @@ -18,5 +18,5 @@ services: - MYSQL_ROOT_PASSWORD=root - MYSQL_DATABASE=mysqlreplication_test ports: - - "3322:3306/tcp" + - "3306:3306/tcp" restart: unless-stopped diff --git a/example/benchmark.php b/example/benchmark.php index 406b834..df52869 100644 --- a/example/benchmark.php +++ b/example/benchmark.php @@ -25,7 +25,7 @@ class benchmark private const DB_USER = 'root'; private const DB_PASS = 'root'; private const DB_HOST = '127.0.0.1'; - private const DB_PORT = 3322; + private const DB_PORT = 3306; private MySQLReplicationFactory $binLogStream; diff --git a/example/dump_events.php b/example/dump_events.php index a7ca682..e5c6506 100644 --- a/example/dump_events.php +++ b/example/dump_events.php @@ -24,7 +24,7 @@ ->withUser('root') ->withHost('0.0.0.0') ->withPassword('root') - ->withPort(3322) + ->withPort(3306) ->withHeartbeatPeriod(60) ->withEventsIgnore([ConstEventType::HEARTBEAT_LOG_EVENT->value]) ->build(), diff --git a/tests/Integration/BaseCase.php b/tests/Integration/BaseCase.php index b954fee..a4c11ea 100644 --- a/tests/Integration/BaseCase.php +++ b/tests/Integration/BaseCase.php @@ -40,12 +40,12 @@ protected function setUp(): void ->withUser('root') ->withHost('0.0.0.0') ->withPassword('root') - ->withPort(3322) + ->withPort(3306) ->withEventsIgnore([ConstEventType::GTID_LOG_EVENT->value]); $this->connect(); - if ($this->checkForVersion(8.4) && $this->mySQLReplicationFactory?->getServerInfo()->isGeneric()) { + if ($this->mySQLReplicationFactory?->getServerInfo()->versionRevision >= 8 && $this->mySQLReplicationFactory?->getServerInfo()->isGeneric()) { self::assertInstanceOf(RotateDTO::class, $this->getEvent()); } self::assertInstanceOf(FormatDescriptionEventDTO::class, $this->getEvent()); diff --git a/tests/Integration/BasicTest.php b/tests/Integration/BasicTest.php index 63ac69e..c3b81ce 100644 --- a/tests/Integration/BasicTest.php +++ b/tests/Integration/BasicTest.php @@ -366,7 +366,7 @@ private function connectWithProvidedEventDispatcher(EventDispatcherInterface $ev $this->connection->executeStatement('USE ' . $this->database); $this->connection->executeStatement('SET SESSION sql_mode = \'\';'); - if ($this->checkForVersion(8.4) && $this->mySQLReplicationFactory->getServerInfo()->isGeneric()) { + if ($this->mySQLReplicationFactory->getServerInfo()->versionRevision >= 8 && $this->mySQLReplicationFactory->getServerInfo()->isGeneric()) { self::assertInstanceOf(RotateDTO::class, $this->getEvent()); }