]> granicus.if.org Git - php/commitdiff
Update FreeTDS version detection related to bug #72969
authorAdam Baratz <adambaratz@php.net>
Fri, 8 May 2020 15:16:52 +0000 (11:16 -0400)
committerAdam Baratz <adambaratz@php.net>
Fri, 8 May 2020 18:34:00 +0000 (14:34 -0400)
ext/pdo_dblib/tests/config.inc

index 165f1d9330ace6f6a1819d1038fe00bbc9ce040c..0ea2abfef616da08b0dfc3667ae28384b5a19b28 100644 (file)
@@ -2,21 +2,11 @@
 
 // bug #72969 reflects a bug with FreeTDS, not with pdo_dblib
 // this function will version detect so the relevant tests can XFAILIF
+// assume this bug isn't present if not using FreeTDS
+// otherwise require FreeTDS>=1.1
 function driver_supports_batch_statements_without_select($db) {
     $version = $db->getAttribute(PDO::DBLIB_ATTR_VERSION);
-
-    // assume driver doesn't have this bug if not using FreeTDS
-    if (!strstartswith($version, 'freetds ')) {
-        return true;
-    }
-
-    // hasn't made it to numbered release yet
-    if (!strstartswith($version, 'freetds v1.1.dev.')) {
-        return false;
-    }
-
-    // fc820490336c50d5c175d2a15327383256add4c9 was committed on the 5th
-    return intval(substr($version, -8)) >= 20161206;
+    return !strstartswith($version, 'freetds ') || !strstartswith($version, 'freetds v1.0');
 }
 
 function strstartswith($haystack, $needle) {