xref: /PHP-7.3/ext/mysqli/tests/bug77597.phpt (revision 934691fa)
1--TEST--
2Bug #77597: mysqli_fetch_field hangs scripts
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10
11require_once("connect.inc");
12$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
13
14$mysqli->query('DROP TABLE IF EXISTS a');
15$mysqli->query('CREATE TABLE a (b int)');
16$mysqli->query('INSERT INTO a VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9)');
17
18$mysqli->real_query("SELECT * FROM a");
19
20$result = $mysqli->store_result(MYSQLI_STORE_RESULT_COPY_DATA);
21
22$field = $result->fetch_field();
23var_dump($field->name);
24
25?>
26--EXPECT--
27string(1) "b"
28