Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e474dd1

Browse files
committed
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
1 parent 8cfb8c6 commit e474dd1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/backend/commands/comment.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,15 @@ void CreateComments(Oid oid, char *comment) {
171171
}
172172

173173
} else {
174-
desctuple = heap_formtuple(tupDesc, values, nulls);
175-
heap_insert(description, desctuple);
176-
modified = TRUE;
174+
175+
/*** Only if comment is non-blank do we form a new tuple ***/
176+
177+
if ((comment != NULL) && (strlen(comment) > 0)) {
178+
desctuple = heap_formtuple(tupDesc, values, nulls);
179+
heap_insert(description, desctuple);
180+
modified = TRUE;
181+
}
182+
177183
}
178184

179185
/*** Complete the scan, update indices, if necessary ***/

0 commit comments

Comments
 (0)