Skip to content

Commit

Permalink
Fix some compiler warnings (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov authored Oct 11, 2024
1 parent a59d314 commit 38f6e5c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/access/pg_tde_ddl.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ static void
tdeheap_object_access_hook(ObjectAccessType access, Oid classId, Oid objectId,
int subId, void *arg)
{
Relation rel = NULL;

if (prev_object_access_hook)
prev_object_access_hook(access, classId, objectId, subId, arg);

Relation rel = NULL;
if (access == OAT_DROP && classId == RelationRelationId)
{
ObjectAccessDrop *drop_arg = (ObjectAccessDrop *) arg;
Expand Down
8 changes: 4 additions & 4 deletions src/catalog/tde_keyring.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,9 +598,9 @@ load_vaultV2_keyring_provider_options(char *keyring_options)
ereport(WARNING,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("missing in the keyring options:%s%s%s",
!vaultV2_keyring->vault_token ? " token" : "",
!vaultV2_keyring->vault_url ? " url" : "",
!vaultV2_keyring->vault_mount_path ? " mountPath" : "")));
*(vaultV2_keyring->vault_token) ? "" : " token",
*(vaultV2_keyring->vault_url) ? "" : " url",
*(vaultV2_keyring->vault_mount_path) ? "" : " mountPath")));
return NULL;
}

Expand Down Expand Up @@ -664,7 +664,7 @@ fetch_next_key_provider(int fd, off_t* curr_pos, KeyringProvideRecord *provider)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("key provider info file is corrupted: %m"),
errdetail("invalid key provider record size %ld expected %lu", bytes_read, sizeof(KeyringProvideRecord) )));
errdetail("invalid key provider record size %lld expected %lu", bytes_read, sizeof(KeyringProvideRecord) )));
}
return true;
}
1 change: 1 addition & 0 deletions src/catalog/tde_principal_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static void shared_memory_shutdown(int code, Datum arg);
static void principal_key_startup_cleanup(int tde_tbl_count, XLogExtensionInstall *ext_info, bool redo, void *arg);
static void clear_principal_key_cache(Oid databaseId) ;
static inline dshash_table *get_principal_key_Hash(void);
static TDEPrincipalKey *get_principal_key_from_keyring(Oid dbOid, Oid spcOid);
static TDEPrincipalKey *get_principal_key_from_cache(Oid dbOid);
static void push_principal_key_to_cache(TDEPrincipalKey *principalKey);
static Datum pg_tde_get_key_info(PG_FUNCTION_ARGS, Oid dbOid, Oid spcOid);
Expand Down
2 changes: 1 addition & 1 deletion src/keyring/keyring_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ get_key_by_name(GenericKeyring* keyring, const char* key_name, bool throw_error,
(errcode_for_file_access(),
errmsg("keyring file \"%s\" is corrupted: %m",
file_keyring->file_name),
errdetail("invalid key size %lu expected %lu", bytes_read, sizeof(keyInfo))));
errdetail("invalid key size %llu expected %lu", bytes_read, sizeof(keyInfo))));
return NULL;
}
if (strncasecmp(key->name.name, key_name, sizeof(key->name.name)) == 0)
Expand Down

0 comments on commit 38f6e5c

Please sign in to comment.