mirror of
https://github.com/vrana/adminer.git
synced 2025-08-12 09:34:10 +02:00
MySQL: Use utf8mb4 in export only if required
This commit is contained in:
@@ -523,3 +523,15 @@ function db_size($db) {
|
||||
}
|
||||
return format_number($return);
|
||||
}
|
||||
|
||||
/** Print SET NAMES if utf8mb4 might be needed
|
||||
* @param string
|
||||
* @return null
|
||||
*/
|
||||
function set_utf8mb4($create) {
|
||||
static $set = false;
|
||||
if (!$set && preg_match('~\butf8mb4~i', $create)) { // possible false positive
|
||||
$set = true;
|
||||
echo "SET NAMES utf8mb4;\n\n";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user