1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +03:00

Merge branch 'develop-1.1' into develop-1.2-merge-up-20190214

This commit is contained in:
Andrew Hutchings
2019-02-14 15:55:15 +00:00
6 changed files with 92 additions and 17 deletions

View File

@@ -112,6 +112,17 @@ if (NOT SNAPPY_FOUND)
MESSAGE(FATAL_ERROR "Snappy not found please install snappy-devel for CentOS/RedHat or libsnappy-dev for Ubuntu/Debian") MESSAGE(FATAL_ERROR "Snappy not found please install snappy-devel for CentOS/RedHat or libsnappy-dev for Ubuntu/Debian")
endif() endif()
# Jemalloc has issues with SLES 12, so disable for now
IF (EXISTS "/etc/SuSE-release")
SET(JEMALLOC_LIBRARIES "")
ELSE ()
INCLUDE (FindJeMalloc.cmake)
if (NOT JEMALLOC_FOUND)
message(FATAL_ERROR "jemalloc not found!")
SET(JEMALLOC_LIBRARIES "")
endif()
ENDIF ()
FIND_PROGRAM(AWK_EXECUTABLE awk DOC "path to the awk executable") FIND_PROGRAM(AWK_EXECUTABLE awk DOC "path to the awk executable")
if(NOT AWK_EXECUTABLE) if(NOT AWK_EXECUTABLE)
message(FATAL_ERROR "awk not found!") message(FATAL_ERROR "awk not found!")
@@ -163,7 +174,7 @@ SET (ENGINE_LOCALDIR "${INSTALL_ENGINE}/local")
SET (ENGINE_MYSQLDIR "${INSTALL_ENGINE}/mysql") SET (ENGINE_MYSQLDIR "${INSTALL_ENGINE}/mysql")
SET (ENGINE_TOOLSDIR "${INSTALL_ENGINE}/tools") SET (ENGINE_TOOLSDIR "${INSTALL_ENGINE}/tools")
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client) SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client ${JEMALLOC_LIBRARIES})
SET (ENGINE_OAM_LIBS oamcpp alarmmanager) SET (ENGINE_OAM_LIBS oamcpp alarmmanager)
SET (ENGINE_BRM_LIBS brm idbdatafile cacheutils rwlock ${ENGINE_OAM_LIBS} ${ENGINE_COMMON_LIBS}) SET (ENGINE_BRM_LIBS brm idbdatafile cacheutils rwlock ${ENGINE_OAM_LIBS} ${ENGINE_COMMON_LIBS})
SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk regr dataconvert common compress querystats querytele thrift threadpool ${ENGINE_BRM_LIBS}) SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk regr dataconvert common compress querystats querytele thrift threadpool ${ENGINE_BRM_LIBS})

44
FindJeMalloc.cmake Normal file
View File

@@ -0,0 +1,44 @@
# - Try to find jemalloc headers and libraries.
#
# Usage of this module as follows:
#
# find_package(JeMalloc)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# JEMALLOC_ROOT_DIR Set this variable to the root installation of
# jemalloc if the module has problems finding
# the proper installation path.
#
# Variables defined by this module:
#
# JEMALLOC_FOUND System has jemalloc libs/headers
# JEMALLOC_LIBRARIES The jemalloc library/libraries
# JEMALLOC_INCLUDE_DIR The location of jemalloc headers
find_path(JEMALLOC_ROOT_DIR
NAMES include/jemalloc/jemalloc.h
)
find_library(JEMALLOC_LIBRARIES
NAMES jemalloc
HINTS ${JEMALLOC_ROOT_DIR}/lib
)
find_path(JEMALLOC_INCLUDE_DIR
NAMES jemalloc/jemalloc.h
HINTS ${JEMALLOC_ROOT_DIR}/include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
JEMALLOC_LIBRARIES
JEMALLOC_INCLUDE_DIR
)
mark_as_advanced(
JEMALLOC_ROOT_DIR
JEMALLOC_LIBRARIES
JEMALLOC_INCLUDE_DIR
)

View File

@@ -65,11 +65,11 @@ if (EXISTS "/etc/debian_version")
set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}") set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}")
endif () endif ()
if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8") if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1") SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1, libjemalloc1")
elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9") elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9")
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5") SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, mariadb-columnstore-libs, mariadb-columnstore-server, libsnappy1v5, libreadline5, libjemalloc1")
else() else()
SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools") SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "expect, perl, openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1")
endif () endif ()
SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DEPENDS "mariadb-columnstore-libs") SET(CPACK_DEBIAN_STORAGE-ENGINE_PACKAGE_DEPENDS "mariadb-columnstore-libs")

View File

@@ -91,9 +91,9 @@ if (${REDHAT_VERSION_NUMBER} EQUAL 6)
# Disable auto require as this will also try to pull Boost via RPM # Disable auto require as this will also try to pull Boost via RPM
SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no") SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
elseif (${SUSE_VERSION_NUMBER} EQUAL 12) elseif (${SUSE_VERSION_NUMBER} EQUAL 12)
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost-devel >= 1.54.0" "mariadb-columnstore-libs" "libsnappy1") SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost-devel >= 1.54.0" "mariadb-columnstore-libs" "libsnappy1" "jemalloc")
else () else ()
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "mariadb-columnstore-libs" "snappy") SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "mariadb-columnstore-libs" "snappy" "jemalloc")
endif() endif()
SETA(CPACK_RPM_storage-engine_PACKAGE_REQUIRES "mariadb-columnstore-libs") SETA(CPACK_RPM_storage-engine_PACKAGE_REQUIRES "mariadb-columnstore-libs")

View File

@@ -759,8 +759,11 @@ int processCommand(string* arguments)
vector<uint32_t> srcDbroots; // all of the currently configured dbroots vector<uint32_t> srcDbroots; // all of the currently configured dbroots
vector<uint32_t> destDbroots; // srcDbroots - removeDbroots vector<uint32_t> destDbroots; // srcDbroots - removeDbroots
set<int>::iterator dbiter; set<int>::iterator dbiter;
#if _MSC_VER
if (arguments[1] == "start") if (_strnicmp(arguments[1].c_str(), "start", 5) == 0))
#else
if (strncasecmp(arguments[1].c_str(), "start", 5) == 0)
#endif
{ {
// Get a list of all the configured dbroots in the xml file. // Get a list of all the configured dbroots in the xml file.
DBRootConfigList dbRootConfigList; DBRootConfigList dbRootConfigList;
@@ -772,7 +775,11 @@ int processCommand(string* arguments)
// The user may choose to redistribute in such a way as to // The user may choose to redistribute in such a way as to
// leave certain dbroots empty, presumably for later removal. // leave certain dbroots empty, presumably for later removal.
if (arguments[2] == "remove") #if _MSC_VER
if (_strnicmp(arguments[1].c_str(), "remove", 6) == 0))
#else
if (strncasecmp(arguments[1].c_str(), "remove", 6) == 0)
#endif
{ {
int dbroot; int dbroot;
bool error = false; bool error = false;
@@ -891,7 +898,11 @@ int processCommand(string* arguments)
SendToWES(oam, bs); SendToWES(oam, bs);
} }
else if (arguments[1] == "stop") #if _MSC_VER
if (_strnicmp(arguments[1].c_str(), "stop", 4) == 0))
#else
if (strncasecmp(arguments[1].c_str(), "stop", 4) == 0)
#endif
{ {
ByteStream bs; ByteStream bs;
// message WES ID, sequence #, action id // message WES ID, sequence #, action id
@@ -901,7 +912,11 @@ int processCommand(string* arguments)
bs.append((const ByteStream::byte*) &header, sizeof(header)); bs.append((const ByteStream::byte*) &header, sizeof(header));
SendToWES(oam, bs); SendToWES(oam, bs);
} }
else if (arguments[1] == "status") #if _MSC_VER
if (_strnicmp(arguments[1].c_str(), "status", 6) == 0))
#else
if (strncasecmp(arguments[1].c_str(), "status", 6) == 0)
#endif
{ {
ByteStream bs; ByteStream bs;
// message WES ID, sequence #, action id // message WES ID, sequence #, action id

View File

@@ -194,15 +194,20 @@ long long Convertor::convertDecimalString(
// range check against int64 // range check against int64
if (dval > LLONG_MAX || dval < LLONG_MIN) if (dval > LLONG_MAX)
{
errno = ERANGE; errno = ERANGE;
return LLONG_MAX;
}
if (dval < LLONG_MIN)
{
errno = ERANGE;
return LLONG_MIN;
}
errno = 0;
else
errno = 0;
ret = dval; ret = dval;
// get the fractional part of what's left & round ret up or down. // get the fractional part of what's left & round ret up or down.
dval -= ret; dval -= ret;
if (dval >= 0.5 && ret < LLONG_MAX) if (dval >= 0.5 && ret < LLONG_MAX)