1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/pdo_firebird/tests/setCursorAttribute.phpt
2024-12-17 13:15:47 +00:00

27 lines
627 B
PHP

--TEST--
Throw value error if cursor name is too long
--EXTENSIONS--
pdo_firebird
--SKIPIF--
<?php require 'skipif.inc'; ?>
--XLEAK--
A bug in firebird causes a memory leak when calling `isc_attach_database()`.
See https://github.com/FirebirdSQL/firebird/issues/7849
--FILE--
<?php
require 'testdb.inc';
$dbh = getDbConnection();
$query = 'SELECT 1 FROM RDB$DATABASE';
$stmt = $dbh->query($query);
try {
$stmt->setAttribute(PDO::ATTR_CURSOR_NAME, str_repeat('a', 35));
} catch (Throwable $e) {
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
--EXPECT--
ValueError: Cursor name must not be longer than 31 bytes