Commit 0d2571d6 authored by Brandon Walts's avatar Brandon Walts
Browse files

only backtick-protect database names for MySQL (not Postgres)

parent ad960050
......@@ -113,7 +113,11 @@ sub dbc_hash_to_cmd {
if($driver eq 'sqlite') {
return "rm -f $dbname";
} elsif(!$2) {
$sqlcmd = "$1 \`$dbname\`";
if ($driver eq 'mysql') {
$sqlcmd = "$1 \`$dbname\`";
} else {
$sqlcmd = "$1 $dbname";
}
$dbc_hash->{dbname} = '';
}
} elsif($sqlcmd =~ /(CREATE\s+DATABASE\s*?)(?:\s+(\w+))?/i ) {
......@@ -122,7 +126,11 @@ sub dbc_hash_to_cmd {
if($driver eq 'sqlite') {
return "touch $dbname";
} elsif(!$2) {
$sqlcmd = "$1 \`$dbname\`";
if ($driver eq 'mysql') {
$sqlcmd = "$1 \`$dbname\`";
} else {
$sqlcmd = "$1 $dbname";
}
$dbc_hash->{dbname} = '';
}
}
......
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