From 8b09a4f8c0bb1dbc1d261f3d69dfb4de729b3a62 Mon Sep 17 00:00:00 2001 From: Gokhan Gulbiz Date: Mon, 20 Mar 2023 08:46:52 +0300 Subject: [PATCH] Handle no comment end chars --- src/backend/distributed/utils/attribute.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/distributed/utils/attribute.c b/src/backend/distributed/utils/attribute.c index 51df6aaae..2ffd1e416 100644 --- a/src/backend/distributed/utils/attribute.c +++ b/src/backend/distributed/utils/attribute.c @@ -706,6 +706,13 @@ ExtractTopComment(const char *inputString) commentEndCharsIndex++; } + /* If there is no end of comment chars , return NULL */ + if (inputString[commentEndCharsIndex] != '*' && + inputString[commentEndCharsIndex + 1] != '/') + { + return NULL; + } + if (commentEndCharsIndex > commentStartCharsLength) { Datum substringTextDatum = DirectFunctionCall3(text_substr, PointerGetDatum(inputString),