You are here

public function Schema::DrupalSpecificFunctions in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::DrupalSpecificFunctions()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::drupalSpecificFunctions()

Returns a list of functions that are not available by default on SQL Server, but used in Drupal Core or contributed modules because they are available in other databases such as MySQL.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 78
Definition of Drupal\Driver\Database\sqlsrv\Schema

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function DrupalSpecificFunctions() {
  static $cache;
  if (!isset($cache)) {
    $cache = [
      'SUBSTRING',
      'SUBSTRING_INDEX',
      'GREATEST',
      'MD5',
      'LPAD',
      'GROUP_CONCAT',
      'IF',
      'CONNECTION_ID',
    ];

    // Since SQL Server 2012 (11), there is a native CONCAT implementation
    $version = $this->connection
      ->Scheme()
      ->EngineVersion()
      ->Version();
    if (version_compare($version, '11', '<')) {
      $cache[] = 'CONCAT';
    }
  }
  return $cache;
}