diff options
-rw-r--r-- | Bugzilla/DB/Schema/Mysql.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index b5bebad30..0af73cc8f 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -135,8 +135,12 @@ sub _get_create_table_ddl { my $charset = Bugzilla->dbh->bz_db_is_utf8 ? "CHARACTER SET utf8" : ''; my $type = grep($_ eq $table, MYISAM_TABLES) ? 'MYISAM' : 'InnoDB'; - return ( - $self->SUPER::_get_create_table_ddl($table) . " ENGINE = $type $charset"); + + my $ddl = $self->SUPER::_get_create_table_ddl($table); + $ddl =~ s/CREATE TABLE (.*) \(/CREATE TABLE `$1` (/; + $ddl .= " ENGINE = $type $charset"; + + return $ddl; } #eosub--_get_create_table_ddl @@ -151,7 +155,7 @@ sub _get_create_index_ddl { my $sql = "CREATE "; $sql .= "$index_type " if ($index_type eq 'UNIQUE' || $index_type eq 'FULLTEXT'); - $sql .= "INDEX \`$index_name\` ON $table_name \(" + $sql .= "INDEX \`$index_name\` ON \`$table_name\` \(" . join(", ", @$index_fields) . "\)"; return ($sql); |