mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
commit
d63aedd173
3 changed files with 42 additions and 0 deletions
33
ext/pdo_mysql/tests/bug76815.phpt
Normal file
33
ext/pdo_mysql/tests/bug76815.phpt
Normal file
|
@ -0,0 +1,33 @@
|
|||
--TEST--
|
||||
Bug #76815: PDOStatement cannot be GCed/closeCursor-ed when a PROCEDURE resultset SIGNAL
|
||||
--SKIPIF--
|
||||
<?php
|
||||
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');
|
||||
|
||||
$pdo = MySQLPDOTest::factory();
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
$pdo->query('DROP FUNCTION IF EXISTS tst');
|
||||
$pdo->query('DROP PROCEDURE IF EXISTS tst2');
|
||||
$pdo->query('CREATE FUNCTION tst() RETURNS VARCHAR(5) DETERMINISTIC BEGIN RETURN \'x12345\'; END');
|
||||
$pdo->query('CREATE PROCEDURE tst2() BEGIN SELECT tst(); END');
|
||||
|
||||
$st = $pdo->prepare('CALL tst2()');
|
||||
try {
|
||||
$st->execute();
|
||||
} catch (PDOException $ex) {
|
||||
echo $ex->getMessage(), "\n";
|
||||
}
|
||||
unset($st);
|
||||
echo "Ok.\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'tst()' at row 1
|
||||
Ok.
|
Loading…
Add table
Add a link
Reference in a new issue