File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
src/MySQLReplication/Event Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -12,18 +12,21 @@ class QueryDTO extends EventDTO
1212 private $ query ;
1313 private $ database ;
1414 private $ type = ConstEventsNames::QUERY ;
15+ private $ threadId ;
1516
1617 public function __construct (
1718 EventInfo $ eventInfo ,
1819 string $ database ,
1920 int $ executionTime ,
20- string $ query
21+ string $ query ,
22+ int $ threadId
2123 ) {
2224 parent ::__construct ($ eventInfo );
2325
2426 $ this ->executionTime = $ executionTime ;
2527 $ this ->query = $ query ;
2628 $ this ->database = $ database ;
29+ $ this ->threadId = $ threadId ;
2730 }
2831
2932 public function getDatabase (): string
@@ -46,6 +49,11 @@ public function getType(): string
4649 return $ this ->type ;
4750 }
4851
52+ public function getThreadId (): int
53+ {
54+ return $ this ->threadId ;
55+ }
56+
4957 public function __toString (): string
5058 {
5159 return PHP_EOL .
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ class QueryEvent extends EventCommon
1212{
1313 public function makeQueryDTO (): QueryDTO
1414 {
15- $ this ->binaryDataReader ->advance ( 4 );
15+ $ threadId = $ this ->binaryDataReader ->readUInt32 ( );
1616 $ executionTime = $ this ->binaryDataReader ->readUInt32 ();
1717 $ schemaLength = $ this ->binaryDataReader ->readUInt8 ();
1818 $ this ->binaryDataReader ->advance (2 );
@@ -26,7 +26,8 @@ public function makeQueryDTO(): QueryDTO
2626 $ this ->eventInfo ,
2727 $ schema ,
2828 $ executionTime ,
29- $ query
29+ $ query ,
30+ $ threadId
3031 );
3132 }
3233}
You can’t perform that action at this time.
0 commit comments