1--TEST--
2PDO_Firebird: support EXECUTE BLOCK
3--EXTENSIONS--
4pdo_firebird
5--SKIPIF--
6<?php require('skipif.inc');
7?>
8--XLEAK--
9A bug in firebird causes a memory leak when calling `isc_attach_database()`.
10See https://github.com/FirebirdSQL/firebird/issues/7849
11--FILE--
12<?php
13require("testdb.inc");
14
15$dbh = getDbConnection();
16$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
17
18	$sql = '
19execute block (a int = :e, b int = :d)
20returns (N int, M int)
21as
22declare z int;
23begin
24  select 10
25  from rdb$database
26  into :z;
27
28  n = a + b + z;
29  m = z * a;
30  suspend;
31end
32';
33
34$query = $dbh->prepare($sql);
35$query->execute(['d' => 1, 'e' => 2]);
36$row = $query->fetch(\PDO::FETCH_OBJ);
37var_dump($row->N);
38var_dump($row->M);
39
40unset($query);
41unset($dbh);
42echo "done\n";
43?>
44--EXPECT--
45int(13)
46int(20)
47done
48