Skip to content

Commit

Permalink
Fix indentation
Browse files Browse the repository at this point in the history
Signed-off-by: P Aswini Kumar <[email protected]>
  • Loading branch information
P Aswini Kumar committed Sep 19, 2024
1 parent 46c9f2e commit 1ba5e67
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 49 deletions.
2 changes: 0 additions & 2 deletions contrib/babelfishpg_tsql/runtime/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2893,9 +2893,7 @@ has_dbaccess(PG_FUNCTION_ARGS)
}

if (!user)
{
PG_RETURN_INT32(0);
}
else
{
pfree(user);
Expand Down
2 changes: 1 addition & 1 deletion contrib/babelfishpg_tsql/src/catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -5017,7 +5017,7 @@ user_exists_for_db(const char *db_name, const char *user_name)
Relation bbf_authid_user_ext_rel;
HeapTuple tuple_user_ext;
ScanKeyData key[2];
TableScanDesc scan;
TableScanDesc scan;
NameData *rolname;
bool user_exists = false;

Expand Down
50 changes: 25 additions & 25 deletions contrib/babelfishpg_tsql/src/dbcmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,28 +413,28 @@ static void
create_bbf_db_internal(ParseState *pstate, const char *dbname, List *options, const char *owner, int16 dbid)
{
int16 old_dbid;
char *old_dbname;
char *old_dbname;
Oid datdba;
Datum *new_record;
bool *new_record_nulls;
Datum *new_record;
bool *new_record_nulls;
Relation sysdatabase_rel;
HeapTuple tuple;
List *parsetree_list;
ListCell *parsetree_item;
List *parsetree_list;
ListCell *parsetree_item;
char *dbo_scm = NULL;
char *dbo_role = NULL;
char *db_owner_role = NULL;
char *guest_scm = NULL;
NameData default_collation;
NameData owner_namedata;
char *guest = NULL;
int stmt_number = 0;
int save_sec_context;
bool is_set_userid = false;
Oid save_userid;
int stmt_number = 0;
int save_sec_context;
bool is_set_userid = false;
Oid save_userid;
const char *old_createrole_self_grant;
ListCell *option;
const char *database_collation_name = NULL;
const char *database_collation_name = NULL;

/* Check options */
foreach(option, options)
Expand Down Expand Up @@ -658,21 +658,21 @@ create_bbf_db_internal(ParseState *pstate, const char *dbname, List *options, co
void
drop_bbf_db(const char *dbname, bool missing_ok, bool force_drop)
{
volatile Relation sysdatabase_rel;
HeapTuple tuple;
Form_sysdatabases bbf_db;
int16 dbid;
char *schema_name = NULL;
char *db_owner_role = NULL;
char *dbo_role = NULL;
char *guest_schema_name = NULL;
List *db_users_list;
List *parsetree_list;
ListCell *parsetree_item;
const char *prev_current_user;
int save_sec_context;
bool is_set_userid = false;
Oid save_userid;
volatile Relation sysdatabase_rel;
HeapTuple tuple;
Form_sysdatabase bbf_db;
int16 dbid;
char *schema_name = NULL;
char *db_owner_role = NULL;
char *dbo_role = NULL;
char *guest_schema_name = NULL;
List *db_users_list;
List *parsetree_list;
ListCell *parsetree_item;
const char *prev_current_user;
int save_sec_context;
bool is_set_userid = false;
Oid save_userid;

if ((strlen(dbname) == 6 && (strncmp(dbname, "master", 6) == 0)) ||
((strlen(dbname) == 6 && strncmp(dbname, "tempdb", 6) == 0)) ||
Expand Down
36 changes: 18 additions & 18 deletions contrib/babelfishpg_tsql/src/pl_exec-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3228,31 +3228,31 @@ void exec_stmt_dbcc_checkident(PLtsql_stmt_dbcc *stmt)
struct dbcc_checkident dbcc_stmt = stmt->dbcc_stmt_data.dbcc_checkident;
Relation rel;
TupleDesc tupdesc;
char *db_name = NULL;
char *max_identity_value_str = NULL;
char *query = NULL;
char *attname;
char *token;
char *db_name = NULL;
char *max_identity_value_str = NULL;
char *query = NULL;
char *attname;
char *token;
const char *schema_name;
char *nsp_name = NULL;
const char *user;
char *guest_role_name = NULL;
char *dbo_role_name = NULL;
const char *login;
int64 max_identity_value = 0;
int64 cur_identity_value = 0;
int attnum;
int rc = 0;
int64 reseed_value = 0;
Oid nsp_oid;
Oid table_oid;
Oid seqid = InvalidOid;
Oid current_user_id = GetUserId();
volatile bool cur_value_is_null = true;
bool login_is_db_owner;
int64 max_identity_value = 0;
int64 cur_identity_value = 0;
int attnum;
int rc = 0;
int64 reseed_value = 0;
Oid nsp_oid;
Oid table_oid;
Oid seqid = InvalidOid;
Oid current_user_id = GetUserId();
volatile bool cur_value_is_null = true;
bool login_is_db_owner;
StringInfoData msg;
bool is_float_value;
bool is_cross_db = false;
bool is_float_value;
bool is_cross_db = false;


if(dbcc_stmt.new_reseed_value)
Expand Down
6 changes: 3 additions & 3 deletions contrib/babelfishpg_tsql/src/pl_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -3337,11 +3337,11 @@ bbf_ProcessUtility(PlannedStmt *pstmt,
char *user_name;
const char *db_principal_type = drop_user ? "user" : "role";
char *db_owner_name;
int role_oid;
int rolename_len;
int role_oid;
int rolename_len;
bool is_tsql_db_principal = false;
bool is_psql_db_principal = false;
Oid dbowner;
Oid dbowner;

user_name = get_physical_user_name(db_name, rolspec->rolename, false, true);
db_owner_name = get_db_owner_name(db_name);
Expand Down

0 comments on commit 1ba5e67

Please sign in to comment.