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.
Merge branch 'bug72788' of https://github.com/keyurdg/php-src into PH…
…P-7.0 * 'bug72788' of https://github.com/keyurdg/php-src: Remove typo'd commit Fix bug 72788: Invalid memory access when database_object_handle is undefined. Also fix memory leak in dbh_free when using persistent PDO connections.
- Loading branch information
Showing
5 changed files
with
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--TEST-- | ||
PDO Common: Bug #72788 (Invalid memory access when using persistent PDO connection) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('pdo')) die('skip'); | ||
$dir = getenv('REDIR_TEST_DIR'); | ||
if (false == $dir) die('skip no driver'); | ||
require_once $dir . 'pdo_test.inc'; | ||
PDOTest::skip(); | ||
?> | ||
--FILE-- | ||
<?php | ||
if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); | ||
require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; | ||
|
||
putenv("PDOTEST_ATTR=" . serialize(array(PDO::ATTR_PERSISTENT => true))); | ||
|
||
function test() { | ||
$db = PDOTest::factory('PDO', false); | ||
$stmt = @$db->query("SELECT 1 FROM TABLE_DOES_NOT_EXIST"); | ||
if ($stmt === false) { | ||
echo "Statement failed as expected\n"; | ||
} | ||
} | ||
|
||
test(); | ||
test(); | ||
echo "Done"; | ||
?> | ||
--EXPECT-- | ||
Statement failed as expected | ||
Statement failed as expected | ||
Done |
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