I have problems trying to change engine on prefixed tables; $db_prefix should be set to '' while changing the engines:
function dbtuner_engine_configuration_submit($form, &$form_state) {
$engine = $form_state['values']['db_engine'];
$tables = db_query('SHOW TABLE STATUS');
$counter = 0;
global $db_prefix;
$prefix_backup = $db_prefix;
$db_prefix='';
while ($table = db_fetch_array($tables)) {
if ($table['Engine'] != $engine) {
db_query('ALTER TABLE {%s} ENGINE = %s', $table['Name'], $engine);
$counter++;
}
}
$db_prefix = $prefix_backup;
drupal_set_message(t('@count tables changed to @name', array('@count' => $counter, '@name' => $engine)));
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | dbtuner-797072.patch | 710 bytes | mikeytown2 |
Comments
Comment #1
mikeytown2 commentedtry this
Comment #2
mikeytown2 commentedpretty sure my patch will fix it.
committed
Comment #3
enboig commentedI agree your solution is far more simple; tested it and it works.