aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2000-01-20 15:13:19 +0000
committerBruce Momjian <bruce@momjian.us>2000-01-20 15:13:19 +0000
commite474dd182a75387c092afae3a646405d42c6fde2 (patch)
tree9547aac03559db8a8bbc046b3b9462943d83f8fc /src
parent8cfb8c68eaa565679352b804d1cee5a94a4dea28 (diff)
downloadpostgresql-e474dd182a75387c092afae3a646405d42c6fde2.tar.gz
postgresql-e474dd182a75387c092afae3a646405d42c6fde2.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/comment.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index dc8247691ab..96f47b3d0ef 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 ***/