Browse files

MySQL allows only (max_allow_packet - 3)-bytes queries (thanks to kluvi)

  • Loading branch information...
1 parent 20a6546 commit baf21724cf219cc9d26b0296845d5044a33f33b3 @vrana committed May 20, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 adminer/include/adminer.inc.php
View
5 adminer/include/adminer.inc.php
@@ -657,11 +657,10 @@ function dumpData($table, $style, $query) {
$s = ($max_packet ? "\n" : " ") . "($s)";
if (!$buffer) {
$buffer = $insert . $s;
- } elseif (strlen($buffer) + 2 + strlen($s) < $max_packet) { // 2 - separator and terminator length
+ } elseif (strlen($buffer) + 4 + strlen($s) < $max_packet) { // 4 - length specification
$buffer .= ",$s";
} else {
- $buffer .= ";\n";
- echo $buffer;
+ echo "$buffer;\n";
$buffer = $insert . $s;
}
}

0 comments on commit baf2172

Please sign in to comment.