1--TEST--
2Bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH) - collision
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10require_once('connect.inc');
11$sql = "SELECT 11111 as `1`, 22222 as `2`";
12
13// unbuffered
14$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
15$link->real_query($sql);
16$res = $link->use_result();
17$row = $res->fetch_array();
18var_dump($row);
19$link->close();
20
21// buffered
22ini_set('mysqlnd.fetch_data_copy', false);
23$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
24$res = $link->query($sql);
25$row = $res->fetch_array();
26var_dump($row);
27$link->close();
28
29// buffered copies
30ini_set('mysqlnd.fetch_data_copy', true);
31$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
32$res = $link->query($sql);
33$row = $res->fetch_array();
34var_dump($row);
35$link->close();
36?>
37--EXPECT--
38array(3) {
39  [0]=>
40  string(5) "11111"
41  [1]=>
42  string(5) "11111"
43  [2]=>
44  string(5) "22222"
45}
46array(3) {
47  [0]=>
48  string(5) "11111"
49  [1]=>
50  string(5) "11111"
51  [2]=>
52  string(5) "22222"
53}
54array(3) {
55  [0]=>
56  string(5) "11111"
57  [1]=>
58  string(5) "11111"
59  [2]=>
60  string(5) "22222"
61}
62