@@ -253,7 +253,7 @@ pg_tde_create_wal_key(InternalKey *rel_key_data, const RelFileLocator *newrlocat
253
253
void
254
254
pg_tde_delete_tde_files (Oid dbOid )
255
255
{
256
- char db_map_path [MAXPGPATH ] = { 0 } ;
256
+ char db_map_path [MAXPGPATH ];
257
257
258
258
pg_tde_set_db_file_path (dbOid , db_map_path );
259
259
@@ -266,7 +266,7 @@ pg_tde_save_principal_key_redo(const TDESignedPrincipalKeyInfo *signed_key_info)
266
266
{
267
267
int map_fd ;
268
268
off_t curr_pos ;
269
- char db_map_path [MAXPGPATH ] = { 0 } ;
269
+ char db_map_path [MAXPGPATH ];
270
270
271
271
pg_tde_set_db_file_path (signed_key_info -> data .databaseId , db_map_path );
272
272
@@ -289,9 +289,9 @@ pg_tde_save_principal_key_redo(const TDESignedPrincipalKeyInfo *signed_key_info)
289
289
void
290
290
pg_tde_save_principal_key (const TDEPrincipalKey * principal_key , bool write_xlog )
291
291
{
292
- int map_fd = -1 ;
292
+ int map_fd ;
293
293
off_t curr_pos = 0 ;
294
- char db_map_path [MAXPGPATH ] = { 0 } ;
294
+ char db_map_path [MAXPGPATH ];
295
295
TDESignedPrincipalKeyInfo signed_key_Info ;
296
296
297
297
pg_tde_set_db_file_path (principal_key -> keyInfo .databaseId , db_map_path );
@@ -419,8 +419,8 @@ pg_tde_write_one_map_entry(int fd, const TDEMapEntry *map_entry, off_t *offset,
419
419
void
420
420
pg_tde_write_key_map_entry (const RelFileLocator * rlocator , InternalKey * rel_key_data , TDEPrincipalKey * principal_key , bool write_xlog )
421
421
{
422
- char db_map_path [MAXPGPATH ] = { 0 } ;
423
- int map_fd = -1 ;
422
+ char db_map_path [MAXPGPATH ];
423
+ int map_fd ;
424
424
off_t curr_pos = 0 ;
425
425
off_t prev_pos = 0 ;
426
426
TDEMapEntry write_map_entry ;
@@ -487,8 +487,8 @@ pg_tde_write_key_map_entry(const RelFileLocator *rlocator, InternalKey *rel_key_
487
487
void
488
488
pg_tde_write_key_map_entry_redo (const TDEMapEntry * write_map_entry , TDESignedPrincipalKeyInfo * signed_key_info )
489
489
{
490
- char db_map_path [MAXPGPATH ] = { 0 } ;
491
- int map_fd = -1 ;
490
+ char db_map_path [MAXPGPATH ];
491
+ int map_fd ;
492
492
off_t curr_pos = 0 ;
493
493
off_t prev_pos = 0 ;
494
494
@@ -701,10 +701,10 @@ void
701
701
pg_tde_write_map_keydata_file (off_t file_size , char * file_data )
702
702
{
703
703
TDEFileHeader * fheader ;
704
+ char db_map_path [MAXPGPATH ];
704
705
char path_new [MAXPGPATH ];
705
706
int fd_new ;
706
707
off_t curr_pos = 0 ;
707
- char db_map_path [MAXPGPATH ] = {0 };
708
708
bool is_err = false;
709
709
710
710
/* Let's get the header. Buff should start with the map file header. */
746
746
pg_tde_wal_last_key_set_lsn (XLogRecPtr lsn , const char * keyfile_path )
747
747
{
748
748
LWLock * lock_pk = tde_lwlock_enc_keys ();
749
- int fd = -1 ;
749
+ int fd ;
750
750
off_t read_pos ,
751
751
write_pos ,
752
752
last_key_idx ;
@@ -848,7 +848,7 @@ pg_tde_get_key_from_file(const RelFileLocator *rlocator, uint32 key_type)
848
848
TDEMapEntry map_entry ;
849
849
TDEPrincipalKey * principal_key ;
850
850
LWLock * lock_pk = tde_lwlock_enc_keys ();
851
- char db_map_path [MAXPGPATH ] = { 0 } ;
851
+ char db_map_path [MAXPGPATH ];
852
852
InternalKey * rel_key ;
853
853
854
854
Assert (rlocator );
@@ -1059,7 +1059,7 @@ pg_tde_read_one_map_entry2(int fd, int32 key_index, TDEMapEntry *map_entry, Oid
1059
1059
/* Read the encrypted key */
1060
1060
if (pg_pread (fd , map_entry , MAP_ENTRY_SIZE , read_pos ) != MAP_ENTRY_SIZE )
1061
1061
{
1062
- char db_map_path [MAXPGPATH ] = { 0 } ;
1062
+ char db_map_path [MAXPGPATH ];
1063
1063
1064
1064
pg_tde_set_db_file_path (databaseId , db_map_path );
1065
1065
ereport (FATAL ,
@@ -1076,11 +1076,11 @@ pg_tde_read_one_map_entry2(int fd, int32 key_index, TDEMapEntry *map_entry, Oid
1076
1076
TDESignedPrincipalKeyInfo *
1077
1077
pg_tde_get_principal_key_info (Oid dbOid )
1078
1078
{
1079
- int fd = -1 ;
1079
+ char db_map_path [MAXPGPATH ];
1080
+ int fd ;
1080
1081
TDEFileHeader fheader ;
1081
1082
TDESignedPrincipalKeyInfo * signed_key_info = NULL ;
1082
1083
off_t bytes_read = 0 ;
1083
- char db_map_path [MAXPGPATH ] = {0 };
1084
1084
1085
1085
pg_tde_set_db_file_path (dbOid , db_map_path );
1086
1086
@@ -1198,12 +1198,12 @@ InternalKey *
1198
1198
pg_tde_read_last_wal_key (void )
1199
1199
{
1200
1200
RelFileLocator rlocator = GLOBAL_SPACE_RLOCATOR (XLOG_TDE_OID );
1201
- char db_map_path [MAXPGPATH ] = { 0 } ;
1201
+ char db_map_path [MAXPGPATH ];
1202
1202
off_t read_pos = 0 ;
1203
1203
LWLock * lock_pk = tde_lwlock_enc_keys ();
1204
1204
TDEPrincipalKey * principal_key ;
1205
- int fd = -1 ;
1206
- int file_idx = 0 ;
1205
+ int fd ;
1206
+ int file_idx ;
1207
1207
TDEMapEntry map_entry ;
1208
1208
InternalKey * rel_key_data ;
1209
1209
off_t fsize ;
@@ -1242,11 +1242,11 @@ WALKeyCacheRec *
1242
1242
pg_tde_fetch_wal_keys (XLogRecPtr start_lsn )
1243
1243
{
1244
1244
RelFileLocator rlocator = GLOBAL_SPACE_RLOCATOR (XLOG_TDE_OID );
1245
- char db_map_path [MAXPGPATH ] = { 0 } ;
1245
+ char db_map_path [MAXPGPATH ];
1246
1246
off_t read_pos = 0 ;
1247
1247
LWLock * lock_pk = tde_lwlock_enc_keys ();
1248
1248
TDEPrincipalKey * principal_key ;
1249
- int fd = -1 ;
1249
+ int fd ;
1250
1250
int keys_count ;
1251
1251
WALKeyCacheRec * return_wal_rec = NULL ;
1252
1252
0 commit comments