Unused parameter in vacuum.c

Started by Shigeru HANADAabout 15 years ago2 messages
#1Shigeru HANADA
hanada@metrosystems.co.jp
1 attachment(s)

Hi,

When I was reading vacuum.c, I found that the parameter 'stmttype' of
get_rel_oids() is not used at all. The parameter had been used as
command tag in the notice message about "invalid object type", but now
such messages are reported by other functions.

Please find attached remove-unused-parameter patch.

Regards,
--
Shigeru Hanada

Attachments:

remove_unused_parameter.patchapplication/octet-stream; name=remove_unused_parameter.patchDownload
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 2e829bc..2f68df4 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -59,8 +59,7 @@ static BufferAccessStrategy vac_strategy;
 
 
 /* non-export function prototypes */
-static List *get_rel_oids(Oid relid, const RangeVar *vacrel,
-			 const char *stmttype);
+static List *get_rel_oids(Oid relid, const RangeVar *vacrel);
 static void vac_truncate_clog(TransactionId frozenXID);
 static void vacuum_rel(Oid relid, VacuumStmt *vacstmt, bool do_toast,
 		   bool for_wraparound, bool *scanned_all);
@@ -161,7 +160,7 @@ vacuum(VacuumStmt *vacstmt, Oid relid, bool do_toast,
 	 * Build list of relations to process, unless caller gave us one. (If we
 	 * build one, we put it in vac_context for safekeeping.)
 	 */
-	relations = get_rel_oids(relid, vacstmt->relation, stmttype);
+	relations = get_rel_oids(relid, vacstmt->relation);
 
 	/*
 	 * Decide whether we need to start/commit our own transactions.
@@ -303,7 +302,7 @@ vacuum(VacuumStmt *vacstmt, Oid relid, bool do_toast,
  * per-relation transactions.
  */
 static List *
-get_rel_oids(Oid relid, const RangeVar *vacrel, const char *stmttype)
+get_rel_oids(Oid relid, const RangeVar *vacrel)
 {
 	List	   *oid_list = NIL;
 	MemoryContext oldcontext;
#2Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Shigeru HANADA (#1)
Re: Unused parameter in vacuum.c

On 18.11.2010 08:12, Shigeru HANADA wrote:

When I was reading vacuum.c, I found that the parameter 'stmttype' of
get_rel_oids() is not used at all. The parameter had been used as
command tag in the notice message about "invalid object type", but now
such messages are reported by other functions.

Please find attached remove-unused-parameter patch.

Thanks, applied.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com