Skip to content

Commit e123cae

Browse files
author
Ulf Wendel
committed
Proxying as many connect calls as possible to make testing of the compression protocol @ mysqlnd easier. By setting the environment variable MYSQL_TEST_COMPRESS you can tell the tests to set the MYSQLI_CLIENT_COMPRESS flag upon connect.
1 parent fe1709e commit e123cae

File tree

206 files changed

+478
-429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+478
-429
lines changed

ext/mysqli/tests/001.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
--TEST--
22
mysqli connect
33
--SKIPIF--
4-
<?php
5-
require_once('skipif.inc');
4+
<?php
5+
require_once('skipif.inc');
66
require_once('skipifemb.inc');
77
require_once('skipifconnectfailure.inc');
88
?>
@@ -13,25 +13,25 @@ require_once('skipifconnectfailure.inc');
1313
$test = "";
1414

1515
/*** test mysqli_connect localhost:port ***/
16-
$link = mysqli_connect($host, $user, $passwd, "", $port, $socket);
16+
$link = my_mysqli_connect($host, $user, $passwd, "", $port, $socket);
1717
$test .= ($link) ? "1" : "0";
1818
mysqli_close($link);
1919

2020
/*** test mysqli_real_connect ***/
2121
$link = mysqli_init();
22-
$test.= (mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
22+
$test.= (my_mysqli_real_connect($link, $host, $user, $passwd, "", $port, $socket) )
2323
? "1" : "0";
2424
mysqli_close($link);
2525

2626
/*** test mysqli_real_connect with db ***/
2727
$link = mysqli_init();
28-
$test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
28+
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
2929
? "1" : "0";
3030
mysqli_close($link);
3131

3232
/*** test mysqli_real_connect with port ***/
3333
$link = mysqli_init();
34-
$test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
34+
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
3535
? "1":"0";
3636
mysqli_close($link);
3737

@@ -40,7 +40,7 @@ require_once('skipifconnectfailure.inc');
4040
if (!$link = mysqli_init())
4141
printf("[001 + %d] mysqli_init() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
4242

43-
if (!mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
43+
if (!my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket))
4444
printf("[002 + %d] mysqli_real_connect() failed, [%d] %s\n", $i, mysqli_connect_errno(), mysqli_connect_error());
4545

4646
mysqli_close($link);
@@ -49,7 +49,7 @@ require_once('skipifconnectfailure.inc');
4949
/*** test mysqli_real_connect compressed ***/
5050
/*
5151
$link = mysqli_init();
52-
$test .= (mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
52+
$test .= (my_mysqli_real_connect($link, $host, $user, $passwd, $db, $port, $socket, MYSQLI_CLIENT_COMPRESS))
5353
? "1" : "0";
5454
mysqli_close($link);
5555
*/

ext/mysqli/tests/002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
1010
include "connect.inc";
1111

1212
/*** test mysqli_connect 127.0.0.1 ***/
13-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
13+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
1414
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
1515

1616
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))
@@ -49,7 +49,7 @@ require_once('skipifconnectfailure.inc');
4949
--CLEAN--
5050
<?php
5151
include "connect.inc";
52-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
52+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5353
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5454

5555
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_fetch_null"))

ext/mysqli/tests/003.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require_once('skipifconnectfailure.inc');
99
<?php
1010
include "connect.inc";
1111

12-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
12+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1313

1414
mysqli_query($link, "SET sql_mode=''");
1515

@@ -75,7 +75,7 @@ require_once('skipifconnectfailure.inc');
7575
--CLEAN--
7676
<?php
7777
include "connect.inc";
78-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
78+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
7979
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
8080

8181
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_result"))

ext/mysqli/tests/004.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
1010
include ("connect.inc");
1111

1212
/*** test mysqli_connect 127.0.0.1 ***/
13-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
13+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1414

1515
mysqli_select_db($link, $db);
1616

@@ -50,7 +50,7 @@ require_once('skipifconnectfailure.inc');
5050
--CLEAN--
5151
<?php
5252
include "connect.inc";
53-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
53+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5454
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5555

5656
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

ext/mysqli/tests/005.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
1010
include "connect.inc";
1111

1212
/*** test mysqli_connect 127.0.0.1 ***/
13-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
13+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1414

1515
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))
1616
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -43,7 +43,7 @@ require_once('skipifconnectfailure.inc');
4343
--CLEAN--
4444
<?php
4545
include "connect.inc";
46-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
46+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
4747
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
4848

4949
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

ext/mysqli/tests/006.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
1010
include "connect.inc";
1111

1212
/*** test mysqli_connect 127.0.0.1 ***/
13-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
13+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1414

1515
if (!mysqli_query($link, "SET sql_mode=''"))
1616
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
4848
--CLEAN--
4949
<?php
5050
include "connect.inc";
51-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
51+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5252
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5353

5454
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

ext/mysqli/tests/007.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
1010
include "connect.inc";
1111

1212
/*** test mysqli_connect 127.0.0.1 ***/
13-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
13+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1414

1515
if (!mysqli_query($link, "SET sql_mode=''"))
1616
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
4848
--CLEAN--
4949
<?php
5050
include "connect.inc";
51-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
51+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5252
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5353

5454
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

ext/mysqli/tests/008.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require_once('skipifconnectfailure.inc');
1010
include "connect.inc";
1111

1212
/*** test mysqli_connect 127.0.0.1 ***/
13-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
13+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1414

1515
if (!mysqli_query($link, "SET sql_mode=''"))
1616
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -48,7 +48,7 @@ require_once('skipifconnectfailure.inc');
4848
--CLEAN--
4949
<?php
5050
include "connect.inc";
51-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
51+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5252
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5353

5454
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

ext/mysqli/tests/009.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mysqli fetch bigint values (ok to fail with 4.1.x)
1414
include "connect.inc";
1515

1616
/*** test mysqli_connect 127.0.0.1 ***/
17-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
17+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1818

1919
if (!mysqli_query($link, "SET sql_mode=''"))
2020
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -81,7 +81,7 @@ mysqli fetch bigint values (ok to fail with 4.1.x)
8181
--CLEAN--
8282
<?php
8383
include "connect.inc";
84-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
84+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
8585
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
8686

8787
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

ext/mysqli/tests/010.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require_once('skipifconnectfailure.inc');
1212
include "connect.inc";
1313

1414
/*** test mysqli_connect 127.0.0.1 ***/
15-
$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket);
15+
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
1616

1717
if (!mysqli_query($link, "SET sql_mode=''"))
1818
printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
@@ -51,7 +51,7 @@ require_once('skipifconnectfailure.inc');
5151
--CLEAN--
5252
<?php
5353
include "connect.inc";
54-
if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket))
54+
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
5555
printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
5656

5757
if (!mysqli_query($link, "DROP TABLE IF EXISTS test_bind_fetch"))

0 commit comments

Comments
 (0)