You are here

function apdqc_admin_convert_semaphore_table_to_innodb in Asynchronous Prefetch Database Query Cache 7

Convert semaphore table to InnoDB.

Parameters

bool $show_msg: Set to FALSE to not run drupal_set_message().

2 calls to apdqc_admin_convert_semaphore_table_to_innodb()
apdqc_disable in ./apdqc.install
Implements hook_disable().
drush_apdqc in ./apdqc.drush.inc
Drush command to all all the apdqc functions.
1 string reference to 'apdqc_admin_convert_semaphore_table_to_innodb'
apdqc_admin_operations_form in ./apdqc.admin.inc
Form builder; perform apdqc operations.

File

./apdqc.admin.inc, line 514
Admin page callbacks for the apdqc module.

Code

function apdqc_admin_convert_semaphore_table_to_innodb($show_msg = TRUE) {
  $before = apdqc_semaphore_conversion();

  // Run the command.
  db_query('ALTER TABLE {semaphore} ENGINE = InnoDB');

  // Let user know it worked.
  if ($show_msg !== FALSE) {
    $conversion = apdqc_semaphore_conversion();
    if ($before != 2) {
      drupal_set_message(t('APDQC: semaphore table is already using the InnoDB engine.'));
    }
    elseif ($conversion == 2) {
      drupal_set_message(t('APDQC: semaphore table was not converted to InnoDB engine. You need to do this manually by using a tool like phpmyadmin.'), 'error');
    }
    else {
      drupal_set_message(t('APDQC: semaphore table converted to InnoDB engine'));
    }
  }
}