On Thu, Sep 21, 2023 at 06:56:29PM +1200, David Rowley wrote: > I deem it pretty unlikely that someone will accidentally remove the > code that I just committed and a test to test that vacuumdb -Z > --buffer-usage-limit ... passes the BUFFER_USAGE_LIMIT option would > likely just forever mark that we once had a trivial bug that forgot to > include the --buffer-usage-limit when -Z was specified.
Perhaps so. > If others feel strongly that a test is worthwhile, then I'll reconsider. I don't know if you would like that, but the addition is as simple as the attached, FYI. -- Michael
diff --git a/src/bin/scripts/t/100_vacuumdb.pl b/src/bin/scripts/t/100_vacuumdb.pl index eccfcc54a1..597bbd8f54 100644 --- a/src/bin/scripts/t/100_vacuumdb.pl +++ b/src/bin/scripts/t/100_vacuumdb.pl @@ -40,6 +40,10 @@ $node->issues_sql_like( [ 'vacuumdb', '--disable-page-skipping', 'postgres' ], qr/statement: VACUUM \(DISABLE_PAGE_SKIPPING, SKIP_DATABASE_STATS\).*;/, 'vacuumdb --disable-page-skipping'); +$node->issues_sql_like( + [ 'vacuumdb', '--buffer-usage-limit', '0', 'postgres' ], + qr/statement: VACUUM \(SKIP_DATABASE_STATS, BUFFER_USAGE_LIMIT '0'\).*;/, + 'vacuumdb --buffer-usage-limit'); $node->issues_sql_like( [ 'vacuumdb', '--skip-locked', 'postgres' ], qr/statement: VACUUM \(SKIP_DATABASE_STATS, SKIP_LOCKED\).*;/, @@ -48,6 +52,10 @@ $node->issues_sql_like( [ 'vacuumdb', '--skip-locked', '--analyze-only', 'postgres' ], qr/statement: ANALYZE \(SKIP_LOCKED\).*;/, 'vacuumdb --skip-locked --analyze-only'); +$node->issues_sql_like( + [ 'vacuumdb', '--buffer-usage-limit', '0', '--analyze-only', 'postgres' ], + qr/statement: ANALYZE \(BUFFER_USAGE_LIMIT '0'\).*;/, + 'vacuumdb --buffer-usage-limit --analyze-only'); $node->command_fails( [ 'vacuumdb', '--analyze-only', '--disable-page-skipping', 'postgres' ], '--analyze-only and --disable-page-skipping specified together');
signature.asc
Description: PGP signature