diff options
author | Xinchen Hui <laruence@php.net> | 2013-06-16 22:56:22 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2013-06-16 22:56:22 +0800 |
commit | 6cd6349ff8842a9356723b7b192eb3c93fb64c7e (patch) | |
tree | 3eaea408b40556294ff14b12f9e74a6a5bc903cf /ext/pdo_mysql | |
parent | 3dd2de3f45ce0d8ddc2eead773efcb5c5b7989ac (diff) | |
parent | 49e57a31659a82443b9413127f8d58a72f09ed5b (diff) | |
download | php-git-6cd6349ff8842a9356723b7b192eb3c93fb64c7e.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r-- | ext/pdo_mysql/tests/bug63176.phpt | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/ext/pdo_mysql/tests/bug63176.phpt b/ext/pdo_mysql/tests/bug63176.phpt new file mode 100644 index 0000000000..392a90b463 --- /dev/null +++ b/ext/pdo_mysql/tests/bug63176.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server) +--SKIPIF-- +<?php +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc'); +require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); +MySQLPDOTest::skip(); +?> +--FILE-- +<?php +require(dirname(__FILE__). DIRECTORY_SEPARATOR . 'config.inc'); +class PDO2 extends PDO { + protected $transLevel; +} + +class PDO3 extends PDO { + protected $tomato; +} + + +class ModelA { + public function __construct($h) { + var_dump($h); + if ($h) { + $this->db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true)); + } else { + $this->db = new PDO2(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS, array(PDO::ATTR_PERSISTENT => true)); + } + $this->db->query('SELECT 1')->fetchAll(); + } +} + +$a = new ModelA(true); +$b = new ModelA(false); + +var_dump($a); +var_dump($b); +--EXPECTF-- +bool(true) +bool(false) +object(ModelA)#%d (1) { + ["db"]=> + object(PDO2)#%d (1) { + ["transLevel":protected]=> + NULL + } +} +object(ModelA)#%d (1) { + ["db"]=> + object(PDO2)#%d (1) { + ["transLevel":protected]=> + NULL + } +} |