summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib
diff options
context:
space:
mode:
authorAdam Baratz <adambaratz@php.net>2020-05-08 11:16:52 -0400
committerAdam Baratz <adambaratz@php.net>2020-05-08 14:34:00 -0400
commite295266f8f80cb9001e35a6701d92dcad37a18a9 (patch)
tree4b7a0d2006b82af53878be4c19686ea47957be59 /ext/pdo_dblib
parent4a816584a4d483722485e5163396ea1bb2a6aee7 (diff)
downloadphp-git-e295266f8f80cb9001e35a6701d92dcad37a18a9.tar.gz
Update FreeTDS version detection related to bug #72969
Diffstat (limited to 'ext/pdo_dblib')
-rw-r--r--ext/pdo_dblib/tests/config.inc16
1 files changed, 3 insertions, 13 deletions
diff --git a/ext/pdo_dblib/tests/config.inc b/ext/pdo_dblib/tests/config.inc
index 165f1d9330..0ea2abfef6 100644
--- a/ext/pdo_dblib/tests/config.inc
+++ b/ext/pdo_dblib/tests/config.inc
@@ -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) {