From fc9cdb723bcd02dfdb83962ca1eda57ec4c10296 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 28 Apr 2019 23:48:27 +0200 Subject: 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@. --- ext/pdo_mysql/tests/mysql_pdo_test.inc | 2 +- ext/pdo_mysql/tests/pdo_mysql_exec.phpt | 2 +- 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'])) { -- cgit v1.2.1