You are here

public function DatabaseSchema_sqlsrv::DrupalSpecificFunctions in Drupal driver for SQL Server and SQL Azure 7.2

Same name and namespace in other branches
  1. 7.3 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::DrupalSpecificFunctions()
  2. 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::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

sqlsrv/schema.inc, line 71
Database schema code for Microsoft SQL Server database servers.

Class

DatabaseSchema_sqlsrv

Code

public function DrupalSpecificFunctions() {
  if ($cache = fastcache::cache_get('drupal_specific_functions', 'schema')) {
    return $cache->data;
  }
  $functions = array(
    'SUBSTRING',
    'SUBSTRING_INDEX',
    'GREATEST',
    'MD5',
    'LPAD',
    'GROUP_CONCAT',
    'CONCAT',
    'IF',
    'CONNECTION_ID',
  );

  // Since SQL Server 2012 (11), there
  // is a native CONCAT implementation
  if ($this
    ->EngineVersionNumber() >= 11) {
    $functions = array_diff($functions, array(
      'CONCAT',
    ));
  }
  fastcache::cache_set('drupal_specific_functions', $functions, 'schema');
  return $functions;
}