mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
b03776adb5
Make sure deadlock errors are properly propagated and reports in a number of places in mysqli and PDO MySQL. This also fixes a memory and a segfault that can occur under these conditions.
30 lines
859 B
PHP
30 lines
859 B
PHP
--TEST--
|
|
Bug #74376 (Invalid free of persistent results on error/connection loss)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
|
|
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
|
|
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
|
|
MySQLPDOTest::skip();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
|
|
|
|
$attr = getenv('PDOTEST_ATTR');
|
|
$attr = $attr ? unserialize($attr) : [];
|
|
$attr[PDO::ATTR_PERSISTENT] = true;
|
|
$attr[PDO::ATTR_EMULATE_PREPARES] = false;
|
|
|
|
putenv('PDOTEST_ATTR=' . serialize($attr));
|
|
|
|
$db = MySQLPDOTest::factory();
|
|
$stmt = $db->query("select (select 1 union select 2)");
|
|
|
|
print "ok";
|
|
?>
|
|
--EXPECTF--
|
|
|
|
Warning: PDO::query(): SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row in %s on line %d
|
|
ok
|