From e02ee26546cfde43f65e1bda1243b878a87c0790 Mon Sep 17 00:00:00 2001 From: Zhibai Song Date: Fri, 9 Aug 2024 15:21:29 -0700 Subject: [PATCH] Fix the issue the column name is not right (#2844) Column name is wrong when the column is followed with a direct '--' comment, this commit fix the issue by correctly set the column_start pointer during the identifier search. Task: BABEL-5139 Signed-off-by: Zhibai Song --- contrib/babelfishpg_tsql/src/hooks.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/babelfishpg_tsql/src/hooks.c b/contrib/babelfishpg_tsql/src/hooks.c index 02222183b6..4ab732bd17 100644 --- a/contrib/babelfishpg_tsql/src/hooks.c +++ b/contrib/babelfishpg_tsql/src/hooks.c @@ -2009,7 +2009,11 @@ pre_transform_target_entry(ResTarget *res, ParseState *pstate, * for the last_dot position */ if (*colname_start == '-' && *(colname_start+1) == '-') + { + last_dot++; + colname_start = last_dot; break; + } if(open_square_bracket == 0 && *colname_start == '"') { double_quotes++;