Commit b4241259 authored by mkanat%kerio.com's avatar mkanat%kerio.com

Bug 301901: Index rename failure when renaming an index called PRIMARY

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=justdave
parent b0664db8
......@@ -184,6 +184,9 @@ sub get_rename_indexes_ddl {
my $type = $indexes{$old_name}->{TYPE};
$type ||= 'INDEX';
my $fields = join(',', @{$indexes{$old_name}->{FIELDS}});
# $old_name needs to be escaped, sometimes, because it was
# a reserved word.
$old_name = '`' . $old_name . '`';
$sql .= " ADD $type $name ($fields), DROP INDEX $old_name,";
}
# Remove the last comma.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment