From f972b6fae9b3ed23392186934098f244cd04b272 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 d3567619c..f2583da2c 100644 --- a/src/backend/distributed/utils/attribute.c +++ b/src/backend/distributed/utils/attribute.c @@ -636,6 +636,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),