Skip to content

Commit 0cb6e84

Browse files
Stern87krowinski
authored andcommitted
getDatetime2 data read fix (#55)
tx
1 parent 47af10d commit 0cb6e84

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/MySQLReplication/Event/RowEvent/RowEvent.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ protected function getDatetime2(ColumnDTO $columnDTO): ?string
708708
$hour = $this->binaryDataReader->getBinarySlice($data, 23, 5, 40);
709709
$minute = $this->binaryDataReader->getBinarySlice($data, 28, 6, 40);
710710
$second = $this->binaryDataReader->getBinarySlice($data, 34, 6, 40);
711+
$fsp = $this->getFSP($columnDTO);
711712

712713
try {
713714
$date = new DateTime($year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second);
@@ -718,7 +719,7 @@ protected function getDatetime2(ColumnDTO $columnDTO): ?string
718719
return null;
719720
}
720721

721-
return $date->format('Y-m-d H:i:s') . $this->getFSP($columnDTO);
722+
return $date->format('Y-m-d H:i:s') . $fsp;
722723
}
723724

724725
/**

0 commit comments

Comments
 (0)