Skip to content

Commit

Permalink
Update logic
Browse files Browse the repository at this point in the history
Signed-off-by: Shameem Ahmed <shameemahmed20apr2000@gmail.com>
  • Loading branch information
ahmed-shameem committed Jan 10, 2025
1 parent fed36ee commit 3d798e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contrib/babelfishpg_tsql/src/pltsql_ruleutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,12 +1434,14 @@ get_rule_expr(Node *node, deparse_context *context,
CollateExpr *collate = (CollateExpr *) node;
Node *arg = (Node *) collate->arg;

if (!PRETTY_PAREN(context))
const char *dump_restore = GetConfigOption("babelfishpg_tsql.dump_restore", true, false);

if (!PRETTY_PAREN(context) && (!dump_retore || (dump_restore && strcmp(dump_restore, "on") != 0)))
appendStringInfoChar(buf, '(');
get_rule_expr_paren(arg, context, showimplicit, node);
appendStringInfo(buf, " COLLATE %s",
generate_tsql_collation_name(collate->collOid));
if (!PRETTY_PAREN(context))
if (!PRETTY_PAREN(context) && (!dump_retore || (dump_restore && strcmp(dump_restore, "on") != 0)))
appendStringInfoChar(buf, ')');
}
break;
Expand Down

0 comments on commit 3d798e9

Please sign in to comment.