Skip to content

Commit

Permalink
Fallback to default collation connection
Browse files Browse the repository at this point in the history
If user supplied wrong string we should gracefully fallback.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jan 26, 2016
1 parent f83b527 commit 76b1018
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion libraries/DatabaseInterface.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1812,13 +1812,26 @@ public function postConnect($link)
5
);
}
$this->query(
$result = $this->tryQuery(
"SET collation_connection = '"
. PMA_Util::sqlAddSlashes($GLOBALS['collation_connection'])
. "';",
$link,
self::QUERY_STORE
);
if ($result === false) {
trigger_error(
__('Failed to set configured collation connection!'),
E_USER_WARNING
);
$this->query(
"SET collation_connection = '"
. PMA_Util::sqlAddSlashes($default_collation)
. "';",
$link,
self::QUERY_STORE
);
}
} else {
$this->query(
"SET NAMES '$default_charset' COLLATE '$default_collation';",
Expand Down

0 comments on commit 76b1018

Please sign in to comment.