Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6e10631

Browse files
committed
pg_dump test: Make concatenated create_sql commands more readable
When the pg_dump 002_pg_dump.pl test generates the command to load theschema, it does # Add terminating semicolon $create_sql{$test_db} .= $tests{$test}->{create_sql} . ";";In some cases, this creates a duplicate semicolon, but moreimportantly, this doesn't add any newline. So if you look at theresult in either the server log or intmp_check/log/regress_log_002_pg_dump, it looks like a complete mess.This patch makes the output look cleaner for manual inspection: addsemicolon only if necessary, and add two newlines.Discussion:https://www.postgresql.org/message-id/flat/d6aec95a-8729-43cc-2578-f2a5e46640e0%40enterprisedb.com
1 parenta73952b commit6e10631

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/bin/pg_dump/t/002_pg_dump.pl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,8 +3984,12 @@
39843984
next;
39853985
}
39863986
3987-
# Add terminating semicolon
3988-
$create_sql{$test_db} .=$tests{$test}->{create_sql} . ";";
3987+
# Normalize command ending: strip all line endings, add
3988+
# semicolon if missing, add two newlines.
3989+
my$create_sql =$tests{$test}->{create_sql};
3990+
chomp$create_sql;
3991+
$create_sql .= ';' unless substr($create_sql, -1) eq ';';
3992+
$create_sql{$test_db} .=$create_sql . "\n\n";
39893993
}
39903994
}
39913995

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp