1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Remove MySQL 4.1 checks

This commit is contained in:
Kamil Tekiela
2023-09-19 15:40:59 +01:00
parent 5f6bf3edd6
commit 83738fc9a4
6 changed files with 2 additions and 78 deletions

View File

@@ -4,22 +4,7 @@ mysqli_change_user() - SET NAMES
mysqli
--SKIPIF--
<?php
require_once 'connect.inc';
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
if (!$res = mysqli_query($link, 'SELECT version() AS server_version'))
die(sprintf("skip [%d] %s\n", mysqli_errno($link), mysqli_error($link)));
$tmp = mysqli_fetch_assoc($res);
mysqli_free_result($res);
$version = explode('.', $tmp['server_version']);
if (empty($version))
die(sprintf("skip Cannot determine server version, we need MySQL Server 4.1+ for the test!"));
if ($version[0] <= 4 && $version[1] < 1)
die(sprintf("skip We need MySQL Server 4.1+ for the test!"));
require_once 'skipifconnectfailure.inc';
?>
--FILE--
<?php

View File

@@ -16,17 +16,6 @@ require_once 'skipifconnectfailure.inc';
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
if (!$res = mysqli_query($link, 'SELECT version() AS server_version'))
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$tmp = mysqli_fetch_assoc($res);
mysqli_free_result($res);
$version = explode('.', $tmp['server_version']);
if (empty($version))
printf("[003] Cannot determine server version, need MySQL Server 4.1+ for the test!\n");
if ($version[0] <= 4 && $version[1] < 1)
printf("[004] Need MySQL Server 4.1+ for the test!\n");
if (!$res = mysqli_query($link, "SHOW CHARACTER SET"))
printf("[005] Cannot get list of available character sets, [%d] %s\n",
mysqli_errno($link), mysqli_error($link));

View File

@@ -15,17 +15,6 @@ require_once 'skipifconnectfailure.inc';
exit(1);
}
if (!$res = mysqli_query($link, 'SELECT version() AS server_version'))
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$tmp = mysqli_fetch_assoc($res);
mysqli_free_result($res);
$version = explode('.', $tmp['server_version']);
if (empty($version))
printf("[005] Cannot determine server version, need MySQL Server 4.1+ for the test!\n");
if ($version[0] <= 4 && $version[1] < 1)
printf("[006] Need MySQL Server 4.1+ for the test!\n");
if (!$res = mysqli_query($link, 'SELECT @@character_set_connection AS charset, @@collation_connection AS collation'))
printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
$tmp = mysqli_fetch_assoc($res);

View File

@@ -29,20 +29,6 @@ if (!$link2 = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
$host, $user, $db, $port, $socket);
}
if (!$res = mysqli_query($link2, 'SELECT version() AS server_version')) {
printf("[007] [%d] %s\n", mysqli_errno($link2), mysqli_error($link2));
}
$tmp = mysqli_fetch_assoc($res);
mysqli_free_result($res);
$version = explode('.', $tmp['server_version']);
if (empty($version)) {
printf("[008] Cannot determine server version, need MySQL Server 4.1+ for the test!\n");
}
if ($version[0] <= 4 && $version[1] < 1) {
printf("[009] Need MySQL Server 4.1+ for the test!\n");
}
if (!$res = mysqli_query($link2, "SHOW CHARACTER SET")) {
printf("[010] Cannot get list of available character sets, [%d] %s\n",
mysqli_errno($link2), mysqli_error($link2));

View File

@@ -8,25 +8,6 @@ require_once 'connect.inc';
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
if (!($res = mysqli_query($link, 'SELECT version() AS server_version')) ||
!($tmp = mysqli_fetch_assoc($res))) {
mysqli_close($link);
die(sprintf("skip Cannot check server version, [%d] %s\n",
mysqli_errno($link), mysqli_error($link)));
}
mysqli_free_result($res);
$version = explode('.', $tmp['server_version']);
if (empty($version)) {
mysqli_close($link);
die(sprintf("skip Cannot check server version, based on '%s'",
$tmp['server_version']));
}
if ($version[0] <= 4 && $version[1] < 1) {
mysqli_close($link);
die(sprintf("skip Requires MySQL Server 4.1+\n"));
}
if ((($res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin1"', MYSQLI_STORE_RESULT)) &&
(mysqli_num_rows($res) == 1)) ||
(($res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin2"', MYSQLI_STORE_RESULT)) &&

View File

@@ -4,13 +4,7 @@ mysqli_stmt_execute()
mysqli
--SKIPIF--
<?php
require_once 'connect.inc';
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysqli_connect_errno(), mysqli_connect_error()));
}
if (mysqli_get_server_version($link) <= 40100) {
die(sprintf('skip Needs MySQL 4.1+, found version %d.', mysqli_get_server_version($link)));
}
require_once 'skipifconnectfailure.inc';
?>
--FILE--
<?php