1--TEST--
2mysqli_change_user() - Prepared Statement
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10    require_once('connect.inc');
11
12    if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
13        printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
14
15    if (!$stmt = mysqli_prepare($link, "SELECT 'prepared statements should be released'"))
16        printf("[002] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
17
18    mysqli_change_user($link, $user, $passwd, $db);
19
20    $wrong = null;
21    if ($stmt->execute() && $stmt->bind_result($wrong) && $stmt->fetch()) {
22        printf("This is wrong, because after a mysqli_change_user() %s\n", $wrong);
23    } else {
24        if ($stmt->errno == 0)
25            printf("Error code 2013, 1243 or similar should have been set\n");
26    }
27
28    mysqli_close($link);
29    print "done!";
30?>
31--EXPECT--
32done!
33