From 2cfb9119902ebd3eef4093a503126d3eb4c06e25 Mon Sep 17 00:00:00 2001 From: Michiel Beijen Date: Sat, 30 Sep 2023 00:02:49 +0200 Subject: [PATCH] mysqldump: add line break before each database row It's interesting to see that at the end of the row there was a comment that read 'Always row break' but there actually was no 'row break'. It appears as if the idea _was_ that there was a newline after each row of data, increasing the readability of the dump files. However I opted to put the newline character _before_ the line instead, so also the first row of output is on a separate line from the INSERT statement. Fixes https://bugs.mysql.com/bug.php?id=65465 --- client/mysqldump.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.cc b/client/mysqldump.cc index 0bf85a1c0e2b..edd77a0b5fe3 100644 --- a/client/mysqldump.cc +++ b/client/mysqldump.cc @@ -3946,7 +3946,7 @@ static void dump_table(char *table, char *db) { : 0; if (extended_insert && !opt_xml) { if (first_column) { - dynstr_set_checked(&extended_row, "("); + dynstr_set_checked(&extended_row, "\n("); first_column = false; } else dynstr_append_checked(&extended_row, ","); @@ -4084,7 +4084,7 @@ static void dump_table(char *table, char *db) { row_length = 2 + extended_row.length; if (total_length + row_length < opt_net_buffer_length) { total_length += row_length; - fputc(',', md_result_file); /* Always row break */ + fputc(',', md_result_file); fputs(extended_row.str, md_result_file); } else { if (row_break) fputs(";\n", md_result_file);