From 194ed4efe5c74e40452ac26142770200ff6f4111 Mon Sep 17 00:00:00 2001
From: "Marc G. Fournier" <scrappy@hub.org>
Date: Thu, 19 Dec 1996 05:01:17 +0000
Subject: [PATCH] More patches/documentation from: Massimo Dal Zotto
 <dz@cs.unitn.it>

---
 src/backend/commands/async.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 4f4739836a1..ad687f6e567 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.9 1996/12/19 04:54:56 scrappy Exp $
+ *    $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.10 1996/12/19 05:01:17 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -178,7 +178,11 @@ Async_Notify(char *relname)
     if (!pendingNotifies) 
       pendingNotifies = DLNewList();
 
-    notifyName = pstrdup(relname);
+    /* 
+     * Allocate memory from the global malloc pool because it needs to be
+     * referenced also when the transaction is finished.  DZ - 26-08-1996
+     */
+    notifyName = strdup(relname);
     DLAddHead(pendingNotifies, DLNewElem(notifyName));
     
     ScanKeyEntryInitialize(&key, 0,
@@ -580,7 +584,8 @@ AsyncExistsPendingNotify(char *relname)
     for (p = DLGetHead(pendingNotifies); 
 	 p != NULL;
 	 p = DLGetSucc(p)) {
-      if (!strcmp(DLE_VAL(p), relname))
+      /* Use NAMEDATALEN for relname comparison.    DZ - 26-08-1996 */
+      if (!strncmp(DLE_VAL(p), relname, NAMEDATALEN))
 	return 1;
     }
 
-- 
GitLab