xref: /PHP-5.6/ext/mysqli/tests/bug52082.phpt (revision 65b18957)
1--TEST--
2Bug #52082 (character_set_client & character_set_connection reset after mysqli_change_user)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifemb.inc');
7require_once('skipifconnectfailure.inc');
8?>
9--FILE--
10<?php
11	require_once("connect.inc");
12	$link = mysqli_init();
13	$link->options(MYSQLI_SET_CHARSET_NAME, "latin2");
14	if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket)) {
15		die("can't connect");
16	}
17	var_dump($link->query("show variables like 'character_set_client'")->fetch_row());
18	var_dump($link->query("show variables like 'character_set_connection'")->fetch_row());
19	$link->change_user($user, $passwd, $db);
20	var_dump($link->query("show variables like 'character_set_client'")->fetch_row());
21	var_dump($link->query("show variables like 'character_set_connection'")->fetch_row());
22
23	print "done!";
24?>
25--EXPECTF--
26array(2) {
27  [0]=>
28  string(20) "character_set_client"
29  [1]=>
30  string(6) "latin2"
31}
32array(2) {
33  [0]=>
34  string(24) "character_set_connection"
35  [1]=>
36  string(6) "latin2"
37}
38array(2) {
39  [0]=>
40  string(20) "character_set_client"
41  [1]=>
42  string(6) "latin2"
43}
44array(2) {
45  [0]=>
46  string(24) "character_set_connection"
47  [1]=>
48  string(6) "latin2"
49}
50done!