Database::executePartitionedUpdate() returns string instead of int
taka-oyama opened this issue · 0 comments
taka-oyama commented
When I updated from 1.75.1
to 1.76.0
the returned value changed from int
to string
.
PhpDoc says it should return int
.
Environment details
- OS: Alpine Linux 3.18
- PHP version: 8.2.18
- Package name and version: cloud-spanner v1.76.0
Steps to reproduce
- Run Database::executePartitionedUpdate()
- dump result
Code example
$instanceId = getenv('SPANNER_INSTANCE');
$databaseId = getenv('SPANNER_DATABASE');
$client = new SpannerClient();
$database = $client->connect($instanceId, $databaseId);
$database->create(['statements' => [
'CREATE TABLE `Test` (`id` STRING(36) NOT NULL, `text` STRING(MAX)) PRIMARY KEY (`id`)'],
])->pollUntilComplete();
$statement = "UPDATE `Test` SET `text` = @p0 WHERE `text` = @p1";
$parameters = ['p0' => 'after', 'p1' => 'before'];
$result = $database->executePartitionedUpdate($statement, ['parameters' => $parameters]);
var_dump($result); // string(1) "0"