diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2006-07-31 20:18:11 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2006-07-31 20:18:11 +0000 |
commit | c6ace95236d5b728b0886ad26a3b8c6dd1486780 (patch) | |
tree | 4d5f046f66589d1bba705ea6d507133986e7623f /ext/pdo_mysql | |
parent | 624e5f83c89d19f520c5c466a3561468f70b5541 (diff) | |
download | php-git-c6ace95236d5b728b0886ad26a3b8c6dd1486780.tar.gz |
Fixed bug #37445 (Fixed crash in pdo_mysql resulting from premature object
destruction).
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r-- | ext/pdo_mysql/tests/bug_37445.phpt | 21 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/common.phpt | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt new file mode 100644 index 0000000000..c4d760083d --- /dev/null +++ b/ext/pdo_mysql/tests/bug_37445.phpt @@ -0,0 +1,21 @@ +--TEST-- +PDO MySQL Bug #37445 (Premature stmt object destruction) +--SKIPIF-- +<?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded'); +require dirname(__FILE__) . '/config.inc'; +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); +PDOTest::skip(); +?> +--FILE-- +<?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); + +$db->setAttribute(PDO :: ATTR_EMULATE_PREPARES, true); +$stmt = $db->prepare("SELECT 1"); +$stmt->bindParam(':a', 'b'); + +--EXPECTF-- +Fatal error: Cannot pass parameter 2 by reference in %s/bug_37445.php on line %d
\ No newline at end of file diff --git a/ext/pdo_mysql/tests/common.phpt b/ext/pdo_mysql/tests/common.phpt index 1d11e0f7e7..8179454cf7 100644 --- a/ext/pdo_mysql/tests/common.phpt +++ b/ext/pdo_mysql/tests/common.phpt @@ -22,7 +22,7 @@ if (false !== getenv('PDO_MYSQL_TEST_DSN')) { } else { $config['ENV']['PDOTEST_DSN'] = 'mysql:host=localhost;dbname=test'; $config['ENV']['PDOTEST_USER'] = 'root'; - $config['ENV']['PDOTEST_PASS'] = 'asukasmysql'; + $config['ENV']['PDOTEST_PASS'] = ''; } return $config; |