From 49e57a31659a82443b9413127f8d58a72f09ed5b Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 16 Jun 2013 22:55:59 +0800 Subject: Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server) --- ext/pdo_mysql/tests/bug63176.phpt | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ext/pdo_mysql/tests/bug63176.phpt (limited to 'ext/pdo_mysql') 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-- + +--FILE-- +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 + } +} -- cgit v1.2.1