<?php
-function get_tds_version() {
- global $dsn;
-
- $dsn_parts = explode(':', $dsn, 2);
- if ($dsn_parts[0] == 'dblib') { // uri is an option, which we'll ignore
- foreach (explode(';', $dsn_parts[1]) as $arg) {
- $arg = explode('=', $arg);
- if ($arg[0] == 'version') {
- return $arg[1];
- }
- }
- }
-
- return null;
-}
-
// bug #72969 reflects a bug with FreeTDS, not with pdo_dblib
// this function will version detect so the relevant tests can XFAILIF
function driver_supports_batch_statements_without_select($db) {
<?php
if (!extension_loaded('pdo_dblib')) die('skip not loaded');
require __DIR__ . '/config.inc';
-if (in_array(get_tds_version(), ['4.2', '4.6'])) die('skip feature unsupported by this TDS version');
+if (in_array($db->getAttribute(PDO::DBLIB_ATTR_TDS_VERSION), ['4.2', '4.6'])) die('skip feature unsupported by this TDS version');
?>
--FILE--
<?php
require __DIR__ . '/config.inc';
function get_expected_float_string() {
- switch (get_tds_version()) {
+ global $db;
+
+ switch ($db->getAttribute(PDO::DBLIB_ATTR_TDS_VERSION)) {
case '5.0':
case '6.0':
case '7.0':