1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 08:06:59 +02:00

enum and set lengths

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@569 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-04-02 09:40:59 +00:00
parent f7452add47
commit 6e566c7f26

View File

@@ -28,7 +28,7 @@ function dump_table($table, $style, $is_view = false) {
$row_size = 21 + strlen(idf_escape($table));
foreach (fields($table) as $field) {
$type = $types[$field["type"]];
$row_size += 5 + ($field["length"] ? $field["length"] : $type) * (preg_match('~char|text|enum~', $field["type"]) ? 3 : 1); // UTF-8 in MySQL uses up to 3 bytes
$row_size += 5 + ($field["length"] ? (preg_match('~enum|set~', $field["type"]) ? strlen($field["length"]) : $field["length"]) : $type) * (preg_match('~char|text|enum|set~', $field["type"]) ? 3 : 1); // UTF-8 in MySQL uses up to 3 bytes
}
if ($row_size > $max_packet) {
$max_packet = min(1073741824, 1024 * ceil($row_size / 1024));