1--TEST--
2PDO_Firebird: Bug #76488 Memory leak when fetching a BLOB field
3--SKIPIF--
4<?php require('skipif.inc'); ?>
5--ENV--
6LSAN_OPTIONS=detect_leaks=0
7--FILE--
8<?php
9require 'testdb.inc';
10
11$sql = '
12with recursive r(n) as (
13  select 1 from rdb$database
14  union all
15  select n+1 from r where n < 1000
16)
17select n,
18       cast(lpad(\'A\', 8000, \'A\') as BLOB sub_type TEXT) as SRC
19from r
20';
21
22    for ($i = 0; $i < 10; $i++) {
23        $sth = $dbh->prepare($sql);
24        $sth->execute();
25        $rows = $sth->fetchAll();
26        unset($rows);
27        unset($sth);
28    }
29    unset($dbh);
30    echo "OK";
31?>
32--EXPECT--
33OK
34