You are here

function dba_mysql_report_version in Database Administration 7

Return current MySQL version.

File

database/mysql.report.inc, line 52
Provides database driver specific report functions.

Code

function dba_mysql_report_version() {
  $result = db_query("SELECT variable_value FROM information_schema.global_variables WHERE variable_name = 'version'");
  foreach ($result as $row) {
    preg_match('/(\\d{1,2})\\.(\\d{1,2})\\.(\\d{1,2})/', $row->variable_value, $matches);
    array_shift($matches);
    $version = new dba_report_version($matches[0], $matches[1], $matches[2]);
    return $version;
  }
}