diff --git a/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm b/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm index 2c7d80b36ae9..ba6ac7280e37 100644 --- a/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm +++ b/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm @@ -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.