|
12 | 12 | use MySQLReplication\Event\DTO\UpdateRowsDTO;
|
13 | 13 | use MySQLReplication\Event\DTO\WriteRowsDTO;
|
14 | 14 | use MySQLReplication\Event\EventCommon;
|
15 |
| -use MySQLReplication\Event\EventException; |
16 | 15 | use MySQLReplication\Event\EventInfo;
|
17 | 16 | use MySQLReplication\Exception\MySQLReplicationException;
|
18 | 17 | use MySQLReplication\JsonBinaryDecoder\JsonBinaryDecoderException;
|
@@ -403,7 +402,6 @@ public function makeTableMapDTO()
|
403 | 402 | * @return WriteRowsDTO|null
|
404 | 403 | * @throws InvalidArgumentException
|
405 | 404 | * @throws BinaryDataReaderException
|
406 |
| - * @throws EventException |
407 | 405 | * @throws JsonBinaryDecoderException
|
408 | 406 | * @throws MySQLReplicationException
|
409 | 407 | */
|
@@ -458,7 +456,6 @@ protected function rowInit()
|
458 | 456 | /**
|
459 | 457 | * @return array
|
460 | 458 | * @throws BinaryDataReaderException
|
461 |
| - * @throws EventException |
462 | 459 | * @throws JsonBinaryDecoderException
|
463 | 460 | * @throws MySQLReplicationException
|
464 | 461 | */
|
@@ -566,6 +563,8 @@ protected function getColumnData($colsBitmap)
|
566 | 563 | $values[$name] = $this->getDatetime2($column);
|
567 | 564 | } else if ($column['type'] === ConstFieldType::TIMESTAMP) {
|
568 | 565 | $values[$name] = date('c', $this->binaryDataReader->readUInt32());
|
| 566 | + } else if ($column['type'] === ConstFieldType::TIME) { |
| 567 | + $values[$name] = $this->getTime(); |
569 | 568 | } else if ($column['type'] === ConstFieldType::TIME2) {
|
570 | 569 | $values[$name] = $this->getTime2($column);
|
571 | 570 | } else if ($column['type'] === ConstFieldType::TIMESTAMP2) {
|
@@ -917,7 +916,6 @@ protected function getBit(array $column)
|
917 | 916 | * @return DeleteRowsDTO
|
918 | 917 | * @throws InvalidArgumentException
|
919 | 918 | * @throws BinaryDataReaderException
|
920 |
| - * @throws EventException |
921 | 919 | * @throws JsonBinaryDecoderException
|
922 | 920 | * @throws MySQLReplicationException
|
923 | 921 | */
|
@@ -986,4 +984,18 @@ protected function getEnum(array $column)
|
986 | 984 |
|
987 | 985 | return '';
|
988 | 986 | }
|
| 987 | + |
| 988 | + /** |
| 989 | + * @return string |
| 990 | + */ |
| 991 | + protected function getTime() |
| 992 | + { |
| 993 | + $data = $this->binaryDataReader->readUInt24(); |
| 994 | + |
| 995 | + if (0 === $data) { |
| 996 | + return '00-00-00'; |
| 997 | + } |
| 998 | + |
| 999 | + return sprintf('%s%02d:%02d:%02d', $data < 0 ? '-' : '', $data / 10000, ($data % 10000) / 100, $data % 100); |
| 1000 | + } |
989 | 1001 | }
|
0 commit comments