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