update_fix_access_table

Versions
4.7 – 5
update_fix_access_table()

Code

./update.php, line 580

<?php
function update_fix_access_table() {
  if (variable_get('update_access_fixed', FALSE)) {
    return;
  }

  switch ($GLOBALS['db_type']) {
    // Only for MySQL 4.1+
    case 'mysqli':
      break;
    case 'mysql':
      if (version_compare(mysql_get_server_info($GLOBALS['active_db']), '4.1.0', '<')) {
        return;
      }
      break;
    case 'pgsql':
      return;
  }

  // Convert access table to UTF-8 if needed.
  $result = db_fetch_array(db_query('SHOW CREATE TABLE {access}'));
  if (!preg_match('/utf8/i', array_pop($result))) {
    update_convert_table_utf8('access');
  }

  // Don't run again
  variable_set('update_access_fixed', TRUE);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.