diff --git a/README.md b/README.md index f499834..64a48e1 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ Based on a great work of creators:https://github.com/noplay/python-mysql-repli **Note:** Resolve these issues: - Add regular expression matching support for `DatabasesOnly` or `TablesOnly` of `Config`. + ```php + (new ConfigBuilder())->withTablesOnly(['log_\d+'])->build(); // Table `log_20240101` + ``` - Resolve [krowinski/php-mysql-replication#94](https://github.com/krowinski/php-mysql-replication/issues/94), change static config properties to non-static. - Add retry feature. ```php diff --git a/src/MySQLReplication/Event/DTO/QueryDTO.php b/src/MySQLReplication/Event/DTO/QueryDTO.php index cf33f78..6a860f9 100644 --- a/src/MySQLReplication/Event/DTO/QueryDTO.php +++ b/src/MySQLReplication/Event/DTO/QueryDTO.php @@ -19,7 +19,7 @@ public function __construct( string $database, int $executionTime, string $query, - int $threadId + int $threadId = 0 ) { parent::__construct($eventInfo); diff --git a/src/MySQLReplication/JsonBinaryDecoder/JsonBinaryDecoderService.php b/src/MySQLReplication/JsonBinaryDecoder/JsonBinaryDecoderService.php index 6bb0aa4..cc4b185 100644 --- a/src/MySQLReplication/JsonBinaryDecoder/JsonBinaryDecoderService.php +++ b/src/MySQLReplication/JsonBinaryDecoder/JsonBinaryDecoderService.php @@ -76,7 +76,7 @@ public function parseToString(): string { // Sometimes, we can insert a NULL JSON even we set the JSON field as NOT NULL. // If we meet this case, we can return a 'null' value. - if($this->binaryDataReader->getBinaryDataLength() === 0) { + if ($this->binaryDataReader->getBinaryDataLength() === 0) { return 'null'; } $this->parseJson($this->binaryDataReader->readUInt8()); @@ -251,7 +251,7 @@ private function getOffsetOrInLinedValue(int $bytes, int $intSize, int $valueEnt // In binlog format, JSON arrays are fixed width elements, even though type value can be smaller. // In order to properly process this case, we need to move cursor to the next element, which is on position 1 + $valueEntrySize (1 is length of type) - if($type === self::UINT16 || $type === self::INT16) { + if ($type === self::UINT16 || $type === self::INT16) { $readNextBytes = $valueEntrySize - 2 - 1; $this->binaryDataReader->read($readNextBytes); }