Limit $max_packet
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@454 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
f6e4fa2b42
commit
67c48d4645
|
@ -31,7 +31,7 @@ function dump_table($table, $style, $is_view = false) {
|
|||
$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
|
||||
}
|
||||
if ($row_size > $max_packet) {
|
||||
$max_packet = 1024 * ceil($row_size / 1024);
|
||||
$max_packet = min(1073741824, 1024 * ceil($row_size / 1024));
|
||||
echo "SET max_allowed_packet = $max_packet, GLOBAL max_allowed_packet = $max_packet;\n";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue