From 67c48d46452231535d39467c7fe301fc51e6874c Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 26 Aug 2008 10:13:13 +0000 Subject: [PATCH] Limit $max_packet git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@454 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- export.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export.inc.php b/export.inc.php index bc152a90..b7ecb15e 100644 --- a/export.inc.php +++ b/export.inc.php @@ -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"; } }