1--TEST-- 2Bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH) 3--SKIPIF-- 4<?php 5require_once('skipif.inc'); 6require_once('skipifconnectfailure.inc'); 7?> 8--FILE-- 9<?php 10require_once('connect.inc'); 11$sql = "SELECT 0 as `2007`, 0 as `2008`, 0 as `2020`"; 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(6) { 39 [0]=> 40 string(1) "0" 41 [2007]=> 42 string(1) "0" 43 [1]=> 44 string(1) "0" 45 [2008]=> 46 string(1) "0" 47 [2]=> 48 string(1) "0" 49 [2020]=> 50 string(1) "0" 51} 52array(6) { 53 [0]=> 54 string(1) "0" 55 [2007]=> 56 string(1) "0" 57 [1]=> 58 string(1) "0" 59 [2008]=> 60 string(1) "0" 61 [2]=> 62 string(1) "0" 63 [2020]=> 64 string(1) "0" 65} 66array(6) { 67 [0]=> 68 string(1) "0" 69 [2007]=> 70 string(1) "0" 71 [1]=> 72 string(1) "0" 73 [2008]=> 74 string(1) "0" 75 [2]=> 76 string(1) "0" 77 [2020]=> 78 string(1) "0" 79} 80