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