summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-08-01 19:06:43 +0200
committermkanat%kerio.com <>2005-08-01 19:06:43 +0200
commitb42412599210eb6082b503af144c62613645372a (patch)
tree3838009382719ac03f452602ed58124f81d9149b
parentb0664db8a80695d4e149de24ddb3219df25fd3b3 (diff)
downloadbugzilla-b42412599210eb6082b503af144c62613645372a.tar.gz
bugzilla-b42412599210eb6082b503af144c62613645372a.tar.xz
Bug 301901: Index rename failure when renaming an index called PRIMARY
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=justdave, a=justdave
-rw-r--r--Bugzilla/DB/Schema/Mysql.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm
index 2c7d80b36..ba6ac7280 100644
--- a/Bugzilla/DB/Schema/Mysql.pm
+++ b/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.