Skip to content

Commit

Permalink
modify RUN_AS_PSQL macro for unified dialect handling
Browse files Browse the repository at this point in the history
  • Loading branch information
roshan0708 committed Feb 5, 2025
1 parent 836bcb2 commit b82024a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/backend/utils/adt/ri_triggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,27 +96,27 @@
#define RUN_AS_PSQL(qplan) \
do \
{ \
bool reset_dialect = (sql_dialect == SQL_DIALECT_TSQL); \
int sql_dialect_old = sql_dialect; \
void *newextra = NULL; \
if (reset_dialect) \
if (sql_dialect == SQL_DIALECT_TSQL) \
{ \
int sql_dialect_old = sql_dialect; \
void *newextra = NULL; \
sql_dialect = SQL_DIALECT_PG; \
assign_sql_dialect(sql_dialect, newextra); \
} \
PG_TRY(); \
{ \
qplan; \
} \
PG_FINALLY(); \
{ \
if (reset_dialect) \
PG_TRY(); \
{ \
qplan; \
} \
PG_FINALLY(); \
{ \
sql_dialect = sql_dialect_old; \
assign_sql_dialect(sql_dialect, newextra); \
} \
PG_END_TRY(); \
} \
else \
{ \
qplan; \
} \
PG_END_TRY(); \
} while (0)


Expand Down

0 comments on commit b82024a

Please sign in to comment.