Skip to content

Commit

Permalink
Fix compile errors detected by gcc 12 (#503)
Browse files Browse the repository at this point in the history
* Check the string value, not the array itself
* Use global namespace to eliminate ambiguity
* Ignore assert condition.

Reviewed-by: Zhang Mingli [email protected]
  • Loading branch information
gfphoenix78 authored Jul 8, 2024
1 parent 4a0af58 commit 7670f82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/backend/gpopt/gpdbwrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ gpdb::ParseExternalTableUri(const char *uri)
{
GP_WRAP_START;
{
return ParseExternalTableUri(uri);
return ::ParseExternalTableUri(uri);
}
GP_WRAP_END;
return nullptr;
Expand Down
6 changes: 6 additions & 0 deletions src/backend/gpopt/translate/CTranslatorQueryToDXL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4211,10 +4211,16 @@ CTranslatorQueryToDXL::CreateDXLProjectNullsForGroupingSets(

INT sort_group_ref = INT(target_entry->ressortgroupref);

#if 0
// FIXME: The following assert is wrong for its semantics that may
// call a member function on a null pointer.
// The assert expression is highly relative to the if condition below.
// We should figure out what the assert state really is and add it back.
GPOS_ASSERT_IMP(
nullptr == sort_grouping_col_mapping,
nullptr != sort_grouping_col_mapping->Find(&sort_group_ref) &&
"Grouping column with no mapping");
#endif

if (0 < sort_group_ref && 0 < colid &&
nullptr == sort_grouping_col_mapping->Find(&sort_group_ref))
Expand Down
2 changes: 1 addition & 1 deletion src/backend/postmaster/loginmonitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ LoginMonitorWorkerMain(int argc, char *argv[]) {
SetConfigOption("synchronous_commit", "local",
PGC_SUSET, PGC_S_OVERRIDE);

if (LoginMonitorShmem->curr_user_name) {
if (LoginMonitorShmem->curr_user_name[0] != '\0') {
InitPostgres(DB_FOR_COMMON_ACCESS, InvalidOid, NULL, InvalidOid, NULL, false);
SetProcessingMode(NormalProcessing);
set_ps_display(LoginMonitorShmem->curr_user_name);
Expand Down

0 comments on commit 7670f82

Please sign in to comment.