1--TEST--
2PDO_Firebird: error handle
3--EXTENSIONS--
4pdo_firebird
5--SKIPIF--
6<?php require('skipif.inc'); ?>
7--XLEAK--
8A bug in firebird causes a memory leak when calling `isc_attach_database()`.
9See https://github.com/FirebirdSQL/firebird/issues/7849
10--FILE--
11<?php
12
13require("testdb.inc");
14$dbh = getDbConnection();
15$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
16
17$table = 'error_handle';
18$dbh->query("CREATE TABLE {$table} (val int)");
19
20echo "dbh error";
21$dbh->query("INSERT INTO {$table} VALUES ('str')");
22
23echo "\n";
24
25echo "stmt error";
26$stmt = $dbh->prepare("INSERT INTO {$table} VALUES ('str')");
27$stmt->execute();
28
29unset($dbh);
30?>
31--CLEAN--
32<?php
33require 'testdb.inc';
34$dbh = getDbConnection();
35@$dbh->exec('DROP TABLE error_handle');
36unset($dbh);
37?>
38--EXPECTF--
39dbh error
40Warning: PDO::query(): SQLSTATE[22018]: Invalid character value for cast specification: -413 conversion error from string "str" in %s on line %d
41
42stmt error
43Warning: PDOStatement::execute(): SQLSTATE[22018]: Invalid character value for cast specification: -413 conversion error from string "str" in %s on line %d
44