Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sharu Goel <[email protected]>
  • Loading branch information
Sharu Goel committed Jan 29, 2025
1 parent 5ff1b50 commit a39a828
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contrib/babelfishpg_tsql/src/pl_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -5500,7 +5500,12 @@ pltsql_update_identity_insert_sequence(PLtsql_expr *expr)
datum = SysCacheGetAttr(SYSNAMESPACENAME, schema_tuple, Anum_namespace_ext_dbid, &isnull);
db_id = DatumGetInt16(datum);

if (!DbidIsValid(db_id) || db_id != get_cur_db_id())
if(!DbidIsValid(db_id))
ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("dbid in babelfish_namespace_ext catalog doesn't exists in babelfish_sysdatabases catalog")));

if (db_id != get_cur_db_id())
{
char *db_name = get_db_name(db_id);
char *user = get_user_for_database(db_name);
Expand All @@ -5509,6 +5514,7 @@ pltsql_update_identity_insert_sequence(PLtsql_expr *expr)
{
is_cross_db = true;
pfree(db_name);
pfree(user);
}
else
{
Expand Down

0 comments on commit a39a828

Please sign in to comment.