@@ -14,12 +14,9 @@ if (!function_exists('mysqli_get_connection_stats')) {
14
14
?>
15
15
--FILE--
16
16
<?php
17
- require_once 'connect.inc ' ;
18
- if (!$ link = my_mysqli_connect ($ host , $ user , $ passwd , $ db , $ port , $ socket )) {
19
- printf ("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s \n" ,
20
- $ host , $ user , $ db , $ port , $ socket );
21
- exit (1 );
22
- }
17
+ // Use the operations performed in table.inc to create some traffic on the connection
18
+ // so that we can collect some statistics.
19
+ require 'table.inc ' ;
23
20
24
21
if (!is_array ($ info = mysqli_get_connection_stats ($ link )) || empty ($ info ))
25
22
printf ("[003] Expecting array/any_non_empty, got %s/%s \n" , gettype ($ info ), $ info );
@@ -60,11 +57,7 @@ if (!function_exists('mysqli_get_connection_stats')) {
60
57
}
61
58
62
59
mysqli_close ($ link );
63
- if (!$ link = my_mysqli_connect ($ host , $ user , $ passwd , $ db , $ port , $ socket )) {
64
- printf ("Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s \n" ,
65
- $ host , $ user , $ db , $ port , $ socket );
66
- exit (1 );
67
- }
60
+ require 'table.inc ' ;
68
61
69
62
if (!is_array ($ info = mysqli_get_connection_stats ($ link )) || empty ($ info ))
70
63
printf ("[008] Expecting array/any_non_empty, got %s/%s \n" , gettype ($ info ), $ info );
@@ -81,5 +74,9 @@ if (!function_exists('mysqli_get_connection_stats')) {
81
74
82
75
print "done! " ;
83
76
?>
77
+ --CLEAN--
78
+ <?php
79
+ require_once 'clean_table.inc ' ;
80
+ ?>
84
81
--EXPECT--
85
82
done!
0 commit comments