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
10 changes: 9 additions & 1 deletion src/MySQLReplication/Event/DTO/QueryDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ class QueryDTO extends EventDTO
private $query;
private $database;
private $type = ConstEventsNames::QUERY;
private $threadId;

public function __construct(
EventInfo $eventInfo,
string $database,
int $executionTime,
string $query
string $query,
int $threadId
) {
parent::__construct($eventInfo);

$this->executionTime = $executionTime;
$this->query = $query;
$this->database = $database;
$this->threadId = $threadId;
}

public function getDatabase(): string
Expand All @@ -46,6 +49,11 @@ public function getType(): string
return $this->type;
}

public function getThreadId(): int
{
return $this->threadId;
}

public function __toString(): string
{
return PHP_EOL .
Expand Down
5 changes: 3 additions & 2 deletions src/MySQLReplication/Event/QueryEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class QueryEvent extends EventCommon
{
public function makeQueryDTO(): QueryDTO
{
$this->binaryDataReader->advance(4);
$threadId = $this->binaryDataReader->readUInt32();
$executionTime = $this->binaryDataReader->readUInt32();
$schemaLength = $this->binaryDataReader->readUInt8();
$this->binaryDataReader->advance(2);
Expand All @@ -26,7 +26,8 @@ public function makeQueryDTO(): QueryDTO
$this->eventInfo,
$schema,
$executionTime,
$query
$query,
$threadId
);
}
}