From: Bruce Momjian Date: Thu, 20 Jan 2000 15:13:19 +0000 (+0000) Subject: Bruce, X-Git-Tag: REL7_0~776 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e474dd182a75387c092afae3a646405d42c6fde2;p=postgresql 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 --- 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 ***/