消除编译时逻辑比较符的括号警告

This commit is contained in:
vastdata-xyzr
2023-10-10 09:33:56 +08:00
parent 10c3fa75b8
commit 1cd2e60c99
3 changed files with 4 additions and 4 deletions

View File

@ -1367,7 +1367,7 @@ HeapTuple ScanPgRelation(Oid targetRelId, bool indexOK, bool force_non_historic)
* relfilenode of non mapped system relations during decoding.
*/
snapshot = SnapshotNow;
if (HistoricSnapshotActive() && !force_non_historic || IS_EXRTO_RECOVERY_IN_PROGRESS) {
if ((HistoricSnapshotActive() && !force_non_historic) || IS_EXRTO_RECOVERY_IN_PROGRESS) {
snapshot = GetCatalogSnapshot();
}

View File

@ -790,7 +790,7 @@ void check_encoding_locale_matches(int encoding, const char* collate, const char
#ifdef WIN32
encoding == PG_UTF8 ||
#endif
(encoding == PG_SQL_ASCII && superuser() ||
((encoding == PG_SQL_ASCII && superuser()) ||
(encoding == PG_GB18030_2022 && ctype_encoding == PG_GB18030))))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@ -802,7 +802,7 @@ void check_encoding_locale_matches(int encoding, const char* collate, const char
#ifdef WIN32
encoding == PG_UTF8 ||
#endif
(encoding == PG_SQL_ASCII && superuser() ||
((encoding == PG_SQL_ASCII && superuser()) ||
(encoding == PG_GB18030_2022 && collate_encoding == PG_GB18030))))
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

View File

@ -1299,7 +1299,7 @@ bool PortalRun(
}
/* PortalRun using unique_sql_start_time as unique sql elapse start time */
if (IsNeedUpdateUniqueSQLStat(portal) && IS_UNIQUE_SQL_TRACK_TOP && IsTopUniqueSQL()
if ((IsNeedUpdateUniqueSQLStat(portal) && IS_UNIQUE_SQL_TRACK_TOP && IsTopUniqueSQL())
|| IS_UNIQUE_SQL_TRACK_ALL) {
instr_unique_sql_report_elapse_time(u_sess->unique_sql_cxt.unique_sql_start_time);
}