Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/MySQLReplication/Event/DTO/QueryDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function __construct(
string $database,
int $executionTime,
string $query,
int $threadId
int $threadId = 0
) {
parent::__construct($eventInfo);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
Expand Down