forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug #81343: inconsistent type conversion after closeCursor
S->cols is already freed in the statement destructor and since caa7100 the column data is only populated on the first execute() which means that on subsequent execute()s after closeCursor was called, all meta-data for column types was removed and never restored Closes phpGH-7355.
- Loading branch information
Showing
3 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--TEST-- | ||
Bug #81343 pdo_pgsql: Inconsitent boolean conversion after calling closeCursor() | ||
--EXTENSIONS-- | ||
pdo | ||
pdo_pgsql | ||
--SKIPIF-- | ||
<?php | ||
require __DIR__ . '/config.inc'; | ||
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | ||
PDOTest::skip(); | ||
?> | ||
--FILE-- | ||
<?php | ||
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | ||
$pdo = PDOTest::test_factory(__DIR__ . '/common.phpt'); | ||
$pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); | ||
$sth = $pdo->prepare("select false where 2=?"); | ||
|
||
for ($i = 0; $i < 2; $i++) { | ||
$sth->execute([2]); | ||
var_dump($sth->fetchColumn(0)); | ||
$sth->closeCursor(); | ||
} | ||
?> | ||
--EXPECT-- | ||
bool(false) | ||
bool(false) |