Skip to content

Commit

Permalink
Fix gcc13 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pashkinelfe committed Dec 9, 2024
1 parent 6377d11 commit 6588347
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 32 deletions.
6 changes: 3 additions & 3 deletions src/catalog/free_extents.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ FileExtent
get_extent(BTreeDescr *desc, uint16 len)
{
BTreeMetaPage *metaPage = BTREE_GET_META(desc);
BTreeLeafTuphdr *header;
BTreeLeafTuphdr *header = NULL;
FreeTreeTuple tup,
deleted_tup,
*cur_tup;
*cur_tup = NULL;
FileExtent result;
OBTreeFindPageContext context;
Page p;
Page p = NULL;
bool old_enable_stopevents;
bool found = false,
end = false,
Expand Down
16 changes: 5 additions & 11 deletions src/catalog/indices.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,7 @@ o_define_index(Relation heap, Relation index, Oid indoid, bool reindex,
}
reindex = ix_num != InvalidIndexNumber &&
ix_num < o_table->nindices;
}

if (reindex)
{
o_index_drop(heap, ix_num);

if (ix_type == oIndexPrimary)
Expand All @@ -461,9 +458,10 @@ o_define_index(Relation heap, Relation index, Oid indoid, bool reindex,
o_table = old_o_table;
reindex = false;
}
is_build = true;
table_index = &o_table->indices[ix_num];
}

if (!reindex)
else
{
ORelOids primary_oids;

Expand Down Expand Up @@ -515,11 +513,6 @@ o_define_index(Relation heap, Relation index, Oid indoid, bool reindex,
else
table_index->compress = o_table->default_compress;
}
else
{
is_build = true;
table_index = &o_table->indices[ix_num];
}
}
else
{
Expand Down Expand Up @@ -639,7 +632,7 @@ o_define_index(Relation heap, Relation index, Oid indoid, bool reindex,
static void
_o_index_begin_parallel(oIdxBuildState *buildstate, bool isconcurrent, int request)
{
ParallelContext *pcxt;
ParallelContext *pcxt = NULL;
int scantuplesortstates;
Size estbtshared;
Size estsort = 0;
Expand Down Expand Up @@ -809,6 +802,7 @@ _o_index_begin_parallel(oIdxBuildState *buildstate, bool isconcurrent, int reque

if (!in_recovery)
{
Assert(pcxt);
shm_toc_insert(pcxt->toc, PARALLEL_KEY_BTREE_SHARED, btshared);

/*
Expand Down
30 changes: 19 additions & 11 deletions src/checkpoint/checkpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,17 +475,19 @@ perform_writeback_and_relock(BTreeDescr *desc,
ORelOids treeOids = desc->oids;
OIndexType type = desc->type;
OIndexDescr *indexDescr;
Jsonb *params;

if (!IS_SYS_TREE_OIDS(treeOids))
{
/* Unlock tree: give a chance for concurrent deletion */
o_tables_rel_unlock_extended(&treeOids, AccessShareLock, true);

if (STOPEVENTS_ENABLED())
params = prepare_checkpoint_step_params(desc, state,
{
Jsonb *params = prepare_checkpoint_step_params(desc, state,
message, level);
STOPEVENT(STOPEVENT_CHECKPOINT_WRITEBACK, params);

STOPEVENT(STOPEVENT_CHECKPOINT_WRITEBACK, params);
}

perform_writeback(desc, writeback);

Expand Down Expand Up @@ -3170,7 +3172,6 @@ checkpoint_btree_loop(BTreeDescr **descrPtr,
OInMemoryBlkno blkno = descr->rootInfo.rootPageBlkno;
uint32 page_chage_count = InvalidOPageChangeCount;
uint blcksz = OCompressIsValid(descr->compress) ? ORIOLEDB_COMP_BLCKSZ : ORIOLEDB_BLCKSZ;
Jsonb *params;
uint32 chkpNum = checkpoint_state->lastCheckpointNumber + 1;

memset(&message, 0, sizeof(WalkMessage));
Expand Down Expand Up @@ -3205,9 +3206,11 @@ checkpoint_btree_loop(BTreeDescr **descrPtr,
MemoryContextReset(tmp_context);

if (STOPEVENTS_ENABLED())
params = prepare_checkpoint_step_params(descr, state,
{
Jsonb *params = prepare_checkpoint_step_params(descr, state,
&message, level);
STOPEVENT(STOPEVENT_CHECKPOINT_STEP, params);
STOPEVENT(STOPEVENT_CHECKPOINT_STEP, params);
}

if (message.action == WalkDownwards &&
level >= 4 &&
Expand Down Expand Up @@ -4620,7 +4623,6 @@ checkpoint_tables_callback(OIndexType type, ORelOids treeOids,
uint32 chkpNum = (checkpoint_state->lastCheckpointNumber + 1);
int cur_chkp_index = chkpNum % 2;
MemoryContext prev_context;
Jsonb *params;

prev_context = MemoryContextSwitchTo(chkp_mem_context);

Expand All @@ -4632,8 +4634,11 @@ checkpoint_tables_callback(OIndexType type, ORelOids treeOids,
}

if (STOPEVENTS_ENABLED())
params = prepare_checkpoint_table_start_params(tableOids, treeOids);
STOPEVENT(STOPEVENT_CHECKPOINT_TABLE_START, params);
{
Jsonb *params = prepare_checkpoint_table_start_params(tableOids, treeOids);

STOPEVENT(STOPEVENT_CHECKPOINT_TABLE_START, params);
}

descr = o_fetch_index_descr(treeOids, type, true, NULL);
if (descr != NULL && o_btree_load_shmem_checkpoint(&descr->desc))
Expand All @@ -4659,8 +4664,11 @@ checkpoint_tables_callback(OIndexType type, ORelOids treeOids,
LWLockRelease(&checkpoint_state->oTablesMetaLock);

if (STOPEVENTS_ENABLED())
params = prepare_checkpoint_tree_start_params(td);
STOPEVENT(STOPEVENT_CHECKPOINT_INDEX_START, params);
{
Jsonb *params = prepare_checkpoint_tree_start_params(td);

STOPEVENT(STOPEVENT_CHECKPOINT_INDEX_START, params);
}

checkpoint_ix_init_state(checkpoint_state, td);
checkpoint_init_new_seq_bufs(td, chkpNum);
Expand Down
10 changes: 5 additions & 5 deletions src/transam/undo.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ update_min_undo_locations(UndoLogType undoType,
minRetainLocation,
minTransactionRetainLocation,
lastUsedLocation;
UndoLocation oldCleanedLocation,
oldCheckpointStartLocation,
oldCheckpointEndLocation,
newCheckpointStartLocation,
newCheckpointEndLocation;
UndoLocation oldCleanedLocation = InvalidUndoLocation,
oldCheckpointStartLocation = InvalidUndoLocation,
oldCheckpointEndLocation = InvalidUndoLocation,
newCheckpointStartLocation = InvalidUndoLocation,
newCheckpointEndLocation = InvalidUndoLocation;
int i;
UndoMeta *meta = get_undo_meta_by_type(undoType);

Expand Down
4 changes: 2 additions & 2 deletions src/tuple/slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1593,8 +1593,8 @@ tts_orioledb_update_toast_values(TupleTableSlot *oldSlot,
for (i = 0; i < descr->ntoastable; i++)
{
int toast_attn;
Datum oldValue,
newValue;
Datum oldValue = 0,
newValue = 0;
bool newToast = false,
oldToast = false;
bool insertNew = false;
Expand Down

0 comments on commit 6588347

Please sign in to comment.