1--TEST--
2mysqli_report(), change user, MySQL 5.6+
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7
8if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
9    die(sprintf("SKIP Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
10        $host, $user, $db, $port, $socket));
11
12if (mysqli_get_server_version($link) < 50600)
13    die("SKIP For MySQL >= 5.6.0");
14
15?>
16--FILE--
17<?php
18    require_once("connect.inc");
19
20    $tmp    = NULL;
21    $link   = NULL;
22
23    require('table.inc');
24
25    /*
26    Internal macro MYSQL_REPORT_ERROR
27    */
28    mysqli_report(MYSQLI_REPORT_ERROR);
29
30    mysqli_change_user($link, "0123456789-10-456789-20-456789-30-456789-40-456789-50-456789-60-456789-70-456789-80-456789-90-456789", "password", $db);
31
32    mysqli_report(MYSQLI_REPORT_OFF);
33
34    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
35      printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
36        $host, $user, $db, $port, $socket);
37
38    mysqli_change_user($link, "This might work if you accept anonymous users in your setup", "password", $db);
39
40    print "done!";
41?>
42--CLEAN--
43<?php
44    require_once("clean_table.inc");
45?>
46--EXPECTF--
47Warning: mysqli_change_user(): (%d/%d): Access denied for user '%s'@'%s' (using password: %s) in %s on line %d
48done!
49