summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-04-28 23:48:27 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2019-04-28 23:48:27 +0200
commitfc9cdb723bcd02dfdb83962ca1eda57ec4c10296 (patch)
tree45445fa95db191e84fa7e87b04a66c27582e3735
parent6d8892aacda5a24362ed5368812cba6427006c5d (diff)
downloadphp-git-fc9cdb723bcd02dfdb83962ca1eda57ec4c10296.tar.gz
Make MySQLPDOTest::extractVersion() more liberal
MySQL/MariaDB version strings may have suffixes which may contain dots; for instance, Debian stretch has 5.5.5-10.1.37-MariaDB-0+deb9u1 or such. Therefore, we make the version extraction more liberal, and only require that there are at least three parts separated by dot, and ignore additional parts. We also fix an erroneous test expectation, which would be triggered on CI now, right away. This patch has been provided by petk@.
-rw-r--r--ext/pdo_mysql/tests/mysql_pdo_test.inc2
-rw-r--r--ext/pdo_mysql/tests/pdo_mysql_exec.phpt2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_mysql/tests/mysql_pdo_test.inc b/ext/pdo_mysql/tests/mysql_pdo_test.inc
index d6d06be72f..65ad7b2d17 100644
--- a/ext/pdo_mysql/tests/mysql_pdo_test.inc
+++ b/ext/pdo_mysql/tests/mysql_pdo_test.inc
@@ -107,7 +107,7 @@ class MySQLPDOTest extends PDOTest {
// stinky string which we need to parse
$parts = explode('.', $version_string);
- if (count($parts) != 3)
+ if (count($parts) < 3)
return -1;
$version = (int)$parts[0] * 10000;
diff --git a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
index acd90904f7..983073782e 100644
--- a/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
+++ b/ext/pdo_mysql/tests/pdo_mysql_exec.phpt
@@ -75,7 +75,7 @@ MySQLPDOTest::skip();
exec_and_count(19, $db, 'CREATE PROCEDURE p(OUT ver_param VARCHAR(255)) BEGIN SELECT VERSION() INTO ver_param; END;', 0);
// we got this far without problems. If there's an issue from now on, its a failure
$ignore_exception = false;
- exec_and_count(20, $db, 'CALL p(@version)', 0);
+ exec_and_count(20, $db, 'CALL p(@version)', 1);
$stmt = $db->query('SELECT @version AS p_version');
$tmp = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (count($tmp) > 1 || !isset($tmp[0]['p_version'])) {