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
This commit is contained in:
Bruce Momjian 2000-01-20 15:13:19 +00:00
parent 8cfb8c68ea
commit e474dd182a
1 changed files with 9 additions and 3 deletions

View File

@ -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 ***/