From e474dd182a75387c092afae3a646405d42c6fde2 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 20 Jan 2000 15:13:19 +0000 Subject: [PATCH] Bruce, Attached is a small fix for a stupid mistake I made in comment.c - an attempt to drop a non-existent comment would dump core :-(. Sometimes, I'm as sharp as a marble. Sorry, Mike Mascari --- src/backend/commands/comment.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index dc8247691a..96f47b3d0e 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -171,9 +171,15 @@ void CreateComments(Oid oid, char *comment) { } } else { - desctuple = heap_formtuple(tupDesc, values, nulls); - heap_insert(description, desctuple); - modified = TRUE; + + /*** Only if comment is non-blank do we form a new tuple ***/ + + if ((comment != NULL) && (strlen(comment) > 0)) { + desctuple = heap_formtuple(tupDesc, values, nulls); + heap_insert(description, desctuple); + modified = TRUE; + } + } /*** Complete the scan, update indices, if necessary ***/ -- 2.11.0