Skip to content

Commit e2b3c0e

Browse files
committed
Remove checks for old libmysqlclient versions in tests
1 parent b0661a9 commit e2b3c0e

11 files changed

+142
-194
lines changed

ext/mysqli/tests/013.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ require_once('skipifconnectfailure.inc');
4646
$test .= ($c[$i] == $d[$i]) ? "1" : "0";
4747
if ($test == "11111111")
4848
echo "ok\n";
49-
else if ($b_res == FALSE && mysqli_get_client_version() > 40100 && mysqli_get_client_version() < 50000 &&
50-
mysqli_get_server_version($link) > 50000)
51-
echo "error (4.1 library with 5.x server)";
5249
else
5350
echo "error";
5451

ext/mysqli/tests/067.phpt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ function test: nested selects (cursors)
99
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
1010
die("skip Cannot connect to check required version");
1111

12-
/* skip cursor test for versions < 50004 */
13-
if ((!$IS_MYSQLND && (mysqli_get_client_version() < 50009)) ||
14-
(mysqli_get_server_version($link) < 50009)) {
15-
die(sprintf("skip Client library doesn't support cursors (%s/%s)",
16-
mysqli_get_client_version(), mysqli_get_server_version($link)));
12+
/* skip cursor test for server versions < 50009 */
13+
if (mysqli_get_server_version($link) < 50009) {
14+
die(sprintf("skip Server doesn't support cursors (%s)",
15+
mysqli_get_server_version($link)));
1716
}
1817
mysqli_close($link);
1918
?>
@@ -32,8 +31,7 @@ function test: nested selects (cursors)
3231
require_once("connect.inc");
3332
$mysql = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
3433

35-
if ((!$IS_MYSQLND && mysqli_get_client_version() < 50009) ||
36-
(mysqli_get_server_version($mysql) < 50009)) {
34+
if (mysqli_get_server_version($mysql) < 50009) {
3735
/* we really want to skip it... */
3836
die(var_dump(63));
3937
}

ext/mysqli/tests/mysqli_constants.phpt

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ mysqli.allow_local_infile=1
139139
$expected_constants['MYSQLI_SERVER_QUERY_WAS_SLOW'] = true;
140140
}
141141

142-
if ($version >= 50033 || $IS_MYSQLND) {
143-
$expected_constants['MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT'] = true;
144-
}
142+
$expected_constants['MYSQLI_CLIENT_SSL_VERIFY_SERVER_CERT'] = true;
145143
if ($IS_MYSQLND) {
146144
$expected_constants['MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT'] = true;
147145
}
@@ -151,36 +149,26 @@ mysqli.allow_local_infile=1
151149
$expected_constants['MYSQLI_SERVER_PUBLIC_KEY'] = true;
152150
}
153151

154-
if ($version > 50002) {
155-
$expected_constants = array_merge($expected_constants, array(
156-
"MYSQLI_TYPE_NEWDECIMAL" => true,
157-
"MYSQLI_TYPE_BIT" => true,
158-
));
159-
}
152+
$expected_constants = array_merge($expected_constants, array(
153+
"MYSQLI_TYPE_NEWDECIMAL" => true,
154+
"MYSQLI_TYPE_BIT" => true,
155+
));
160156

161-
if ($version > 50002 || $IS_MYSQLND) {
162-
$expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true;
163-
}
157+
$expected_constants['MYSQLI_NO_DEFAULT_VALUE_FLAG'] = true;
164158

165-
if ($version > 50003) {
166-
$expected_constants = array_merge($expected_constants, array(
167-
"MYSQLI_STMT_ATTR_CURSOR_TYPE" => true,
168-
"MYSQLI_CURSOR_TYPE_NO_CURSOR" => true,
169-
"MYSQLI_CURSOR_TYPE_READ_ONLY" => true,
170-
"MYSQLI_CURSOR_TYPE_FOR_UPDATE" => true,
171-
"MYSQLI_CURSOR_TYPE_SCROLLABLE" => true,
172-
));
173-
}
159+
$expected_constants = array_merge($expected_constants, array(
160+
"MYSQLI_STMT_ATTR_CURSOR_TYPE" => true,
161+
"MYSQLI_CURSOR_TYPE_NO_CURSOR" => true,
162+
"MYSQLI_CURSOR_TYPE_READ_ONLY" => true,
163+
"MYSQLI_CURSOR_TYPE_FOR_UPDATE" => true,
164+
"MYSQLI_CURSOR_TYPE_SCROLLABLE" => true,
165+
));
174166

175-
if ($version > 50007) {
176-
$expected_constants = array_merge($expected_constants, array(
177-
"MYSQLI_STMT_ATTR_PREFETCH_ROWS" => true,
178-
));
179-
}
167+
$expected_constants = array_merge($expected_constants, array(
168+
"MYSQLI_STMT_ATTR_PREFETCH_ROWS" => true,
169+
));
180170

181-
if ($version > 50110 || $IS_MYSQLND) {
182-
$expected_constants['MYSQLI_OPT_SSL_VERIFY_SERVER_CERT'] = true;
183-
}
171+
$expected_constants['MYSQLI_OPT_SSL_VERIFY_SERVER_CERT'] = true;
184172

185173
/* pretty dump test, but that is the best way to mimic mysql.c */
186174
if (defined('MYSQLI_DATA_TRUNCATED'))

ext/mysqli/tests/mysqli_fetch_array.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,7 @@ require_once('skipifconnectfailure.inc');
174174
func_mysqli_fetch_array($link, $engine, "INTEGER UNSIGNED", "4294967295", "4294967295", 230);
175175
func_mysqli_fetch_array($link, $engine, "INTEGER UNSIGNED", NULL, NULL, 240);
176176

177-
if ($IS_MYSQLND ||
178-
((mysqli_get_server_version($link) >= 51000) &&
179-
(mysqli_get_client_version($link) >= 51000))) {
177+
if ($IS_MYSQLND || mysqli_get_server_version($link) >= 51000) {
180178
func_mysqli_fetch_array($link, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
181179
func_mysqli_fetch_array($link, $engine, "BIGINT", NULL, NULL, 260);
182180
func_mysqli_fetch_array($link, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 260);

ext/mysqli/tests/mysqli_fetch_array_oo.phpt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ require_once('skipifconnectfailure.inc');
169169
func_mysqli_fetch_array($mysqli, $engine, "INTEGER UNSIGNED", "4294967295", "4294967295", 230);
170170
func_mysqli_fetch_array($mysqli, $engine, "INTEGER UNSIGNED", NULL, NULL, 240);
171171

172-
if ($IS_MYSQLND ||
173-
((mysqli_get_server_version($link) >= 51000) &&
174-
(mysqli_get_client_version($link) >= 51000))) {
172+
if ($IS_MYSQLND || mysqli_get_server_version($link) >= 51000) {
175173
func_mysqli_fetch_array($mysqli, $engine, "BIGINT", "-9223372036854775808", "-9223372036854775808", 250);
176174
func_mysqli_fetch_array($mysqli, $engine, "BIGINT", NULL, NULL, 260);
177175
func_mysqli_fetch_array($mysqli, $engine, "BIGINT UNSIGNED", "18446744073709551615", "18446744073709551615", 270);

ext/mysqli/tests/mysqli_fetch_assoc_bit.phpt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ mysqli_fetch_assoc() - BIT
1111
if (mysqli_get_server_version($link) < 50003)
1212
// b'001' syntax not supported before 5.0.3
1313
die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
14-
if (!$IS_MYSQLND && (mysqli_get_client_version() < 50003))
15-
// better don't trust libmysql before 5.0.3
16-
die("skip Syntax used for test not supported with MySQL Server before 5.0.3");
1714
?>
1815
--FILE--
1916
<?php

ext/mysqli/tests/mysqli_fetch_field_types.phpt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,8 @@ require_once('skipifconnectfailure.inc');
9696
MYSQLI_TYPE_GEOMETRY => 'MYSQLI_TYPE_GEOMETRY - TODO add testing',
9797
);
9898

99-
if ($IS_MYSQLND) {
100-
$version = 50007 + 1;
101-
} else {
102-
$version = mysqli_get_client_version();
103-
}
104-
105-
if ($version > 50002) {
106-
$datatypes[MYSQLI_TYPE_NEWDECIMAL] = array('DECIMAL', '1.1');
107-
$datatypes[MYSQLI_TYPE_BIT] = array('BIT', 0);
108-
} else {
109-
$datatypes[MYSQLI_TYPE_DECIMAL] = array('DECIMAL', '1.1');
110-
}
99+
$datatypes[MYSQLI_TYPE_NEWDECIMAL] = array('DECIMAL', '1.1');
100+
$datatypes[MYSQLI_TYPE_BIT] = array('BIT', 0);
111101

112102
foreach ($datatypes as $php_type => $datatype) {
113103
if (is_array($datatype))

ext/mysqli/tests/mysqli_stmt_attr_get.phpt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ require_once('skipifconnectfailure.inc');
1212

1313
require('table.inc');
1414

15-
$valid_attr = array("max_length" => MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH);
16-
if (mysqli_get_client_version() > 50003)
17-
$valid_attr["cursor_type"] = MYSQLI_STMT_ATTR_CURSOR_TYPE;
18-
19-
if ($IS_MYSQLND && mysqli_get_client_version() > 50007)
20-
$valid_attr["prefetch_rows"] = MYSQLI_STMT_ATTR_PREFETCH_ROWS;
15+
$valid_attr = array(
16+
"max_length" => MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH,
17+
"cursor_type" => MYSQLI_STMT_ATTR_CURSOR_TYPE,
18+
"prefetch_rows" => MYSQLI_STMT_ATTR_PREFETCH_ROWS,
19+
);
2120

2221
$stmt = mysqli_stmt_init($link);
2322
mysqli_stmt_prepare($stmt, 'SELECT * FROM test');

0 commit comments

Comments
 (0)