Skip to content

Commit

Permalink
fix(Spanner): Cast fields in the ResultStats object back to int (#7284)
Browse files Browse the repository at this point in the history
  • Loading branch information
saranshdhingra authored May 3, 2024
1 parent 9bd3610 commit e71ee22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Spanner/src/Connection/Grpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,14 @@ public function __construct(array $config = [])
$fields = $msg->getMetadata()?->getRowType()?->getFields();
$data['metadata']['rowType']['fields'] = $this->getFieldDataFromRepeatedFields($fields);

// These fields in stats should be an int
if (isset($data['stats']['rowCountLowerBound'])) {
$data['stats']['rowCountLowerBound'] = (int) $data['stats']['rowCountLowerBound'];
}
if (isset($data['stats']['rowCountExact'])) {
$data['stats']['rowCountExact'] = (int) $data['stats']['rowCountExact'];
}

return $data;
}
]);
Expand Down

0 comments on commit e71ee22

Please sign in to comment.