Skip to content

Commit 7670f82

Browse files
authored
Fix compile errors detected by gcc 12 (#503)
* Check the string value, not the array itself * Use global namespace to eliminate ambiguity * Ignore assert condition. Reviewed-by: Zhang Mingli [email protected]
1 parent 4a0af58 commit 7670f82

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/backend/gpopt/gpdbwrappers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2168,7 +2168,7 @@ gpdb::ParseExternalTableUri(const char *uri)
21682168
{
21692169
GP_WRAP_START;
21702170
{
2171-
return ParseExternalTableUri(uri);
2171+
return ::ParseExternalTableUri(uri);
21722172
}
21732173
GP_WRAP_END;
21742174
return nullptr;

src/backend/gpopt/translate/CTranslatorQueryToDXL.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4211,10 +4211,16 @@ CTranslatorQueryToDXL::CreateDXLProjectNullsForGroupingSets(
42114211

42124212
INT sort_group_ref = INT(target_entry->ressortgroupref);
42134213

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

42194225
if (0 < sort_group_ref && 0 < colid &&
42204226
nullptr == sort_grouping_col_mapping->Find(&sort_group_ref))

src/backend/postmaster/loginmonitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ LoginMonitorWorkerMain(int argc, char *argv[]) {
572572
SetConfigOption("synchronous_commit", "local",
573573
PGC_SUSET, PGC_S_OVERRIDE);
574574

575-
if (LoginMonitorShmem->curr_user_name) {
575+
if (LoginMonitorShmem->curr_user_name[0] != '\0') {
576576
InitPostgres(DB_FOR_COMMON_ACCESS, InvalidOid, NULL, InvalidOid, NULL, false);
577577
SetProcessingMode(NormalProcessing);
578578
set_ps_display(LoginMonitorShmem->curr_user_name);

0 commit comments

Comments
 (0)