public inbox for [email protected]  
help / color / mirror / Atom feed
From: Japin Li <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Typo about the SetDatatabaseHasLoginEventTriggers?
Date: Tue, 16 Apr 2024 14:05:46 +0800
Message-ID: <ME3P282MB316611A2F7BF43919F695228B6082@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM> (raw)


Hi,

Upon reviewing the login event trigger, I noticed a potential typo about
the SetDatabaseHasLoginEventTriggers function name.

diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 0d3214df9c..7a5ed6b985 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -111,7 +111,7 @@ static void validate_table_rewrite_tags(const char *filtervar, List *taglist);
 static void EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata);
 static const char *stringify_grant_objtype(ObjectType objtype);
 static const char *stringify_adefprivs_objtype(ObjectType objtype);
-static void SetDatatabaseHasLoginEventTriggers(void);
+static void SetDatabaseHasLoginEventTriggers(void);

 /*
  * Create an event trigger.
@@ -315,7 +315,7 @@ insert_event_trigger_tuple(const char *trigname, const char *eventname, Oid evtO
 	 * faster lookups in hot codepaths. Set the flag unless already True.
 	 */
 	if (strcmp(eventname, "login") == 0)
-		SetDatatabaseHasLoginEventTriggers();
+		SetDatabaseHasLoginEventTriggers();

 	/* Depend on owner. */
 	recordDependencyOnOwner(EventTriggerRelationId, trigoid, evtOwner);
@@ -383,7 +383,7 @@ filter_list_to_array(List *filterlist)
  * current database has on login event triggers.
  */
 void
-SetDatatabaseHasLoginEventTriggers(void)
+SetDatabaseHasLoginEventTriggers(void)
 {
 	/* Set dathasloginevt flag in pg_database */
 	Form_pg_database db;
@@ -453,7 +453,7 @@ AlterEventTrigger(AlterEventTrigStmt *stmt)
 	 */
 	if (namestrcmp(&evtForm->evtevent, "login") == 0 &&
 		tgenabled != TRIGGER_DISABLED)
-		SetDatatabaseHasLoginEventTriggers();
+		SetDatabaseHasLoginEventTriggers();

 	InvokeObjectPostAlterHook(EventTriggerRelationId,
 							  trigoid, 0);
@@ -925,7 +925,7 @@ EventTriggerOnLogin(void)
 	/*
 	 * There is no active login event trigger, but our
 	 * pg_database.dathasloginevt is set. Try to unset this flag.  We use the
-	 * lock to prevent concurrent SetDatatabaseHasLoginEventTriggers(), but we
+	 * lock to prevent concurrent SetDatabaseHasLoginEventTriggers(), but we
 	 * don't want to hang the connection waiting on the lock.  Thus, we are
 	 * just trying to acquire the lock conditionally.
 	 */
--
Regards,
Japin Li






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Typo about the SetDatatabaseHasLoginEventTriggers?
  In-Reply-To: <ME3P282MB316611A2F7BF43919F695228B6082@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox