Commit b93e6fe8 authored by Matt Selsky's avatar Matt Selsky Committed by Gervase Markham

Bug 557536: checksetup.pl fails on ALTER DATABASE if database name contains hyphen. r=gerv, a=glob.

parent fe5bd2c4
......@@ -839,7 +839,7 @@ sub _fix_defaults {
sub _alter_db_charset_to_utf8 {
my $self = shift;
my $db_name = Bugzilla->localconfig->{db_name};
$self->do("ALTER DATABASE $db_name CHARACTER SET utf8");
$self->do("ALTER DATABASE `$db_name` CHARACTER SET utf8");
}
sub bz_db_is_utf8 {
......
......@@ -2205,7 +2205,7 @@ sub get_table_indexes_abstract {
sub get_create_database_sql {
my ($self, $name) = @_;
return ("CREATE DATABASE $name");
return ("CREATE DATABASE \"$name\"");
}
sub get_table_ddl {
......
......@@ -153,7 +153,7 @@ sub get_create_database_sql {
my $create_utf8 = Bugzilla->params->{'utf8'}
|| !defined Bugzilla->params->{'utf8'};
my $charset = $create_utf8 ? "CHARACTER SET utf8" : '';
return ("CREATE DATABASE $name $charset");
return ("CREATE DATABASE `$name` $charset");
}
# MySQL has a simpler ALTER TABLE syntax than ANSI.
......
......@@ -84,7 +84,7 @@ sub get_create_database_sql {
my $create_utf8 = Bugzilla->params->{'utf8'}
|| !defined Bugzilla->params->{'utf8'};
my $charset = $create_utf8 ? "ENCODING 'UTF8' TEMPLATE template0" : '';
return ("CREATE DATABASE $name $charset");
return ("CREATE DATABASE \"$name\" $charset");
}
sub get_rename_column_ddl {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment