1
0
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:
Jakub Vrana
2015-03-06 09:36:20 -08:00
parent 6bbc8bc3ea
commit 8aa420d160
5 changed files with 29 additions and 10 deletions

View File

@@ -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";
}
}