xref: /PHP-8.1/ext/pdo_dblib/tests/bug_50755.phpt (revision 455214d6)
1--TEST--
2PDO_DBLIB: Out of memory on large recordsets
3--EXTENSIONS--
4pdo_dblib
5--SKIPIF--
6<?php
7if (getenv('SKIP_REPEAT')) die('skip May fail on repeat');
8require __DIR__ . '/config.inc';
9?>
10--FILE--
11<?php
12require __DIR__ . '/config.inc';
13
14/* This should be sufficient to overflow any buffers */
15$stmt = $db->prepare("select *
16from information_schema.columns ic1
17cross join information_schema.columns ic2
18cross join information_schema.columns ic3");
19
20$x = $stmt->execute();
21$n = 0;
22while (($r = $stmt->fetch())) {
23    $n++;
24}
25$stmt = null;
26
27echo "OK\n";
28
29?>
30--EXPECT--
31OK
32