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

Commit0803b0a

Browse files
committed
Add TAP tests for vacuumdb with column lists
vacuumdb generates by itself SQL queries to run ANALYZE or VACUUM on thebackend, but we never actually checked for query patterns with columnlists defined.Author: Michael PaquierReviewed-by: Nathan BossartDiscussion:https://postgr.es/m/FFE5373C-E26A-495B-B5C8-911EC4A41C5E@amazon.com
1 parentd6f6f0f commit0803b0a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎src/bin/scripts/t/100_vacuumdb.pl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use PostgresNode;
55
use TestLib;
6-
use Test::Moretests=>30;
6+
use Test::Moretests=>35;
77

88
program_help_ok('vacuumdb');
99
program_version_ok('vacuumdb');
@@ -63,6 +63,7 @@
6363
$node->safe_psql(
6464
'postgres',q|
6565
CREATE TABLE "need""q(uot" (")x" text);
66+
CREATE TABLE vactable (a int, b int);
6667
6768
CREATE FUNCTION f0(int) RETURNS int LANGUAGE SQL AS 'SELECT $1 * $1';
6869
CREATE FUNCTION f1(int) RETURNS int LANGUAGE SQL AS 'SELECT f0($1)';
@@ -75,3 +76,15 @@
7576
$node->command_fails(
7677
[qw|vacuumdb -Zt funcidx postgres|],
7778
'unqualifed name via functional index');
79+
80+
$node->command_fails(
81+
['vacuumdb','--analyze','--table','vactable(c)','postgres' ],
82+
'incorrect column name with ANALYZE');
83+
$node->issues_sql_like(
84+
['vacuumdb','--analyze','--table','vactable(a, b)','postgres' ],
85+
qr/statement: VACUUM\(ANALYZE\) public.vactable\(a, b\);/,
86+
'vacuumdb --analyze with complete column list');
87+
$node->issues_sql_like(
88+
['vacuumdb','--analyze-only','--table','vactable(b)','postgres' ],
89+
qr/statement: ANALYZE public.vactable\(b\);/,
90+
'vacuumdb --analyze-only with partial column list');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp