1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Replace std::set contains method with count

to support Rocky/RHEL/Alma 8 where the std::set
in the stock STL does not have contains method
This commit is contained in:
Leonid Fedorov
2023-06-08 22:54:16 +00:00
committed by Gagan Goel
parent f5822b5ed3
commit 3bd0ef4e43
2 changed files with 2 additions and 15 deletions

View File

@ -62,19 +62,6 @@ ELSE()
ENDIF() ENDIF()
ENDIF() ENDIF()
CHECK_CXX_SOURCE_COMPILES(
"#include <set>
int main()
{
std::set<int> s = {1, 2, 3, 4};
return s.contains(2);
}" HAVE_STD_SET_CONTAINS)
IF (NOT HAVE_STD_SET_CONTAINS)
MESSAGE_ONCE(CS_NO_CONTAINS "std::set does not have contains() method")
RETURN()
ENDIF()
# There is an inconsistency b/w default char signedness at ARM and x86. # There is an inconsistency b/w default char signedness at ARM and x86.
# This flag explicitly sets char as signed. # This flag explicitly sets char as signed.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")

View File

@ -59,12 +59,12 @@ SimpleFilter* castToSimpleFilter(execplan::TreeNode* node)
bool commonContainsSemantic(const CommonContainer& common, execplan::ParseTree* node) bool commonContainsSemantic(const CommonContainer& common, execplan::ParseTree* node)
{ {
auto filter = castToFilter(node); auto filter = castToFilter(node);
return filter && common.first.contains(node); return filter && common.first.count(node) != 0;
} }
bool commonContainsPtr(const CommonContainer& common, execplan::ParseTree* node) bool commonContainsPtr(const CommonContainer& common, execplan::ParseTree* node)
{ {
return common.second.contains(node); return common.second.count(node) != 0;
} }
OpType operatorType(execplan::ParseTree* node) OpType operatorType(execplan::ParseTree* node)