diff options
Diffstat (limited to 'Bugzilla/DB/Schema/Mysql.pm')
-rw-r--r-- | Bugzilla/DB/Schema/Mysql.pm | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 5893c6a80..79814140a 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -76,8 +76,6 @@ use constant REVERSE_MAPPING => { # as in their db-specific version, so no reverse mapping is needed. }; -use constant MYISAM_TABLES => qw(); - #------------------------------------------------------------------------------ sub _initialize { @@ -120,16 +118,18 @@ sub _initialize { } #eosub--_initialize #------------------------------------------------------------------------------ sub _get_create_table_ddl { - # Extend superclass method to specify the MYISAM storage engine. # Returns a "create table" SQL statement. - my($self, $table) = @_; - - my $charset = "CHARACTER SET utf8"; - my $type = grep($_ eq $table, MYISAM_TABLES) ? 'MYISAM' : 'InnoDB'; - return($self->SUPER::_get_create_table_ddl($table) - . " ENGINE = $type $charset"); - + my $charset = Bugzilla::DB::Mysql->utf8_charset; + my $collate = Bugzilla::DB::Mysql->utf8_collate; + my $row_format = Bugzilla::DB::Mysql->default_row_format($table); + my @parts = ( + $self->SUPER::_get_create_table_ddl($table), + 'ENGINE = InnoDB', + "CHARACTER SET $charset COLLATE $collate", + "ROW_FORMAT=$row_format", + ); + return join(' ', @parts); } #eosub--_get_create_table_ddl #------------------------------------------------------------------------------ sub _get_create_index_ddl { @@ -153,10 +153,9 @@ sub get_create_database_sql { my ($self, $name) = @_; # We only create as utf8 if we have no params (meaning we're doing # a new installation) or if the utf8 param is on. - my $create_utf8 = Bugzilla->params->{'utf8'} - || !defined Bugzilla->params->{'utf8'}; - my $charset = $create_utf8 ? "CHARACTER SET utf8" : ''; - return ("CREATE DATABASE $name $charset"); + my $charset = Bugzilla::DB::Mysql->utf8_charset; + my $collate = Bugzilla::DB::Mysql->utf8_collate; + return ("CREATE DATABASE $name CHARACTER SET $charset COLLATE $collate"); } # MySQL has a simpler ALTER TABLE syntax than ANSI. |