- PostgreSQL: Support COPY FROM stdin in SQL query (bug #942)
- MySQL: Display number of found rows in group queries (regression from 5.1.1)
- non-MySQL: Parse '--' without trailing space as comment in SQL command (bug SF-842)
+- MS SQL: Limit one INSERT in export to 1000 rows (bug #983)
- CSS: Add logo
- Editor: Move mass sending e-mails to a plugin
- Plugins: Allow formatting translations using Adminer\lang_format()
$generated = array();
$suffix = "";
$fetch_function = ($table != '' ? 'fetch_assoc' : 'fetch_row');
+ $count = 0;
while ($row = $result->$fetch_function()) {
if (!$keys) {
$values = array();
$s = ($max_packet ? "\n" : " ") . "(" . implode(",\t", $row) . ")";
if (!$buffer) {
$buffer = $insert . $s;
- } elseif (strlen($buffer) + 4 + strlen($s) + strlen($suffix) < $max_packet) { // 4 - length specification
+ } elseif (JUSH == 'mssql'
+ ? $count % 1000 != 0 // https://learn.microsoft.com/en-us/sql/t-sql/queries/table-value-constructor-transact-sql#limitations-and-restrictions
+ : strlen($buffer) + 4 + strlen($s) + strlen($suffix) < $max_packet // 4 - length specification
+ ) {
$buffer .= ",$s";
} else {
echo $buffer . $suffix;
$buffer = $insert . $s;
}
}
+ $count++;
}
if ($buffer) {
echo $buffer . $suffix;