xref: /php-src/ext/mysqli/tests/071.phpt (revision 7e5171d1)
1--TEST--
2mysqli thread_id & kill
3--EXTENSIONS--
4mysqli
5--SKIPIF--
6<?php
7require_once 'skipifconnectfailure.inc';
8?>
9--FILE--
10<?php
11    require_once 'connect.inc';
12
13    $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
14
15    var_dump($mysql->query('DO 1'));
16
17    $ret = $mysql->kill($mysql->thread_id);
18    if ($ret !== true){
19        printf("[001] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
20    }
21
22    var_dump($mysql->query('DO 1'));
23
24    $mysql->close();
25
26    $mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
27
28    var_dump($mysql->query('DO 1'));
29
30    $ret = $mysql->kill($mysql->thread_id);
31    if ($ret !== true){
32        printf("[002] Expecting boolean/true got %s/%s\n", gettype($ret), var_export($ret, true));
33    }
34
35    var_dump($mysql->query('DO 1'));
36
37    $mysql->close();
38    print "done!";
39?>
40--EXPECTF--
41bool(true)
42
43Deprecated: Method mysqli::kill() is deprecated since 8.4, use KILL CONNECTION/QUERY SQL statement instead in %s
44bool(false)
45bool(true)
46
47Deprecated: Method mysqli::kill() is deprecated since 8.4, use KILL CONNECTION/QUERY SQL statement instead in %s
48bool(false)
49done!
50