Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat[WIP]: JIT compiled SQL expressions #2891

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
764 changes: 606 additions & 158 deletions .drone.jsonnet

Large diffs are not rendered by default.

150 changes: 114 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
if (CMAKE_VERSION VERSION_LESS 3.13.0)
MESSAGE_ONCE(CS_CMAKE "ColumnStore needs cmake >= 3.13")
RETURN()
ENDIF()

CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)

PROJECT(Columnstore)
INCLUDE (CheckCXXSourceCompiles)

FOREACH(p CMP0135)
IF(POLICY ${p})
CMAKE_POLICY(SET ${p} NEW)
ENDIF()
ENDFOREACH()

IF(NOT INSTALL_LAYOUT)
IF(NOT CMAKE_BUILD_TYPE)
Expand All @@ -26,11 +37,36 @@ if(SERVER_BUILD_DIR)
set(CMAKE_BUILD_TYPE ${SERVER_CMAKE_BUILD_TYPE} CACHE STRING "Build configuration type" FORCE)
endif()

SET_PROPERTY(DIRECTORY PROPERTY EP_BASE ${CMAKE_CURRENT_BINARY_DIR}/external)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

INCLUDE(check_compiler_flag)
INCLUDE(ExternalProject)
INCLUDE(CheckCXXSourceCompiles)

SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED TRUE)
FIND_PACKAGE(Boost 1.81.0 COMPONENTS chrono filesystem program_options regex system thread)

IF (NOT Boost_FOUND OR Boost_VERSION VERSION_GREATER 1.76.99)
MY_CHECK_CXX_COMPILER_FLAG("-std=c++20")
ENDIF()

IF (have_CXX__std_c__20)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++20")
ELSE()
MY_CHECK_CXX_COMPILER_FLAG("-std=c++2a")
IF (have_CXX__std_c__2a)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a")
ELSE()
MESSAGE_ONCE(CS_NO_CXX20 "C++ Compiler does not understand -std=c++20")
return()
ENDIF()
ENDIF()

# There is an inconsistency b/w default char signedness at ARM and x86.
# This flag explicitly sets char as signed.
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")

UNSET(CMAKE_CXX_STANDARD)
SET(CMAKE_CXX_EXTENSIONS FALSE)
SET(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
Expand Down Expand Up @@ -89,26 +125,38 @@ ELSE ()
ENDIF ()
ENDIF ()

SET_PROPERTY(DIRECTORY PROPERTY EP_BASE ${CMAKE_CURRENT_BINARY_DIR}/external)
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)

SET (ENGINE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})

INCLUDE(columnstore_version)
INCLUDE(misc)

FIND_PACKAGE(Boost 1.53.0 COMPONENTS system filesystem thread regex date_time chrono atomic)
IF (NOT Boost_FOUND)
MESSAGE_ONCE(CS_NO_BOOST "Required Boost libraries not found!")
return()
ENDIF()
INCLUDE(boost)
INCLUDE(thrift)
INCLUDE(arrow)

FIND_PACKAGE(BISON)
IF (NOT BISON_FOUND)
MESSAGE_ONCE(CS_NO_BISON "bison not found!")
return()
ENDIF()


FIND_PACKAGE(LLVM REQUIRED CONFIG PATHS "/usr/lib/llvm-16" "/usr/lib64/llvm14/" "/usr/lib/llvm-12")
if (NOT LLVM_FOUND)
MESSAGE_ONCE(CS_NO_LLVM "Could not find a usable llvm development environment!")
return()
endif()

MESSAGE(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
MESSAGE(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
MESSAGE(STATUS "Using LLVM include dir: ${LLVM_INCLUDE_DIRS}")

separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})

# Find the libraries that correspond to the LLVM components
# that we wish to use
llvm_map_components_to_libnames(LLVM_LIBS support core irreader mcjit native orcjit)

check_cxx_source_compiles("#include <filesystem>\n void main(){}" HAS_STD_FILESYSTEM)
check_cxx_source_compiles("#include <experimental/filesystem>\n void main(){}" HAS_STD_EXPERIMENTAL_FILESYSTEM)

Expand Down Expand Up @@ -150,14 +198,6 @@ if (NOT CURL_FOUND)
return()
endif()

IF (WITH_UNITTESTS OR WITH_GTEST)
INCLUDE (FindGTest)
IF (NOT GTEST_FOUND)
MESSAGE(FATAL_ERROR "GSuite libs not found but are requested. Please install them or build.")
ENDIF()
SET (GTEST_LIBRARIES ${GTEST_LIBRARY} ${GTESTMAIN_LIBRARY} ${PTHREAD_LIBRARY})
ENDIF()

FIND_PROGRAM(AWK_EXECUTABLE awk DOC "path to the awk executable")
if(NOT AWK_EXECUTABLE)
MESSAGE_ONCE(CS_NO_AWK "awk not found!")
Expand All @@ -169,24 +209,23 @@ IF (WITH_COLUMNSTORE_LZ4 STREQUAL "ON" OR WITH_COLUMNSTORE_LZ4 STREQUAL "AUTO")
FIND_PACKAGE(LZ4)
IF (NOT LZ4_FOUND)
IF (WITH_COLUMNSTORE_LZ4 STREQUAL "AUTO")
MESSAGE_ONCE(STATUS "LZ4 not found, building without LZ4")
MESSAGE_ONCE(CS_LZ4 "LZ4 not found, building without LZ4")
ELSE()
MESSAGE_ONCE(FATAL_ERROR "LZ4 not found.")
MESSAGE(FATAL_ERROR "LZ4 not found.")
ENDIF()
ELSE()
MESSAGE_ONCE(STATUS "Building with LZ4")
MESSAGE_ONCE(CS_LZ4 "Building with LZ4")
SET(HAVE_LZ4 1 CACHE INTERNAL "")
ENDIF()
ELSE()
MESSAGE_ONCE(STATUS "Building without LZ4")
MESSAGE_ONCE(CS_LZ4 "Building without LZ4")
ENDIF()

IF (NOT INSTALL_LAYOUT)
INCLUDE(check_compiler_flag)

MY_CHECK_AND_SET_COMPILER_FLAG("-g -O3 -fno-omit-frame-pointer -fno-strict-aliasing -Wall -fno-tree-vectorize -D_GLIBCXX_ASSERTIONS -DDBUG_OFF -DHAVE_CONFIG_H" RELEASE RELWITHDEBINFO MINSIZEREL)
MY_CHECK_AND_SET_COMPILER_FLAG("-ggdb3 -fno-omit-frame-pointer -fno-tree-vectorize -D_GLIBCXX_ASSERTIONS -DSAFE_MUTEX -DSAFEMALLOC -DENABLED_DEBUG_SYNC -O0 -Wall -D_DEBUG -DHAVE_CONFIG_H" DEBUG)
MY_CHECK_AND_SET_COMPILER_FLAG("-msse4.2" RELEASE RELWITHDEBINFO MINSIZEREL DEBUG)
MY_CHECK_AND_SET_COMPILER_FLAG("-DBOOST_BIND_GLOBAL_PLACEHOLDERS" RELEASE RELWITHDEBINFO MINSIZEREL DEBUG)

# enable security hardening features, like most distributions do
# in our benchmarks that costs about ~1% of performance, depending on the load
Expand All @@ -197,7 +236,7 @@ IF (NOT INSTALL_LAYOUT)
ENDIF()
OPTION(SECURITY_HARDENED "Use security-enhancing compiler features (stack protector, relro, etc)" ${security_default})
OPTION(SECURITY_HARDENED_NEW "Use new security-enhancing compilier features" OFF)
IF(SECURITY_HARDENED)
IF(SECURITY_HARDENED AND NOT WITH_ASAN AND NOT WITH_UBSAN AND NOT WITH_TSAN AND NOT WITH_GPROF)
# security-enhancing flags
MY_CHECK_AND_SET_COMPILER_FLAG("-pie -fPIC")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wl,-z,relro,-z,now")
Expand All @@ -223,14 +262,37 @@ IF (MASK_LONGDOUBLE)
MY_CHECK_AND_SET_COMPILER_FLAG("-DMASK_LONGDOUBLE")
ENDIF()

SET (CMAKE_REQUIRED_FLAGS "-Werror -Wall")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated-enum-enum-conversion -Wno-register -Wno-typedef-redefinition")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-register")
endif()

IF (WITH_COLUMNSTORE_ASAN)
MY_CHECK_AND_SET_COMPILER_FLAG("-U_FORTIFY_SOURCE" DEBUG RELWITHDEBINFO)
MY_CHECK_AND_SET_COMPILER_FLAG("-fsanitize=address -fsanitize-address-use-after-scope -fPIC")
ENDIF()

MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated-copy" DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-deprecated-declarations" DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
MY_CHECK_AND_SET_COMPILER_FLAG("-Werror -Wall -Wextra")
SET (ENGINE_LDFLAGS "-Wl,--no-as-needed -Wl,--add-needed")
SET (ENGINE_DT_LIB datatypes)
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt libmysql_client ${ENGINE_DT_LIB})
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot boost_thread xml2 pthread rt ${ENGINE_DT_LIB})
SET (ENGINE_OAM_LIBS oamcpp)
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_WRITE_LIBS ddlpackageproc ddlpackage dmlpackageproc dmlpackage writeengine writeengineclient idbdatafile cacheutils ${ENGINE_EXEC_LIBS})
SET (PLUGIN_EXEC_LIBS execplan windowfunction joiner rowgroup funcexp udfsdk regr dataconvert common compress querytele threadpool ${ENGINE_BRM_LIBS} jit)
SET (ENGINE_EXEC_LIBS joblist querystats libmysql_client ${PLUGIN_EXEC_LIBS})
SET (PLUGIN_WRITE_LIBS ddlpackageproc ddlpackage dmlpackageproc dmlpackage writeengine writeengineclient idbdatafile cacheutils)
SET (ENGINE_WRITE_LIBS ${PLUGIN_WRITE_LIBS} ${ENGINE_EXEC_LIBS})

IF (NOT INSTALL_LAYOUT)
SET (LIBMARIADB_BININC_DIR ${SERVER_BUILD_DIR}/libmariadb/include)
SET (LIBMARIADB_SRCINC_DIR ${SERVER_SOURCE_ROOT_DIR}/libmariadb/include)
ELSE()
SET (LIBMARIADB_BININC_DIR ${CMAKE_BINARY_DIR}/libmariadb/include)
SET (LIBMARIADB_SRCINC_DIR ${CMAKE_SOURCE_DIR}/libmariadb/include)
ENDIF()

SET (ENGINE_COMMON_LDFLAGS "")

Expand Down Expand Up @@ -270,7 +332,7 @@ ENDIF()
IF (INSTALL_LAYOUT)
SET (MARIADB_STRING_LIBS dbug strings mysys)
ELSE()
SET (MARIADB_STRING_LIBS -L${SERVER_BUILD_INCLUDE_DIR}/../strings/ libstrings.a -L${SERVER_BUILD_INCLUDE_DIR}/../mysys/ libmysys.a -L${SERVER_BUILD_INCLUDE_DIR}/../dbug/ libdbug.a)
SET (MARIADB_STRING_LIBS -L${SERVER_BUILD_INCLUDE_DIR}/../mysys/ libmysys.a -L${SERVER_BUILD_INCLUDE_DIR}/../strings/ libstrings.a -L${SERVER_BUILD_INCLUDE_DIR}/../dbug/ libdbug.a)
ENDIF()

#SET (ENGINE_UTILS_BOOSTIDB_INCLUDE "{CMAKE_CURRENT_SOURCE_DIR}/utils/boost_idb")
Expand Down Expand Up @@ -301,17 +363,17 @@ SET (ENGINE_DBCON_DMLPKGPROC_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/dbcon/dmlpack
SET (ENGINE_UTILS_CACHEUTILS_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/cacheutils")
SET (ENGINE_UTILS_MYSQLCL_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/mysqlcl_idb")
SET (ENGINE_UTILS_QUERYTELE_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/querytele")
SET (ENGINE_UTILS_THRIFT_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/thrift")
SET (ENGINE_UTILS_JOINER_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/joiner")
SET (ENGINE_UTILS_THREADPOOL_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/threadpool")
SET (ENGINE_UTILS_BATCHLDR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/batchloader")
SET (ENGINE_UTILS_DDLCLEANUP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/ddlcleanup")
SET (ENGINE_UTILS_QUERYSTATS_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/querystats")
SET (ENGINE_UTILS_LIBMYSQL_CL_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/libmysql_client")
SET (ENGINE_UTILS_JIT_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/jit")
SET (ENGINE_WE_CONFIGCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/writeengine/xml")
SET (ENGINE_DATATYPES_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/datatypes")
SET (ENGINE_BLOCKCACHE_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/primitives/blockcache")
SET (ENGINE_PRIMPROC_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/primitives/primproc")
SET (ENGINE_PRIMPROC_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/primitives/primproc")
SET (ENGINE_SERVER_SQL_INCLUDE "${SERVER_SOURCE_ROOT_DIR}/sql")
SET (ENGINE_SERVER_INCLUDE_INCLUDE "${SERVER_SOURCE_ROOT_DIR}/include")
IF (PCRE_INCLUDES)
Expand All @@ -325,13 +387,30 @@ SET (ENGINE_UTILS_UDFSDK_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/udfsdk"

SET (ENGINE_DEFAULT_INCLUDES ${CMAKE_CURRENT_BINARY_DIR} "." "../" "../../" ${SERVER_BUILD_INCLUDE_DIR})

SET (ENGINE_COMMON_INCLUDES ${ENGINE_DEFAULT_INCLUDES} ${Boost_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} ${ENGINE_UTILS_MESSAGEQCPP_INCLUDE} ${ENGINE_WE_SHARED_INCLUDE} ${ENGINE_UTILS_IDBDATAFILE_INCLUDE} ${ENGINE_UTILS_LOGGINGCPP_INCLUDE} ${ENGINE_UTILS_CONFIGCPP_INCLUDE} ${ENGINE_UTILS_COMPRESS_INCLUDE} ${ENGINE_VERSIONING_BRM_INCLUDE} ${ENGINE_UTILS_ROWGROUP_INCLUDE} ${ENGINE_UTILS_COMMON_INCLUDE} ${ENGINE_UTILS_DATACONVERT_INCLUDE} ${ENGINE_UTILS_RWLOCK_INCLUDE} ${ENGINE_UTILS_FUNCEXP_INCLUDE} ${ENGINE_OAMAPPS_ALARMMANAGER_INCLUDE} ${ENGINE_UTILS_INCLUDE} ${ENGINE_OAM_OAMCPP_INCLUDE} ${ENGINE_DBCON_DDLPKGPROC_INCLUDE} ${ENGINE_DBCON_DDLPKG_INCLUDE} ${ENGINE_DBCON_EXECPLAN_INCLUDE} ${ENGINE_UTILS_STARTUP_INCLUDE} ${ENGINE_DBCON_JOBLIST_INCLUDE} ${ENGINE_WE_WRAPPER_INCLUDE} ${ENGINE_WE_SERVER_INCLUDE} ${ENGINE_DBCON_DMLPKG_INCLUDE} ${ENGINE_WE_CLIENT_INCLUDE} ${ENGINE_DBCON_DMLPKGPROC_INCLUDE} ${ENGINE_UTILS_CACHEUTILS_INCLUDE} ${ENGINE_UTILS_MYSQLCL_INCLUDE} ${ENGINE_UTILS_QUERYTELE_INCLUDE} ${ENGINE_UTILS_THRIFT_INCLUDE} ${ENGINE_UTILS_JOINER_INCLUDE} ${ENGINE_UTILS_THREADPOOL_INCLUDE} ${ENGINE_UTILS_BATCHLDR_INCLUDE} ${ENGINE_UTILS_DDLCLEANUP_INCLUDE} ${ENGINE_UTILS_QUERYSTATS_INCLUDE} ${ENGINE_WE_CONFIGCPP_INCLUDE} ${ENGINE_SERVER_SQL_INCLUDE} ${ENGINE_SERVER_INCLUDE_INCLUDE} ${ENGINE_SERVER_PCRE_INCLUDE} ${ENGINE_SERVER_WSREP_API_INCLUDE} ${ENGINE_SERVER_WSREP_INCLUDE} ${ENGINE_UTILS_UDFSDK_INCLUDE} ${ENGINE_UTILS_LIBMYSQL_CL_INCLUDE} ${ENGINE_DATATYPES_INCLUDE})
SET (ENGINE_COMMON_INCLUDES ${ENGINE_DEFAULT_INCLUDES} ${Boost_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR}
${ENGINE_UTILS_MESSAGEQCPP_INCLUDE} ${ENGINE_WE_SHARED_INCLUDE} ${ENGINE_UTILS_IDBDATAFILE_INCLUDE}
${ENGINE_UTILS_LOGGINGCPP_INCLUDE} ${ENGINE_UTILS_CONFIGCPP_INCLUDE} ${ENGINE_UTILS_COMPRESS_INCLUDE}
${ENGINE_VERSIONING_BRM_INCLUDE} ${ENGINE_UTILS_ROWGROUP_INCLUDE} ${ENGINE_UTILS_COMMON_INCLUDE}
${ENGINE_UTILS_DATACONVERT_INCLUDE} ${ENGINE_UTILS_RWLOCK_INCLUDE} ${ENGINE_UTILS_FUNCEXP_INCLUDE}
${ENGINE_OAMAPPS_ALARMMANAGER_INCLUDE} ${ENGINE_UTILS_INCLUDE} ${ENGINE_OAM_OAMCPP_INCLUDE}
${ENGINE_DBCON_DDLPKGPROC_INCLUDE} ${ENGINE_DBCON_DDLPKG_INCLUDE} ${ENGINE_DBCON_EXECPLAN_INCLUDE}
${ENGINE_UTILS_STARTUP_INCLUDE} ${ENGINE_DBCON_JOBLIST_INCLUDE} ${ENGINE_WE_WRAPPER_INCLUDE}
${ENGINE_WE_SERVER_INCLUDE} ${ENGINE_DBCON_DMLPKG_INCLUDE} ${ENGINE_WE_CLIENT_INCLUDE}
${ENGINE_DBCON_DMLPKGPROC_INCLUDE} ${ENGINE_UTILS_CACHEUTILS_INCLUDE} ${ENGINE_UTILS_MYSQLCL_INCLUDE}
${ENGINE_UTILS_QUERYTELE_INCLUDE} ${ENGINE_UTILS_THRIFT_INCLUDE} ${ENGINE_UTILS_JOINER_INCLUDE}
${ENGINE_UTILS_THREADPOOL_INCLUDE} ${ENGINE_UTILS_BATCHLDR_INCLUDE} ${ENGINE_UTILS_DDLCLEANUP_INCLUDE}
${ENGINE_UTILS_QUERYSTATS_INCLUDE} ${ENGINE_WE_CONFIGCPP_INCLUDE} ${ENGINE_SERVER_SQL_INCLUDE}
${ENGINE_SERVER_INCLUDE_INCLUDE} ${ENGINE_SERVER_PCRE_INCLUDE} ${ENGINE_SERVER_WSREP_API_INCLUDE}
${ENGINE_SERVER_WSREP_INCLUDE} ${ENGINE_UTILS_UDFSDK_INCLUDE} ${ENGINE_UTILS_LIBMYSQL_CL_INCLUDE}
${ENGINE_DATATYPES_INCLUDE} ${LLVM_INCLUDE_DIRS} ${ENGINE_UTILS_JIT_INCLUDE})

ADD_SUBDIRECTORY(dbcon/mysql)
IF(NOT TARGET columnstore)
RETURN()
ENDIF()

SET (SHMEM_FILE_GLOB "MCS-shm-")

ADD_SUBDIRECTORY(utils)
ADD_SUBDIRECTORY(oam/oamcpp)
ADD_SUBDIRECTORY(dbcon/execplan)
Expand All @@ -346,7 +425,6 @@ ADD_SUBDIRECTORY(dbcon/ddlpackage)
ADD_SUBDIRECTORY(dbcon/ddlpackageproc)
ADD_SUBDIRECTORY(dbcon/dmlpackage)
ADD_SUBDIRECTORY(dbcon/dmlpackageproc)
ADD_SUBDIRECTORY(exemgr)
ADD_SUBDIRECTORY(ddlproc)
ADD_SUBDIRECTORY(dmlproc)
ADD_SUBDIRECTORY(oamapps)
Expand Down
20 changes: 12 additions & 8 deletions cmake/cpackEngineRPM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ It is GPL v2 licensed, which means you can use the it free of charge under the
conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).

MariaDB documentation can be found at https://mariadb.com/kb
MariaDB bug reports should be submitted through https://jira.mariadb.org
MariaDB bug reports should be submitted through https://jira.mariadb.org

")

Expand All @@ -71,21 +71,25 @@ IF (EXISTS "/etc/redhat-release")
string(REGEX MATCH "release ([0-9]+)" CENTOS "${REDHAT_VERSION}")
set(REDHAT_VERSION_NUMBER "${CMAKE_MATCH_1}")
ENDIF ()

IF (EXISTS "/etc/SuSE-release")
file (READ "/etc/SuSE-release" SUSE_VERSION)
string(REGEX MATCH "VERSION = ([0-9]+)" SUSE "${SUSE_VERSION}")
set(SUSE_VERSION_NUMBER "${CMAKE_MATCH_1}")
ENDIF ()
if (${REDHAT_VERSION_NUMBER} EQUAL 6)
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "MariaDB-columnstore-shared" "snappy" "net-tools" "MariaDB-server" "python3")
# Disable auto require as this will also try to pull Boost via RPM
SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
elseif (${SUSE_VERSION_NUMBER} EQUAL 12)
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost-devel >= 1.54.0" "libsnappy1" "net-tools" "MariaDB-server" "python3" "jemalloc")


if (${REDHAT_VERSION_NUMBER} EQUAL 7)
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES
"snappy" "net-tools" "MariaDB-server" "python3" "jemalloc" "procps-ng" "llvm14")
else ()
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "net-tools" "MariaDB-server" "python3" "jemalloc")
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES
"snappy" "net-tools" "MariaDB-server" "python3" "jemalloc" "procps-ng" "llvm")
endif()


SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "snappy" "net-tools" "MariaDB-server" "python3" "jemalloc" "procps-ng" "llvm")

SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_storage_engine.sh)
SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh)
SET(CPACK_RPM_columnstore-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preUn_storage_engine.sh)
Expand Down
3 changes: 2 additions & 1 deletion datatypes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
include_directories( ${ENGINE_COMMON_INCLUDES} )
set(datatypes_LIB_SRCS
mcs_int128.cpp
mcs_decimal.cpp)
mcs_decimal.cpp
mcs_systemcatalog.cpp)

add_library(datatypes SHARED ${datatypes_LIB_SRCS})

Expand Down
10 changes: 9 additions & 1 deletion datatypes/mcs_data_condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifndef MCS_DATA_CONDITION_H
#define MCS_DATA_CONDITION_H

#include <cstdint>
namespace datatypes
{
/*
Expand All @@ -30,6 +31,8 @@ namespace datatypes
class DataCondition
{
public:
using ErrorType = uint32_t;

enum Code
{
// Code Value SQLSTATE
Expand Down Expand Up @@ -58,8 +61,13 @@ class DataCondition
{
return mError;
}
// WIP refactor this casting ErrorType to Code and calling a ctor on it instead.
static bool isOutOfRange(const ErrorType error)
{
return Code::X_NUMERIC_VALUE_OUT_OF_RANGE & error;
}

// Adjust a sigened integer of any size to the range [-absMaxVal , +absMaxVal]
// Adjust a signed integer of any size to the range [-absMaxVal , +absMaxVal]
template <typename T>
void adjustSIntXRange(T& val, T absMaxVal)
{
Expand Down
Loading