Skip to content

Commit

Permalink
Fix the issue the column name is not right (babelfish-for-postgresql#…
Browse files Browse the repository at this point in the history
…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 <[email protected]>
  • Loading branch information
forestkeeper authored Aug 9, 2024
1 parent 9024a42 commit e02ee26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/babelfishpg_tsql/src/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit e02ee26

Please sign in to comment.