summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB/Schema/Mysql.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/DB/Schema/Mysql.pm')
-rw-r--r--Bugzilla/DB/Schema/Mysql.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm
index 0069dcc7f..d7cd708a2 100644
--- a/Bugzilla/DB/Schema/Mysql.pm
+++ b/Bugzilla/DB/Schema/Mysql.pm
@@ -129,7 +129,9 @@ sub _get_create_table_ddl {
my($self, $table) = @_;
- return($self->SUPER::_get_create_table_ddl($table) . ' TYPE = MYISAM');
+ my $charset = Bugzilla->dbh->bz_db_is_utf8 ? "CHARACTER SET utf8" : '';
+ return($self->SUPER::_get_create_table_ddl($table)
+ . " ENGINE = MYISAM $charset");
} #eosub--_get_create_table_ddl
#------------------------------------------------------------------------------
@@ -150,6 +152,16 @@ sub _get_create_index_ddl {
} #eosub--_get_create_index_ddl
#--------------------------------------------------------------------
+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");
+}
+
# MySQL has a simpler ALTER TABLE syntax than ANSI.
sub get_alter_column_ddl {
my ($self, $table, $column, $new_def, $set_nulls_to) = @_;