Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CBRD-25028] Disable heap_chnguess_realloc() function, which is inaccessible from heap_Guesschn #5688

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions src/storage/heap_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ static int heap_scancache_end_internal (THREAD_ENTRY * thread_p, HEAP_SCANCACHE
#if defined (ENABLE_UNUSED_FUNCTION)
static SCAN_CODE heap_get_if_diff_chn (THREAD_ENTRY * thread_p, PAGE_PTR pgptr, INT16 slotid, RECDES * recdes,
bool ispeeking, int chn, MVCC_SNAPSHOT * mvcc_snapshot);
#endif /* ENABLE_UNUSED_FUNCTION */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어떤 #if 매크로와 쌍인지 쉽게 인지하기 위해서 #endif /* */ 형식을 권장합니다. 따라서, 제거하지 말아주세요. 또한 추가하신 %if ~ #endif의 #endif에도 적용해 주세요.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

적용했습니다.

#endif
static int heap_estimate_avg_length (THREAD_ENTRY * thread_p, const HFID * hfid, int &avg_reclen);
static int heap_get_capacity (THREAD_ENTRY * thread_p, const HFID * hfid, INT64 * num_recs, INT64 * num_recs_relocated,
INT64 * num_recs_inovf, INT64 * num_pages, int *avg_freespace, int *avg_freespace_nolast,
Expand Down Expand Up @@ -721,7 +721,9 @@ static int heap_chkreloc_print_notfound (const void *ignore_reloc_oid, void *ent
static DISK_ISVALID heap_chkreloc_next (THREAD_ENTRY * thread_p, HEAP_CHKALL_RELOCOIDS * chk, PAGE_PTR pgptr);

static int heap_chnguess_initialize (void);
#if defined(ENABLE_UNUSED_FUNCTION)
static int heap_chnguess_realloc (void);
#endif
static int heap_chnguess_finalize (void);
static int heap_chnguess_decache (const OID * oid);
static int heap_chnguess_remove_entry (const void *oid_key, void *ent, void *xignore);
Expand All @@ -739,7 +741,7 @@ static int heap_stats_del_bestspace_by_vpid (THREAD_ENTRY * thread_p, VPID * vpi
static int heap_stats_del_bestspace_by_hfid (THREAD_ENTRY * thread_p, const HFID * hfid);
#if defined (ENABLE_UNUSED_FUNCTION)
static HEAP_BESTSPACE heap_stats_get_bestspace_by_vpid (THREAD_ENTRY * thread_p, VPID * vpid);
#endif /* #if defined (ENABLE_UNUSED_FUNCTION) */
#endif
static HEAP_STATS_ENTRY *heap_stats_add_bestspace (THREAD_ENTRY * thread_p, const HFID * hfid, VPID * vpid,
int freespace);
static int heap_stats_entry_free (THREAD_ENTRY * thread_p, void *data, void *args);
Expand Down Expand Up @@ -15214,6 +15216,7 @@ heap_chnguess_initialize (void)
return (ret == NO_ERROR) ? ER_FAILED : ret;
}

#if defined(ENABLE_UNUSED_FUNCTION)
/*
* heap_chnguess_realloc () - More clients that currently maintained
* return: NO_ERROR
Expand Down Expand Up @@ -15295,6 +15298,7 @@ heap_chnguess_realloc (void)

return (ret == NO_ERROR && (ret = er_errid ()) == NO_ERROR) ? ER_FAILED : ret;
}
#endif /* ENABLE_UNUSED_FUNCTION */

/*
* heap_chnguess_finalize () - Finish chnguess information
Expand Down Expand Up @@ -15574,14 +15578,7 @@ heap_chnguess_get (THREAD_ENTRY * thread_p, const OID * oid, int tran_index)

if (heap_Guesschn != NULL)
{
if (heap_Guesschn->num_clients <= tran_index)
{
if (heap_chnguess_realloc () != NO_ERROR)
{
csect_exit (thread_p, CSECT_HEAP_CHNGUESS);
return NULL_CHN;
}
}
assert (heap_Guesschn->num_clients > tran_index);

/*
* Do we have this entry in hash table, if we do then check corresponding
Expand Down Expand Up @@ -15629,14 +15626,7 @@ heap_chnguess_put (THREAD_ENTRY * thread_p, const OID * oid, int tran_index, int
return NULL_CHN;
}

if (heap_Guesschn->num_clients <= tran_index)
{
if (heap_chnguess_realloc () != NO_ERROR)
{
csect_exit (thread_p, CSECT_HEAP_CHNGUESS);
return NULL_CHN;
}
}
assert (heap_Guesschn->num_clients > tran_index);

/*
* Is the entry already in the chnguess hash table ?
Expand Down
Loading