Skip to content

Commit c8aa01c

Browse files
vrhappytuhaihe
authored andcommitted
Fix for gpcheckcat when issue gpcheckcat -C pg_class (#16902)
Error occurs when we issue command `gpcheckcat -C pg_class`. Reported error is "[ERROR] executing: Cross consistency check for pg_class\n Execution error: name 'db' is not defined". This is because of use of an undefined variable 'db'. This commit fixes the issue by removing its usage. Authored-by: vrhappy <songlong88@126.com>
1 parent 4084219 commit c8aa01c

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

gpMgmt/bin/gpcheckcat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def checkTableACL(cat):
12551255
try:
12561256
conn = connect2(GV.cfg[GV.coordinator_dbid], utilityMode=False)
12571257
with conn.cursor() as curs:
1258-
curs = db.execute(qry)
1258+
curs.execute(qry)
12591259
nrows = curs.rowcount
12601260

12611261
if nrows == 0:

gpMgmt/test/behave/mgmt_utils/gpcheckcat.feature

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Feature: gpcheckcat tests
99
Given database "all_good" is dropped and recreated
1010
Then the user runs "gpcheckcat -A"
1111
Then gpcheckcat should return a return code of 0
12+
When the user runs "gpcheckcat -C pg_class"
13+
Then gpcheckcat should return a return code of 0
14+
And gpcheckcat should not print "Execution error:" to stdout
1215
And the user runs "dropdb all_good"
1316

1417
Scenario: gpcheckcat should drop leaked schemas

0 commit comments

Comments
 (0)