diff --git a/.drone.jsonnet b/.drone.jsonnet index f0bcd028b..eeaadca72 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,13 +1,11 @@ local platforms = { develop: ['opensuse/leap:15', 'centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'], - proper_python: ['opensuse/leap:15', 'centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'], 'develop-1.4': ['centos:7', 'centos:8', 'debian:9', 'debian:10', 'ubuntu:16.04', 'ubuntu:18.04', 'ubuntu:20.04'], }; local codebase_map = { - // "develop": "git clone --recurse-submodules --branch mariadb-10.5.3 --depth 1 https://github.com/MariaDB/server .", - proper_python: 'git clone --recurse-submodules --branch drrtuy-10.5-cs --depth 1 https://github.com/MariaDB/server .', - develop: 'git clone --recurse-submodules --branch bb-10.5-cs --depth 1 https://github.com/MariaDB/server .', + // "develop": "git clone --recurse-submodules --branch mariadb-10.5.4 --depth 1 https://github.com/MariaDB/server .", + develop: 'git clone --recurse-submodules --branch bb-10.5-release --depth 1 https://github.com/MariaDB/server .', 'develop-1.4': 'git clone --recurse-submodules --branch 10.4-enterprise --depth 1 https://github.com/mariadb-corporation/MariaDBEnterprise .', }; @@ -21,7 +19,6 @@ local deb_build_deps = 'apt update && apt install --yes --no-install-recommends local platformMap(branch, platform) = local branch_cmakeflags_map = { develop: ' -DBUILD_CONFIG=mysql_release -DWITH_WSREP=OFF', - proper_python: ' -DBUILD_CONFIG=mysql_release -DWITH_WSREP=OFF', 'develop-1.4': ' -DBUILD_CONFIG=enterprise', }; @@ -39,36 +36,89 @@ local platformMap(branch, platform) = platform_map[platform]; local Pipeline(branch, platform, event) = { + local pkg_format = if (std.split(platform, ':')[0] == 'centos' || std.split(platform, ':')[0] == 'opensuse/leap') then 'rpm' else 'deb', + local init = if (pkg_format == 'rpm') then '/usr/lib/systemd/systemd' else 'systemd', + local img = if (std.split(platform, ':')[0] == 'centos') then platform else 'romcheck/' + std.strReplace(platform, '/', '-'), + local pipeline = self, _volumes:: { mdb: { name: 'mdb', path: '/mdb', }, + docker: { + name: 'docker', + path: '/var/run/docker.sock', + }, }, - tests:: { - name: 'tests', - image: platform, + smoke:: { + name: 'smoke', + image: 'docker', + volumes: [pipeline._volumes.docker], commands: [ - (if platform == 'centos:7' then 'yum install -y sysvinit-tools' else ''), - (if platform == 'centos:8' then 'yum install -y diffutils' else ''), - 'yum install -y lz4 wget git rsyslog', - "sed -i '/OmitLocalLogging/d' /etc/rsyslog.conf", - "sed -i 's/off/on/' /etc/rsyslog.conf", - 'rm -f /etc/rsyslog.d/listen.conf', - 'rsyslogd', - 'yum install -y result/*.rpm', - 'kill $(pidof rsyslogd) && while pidof rsyslogd; do sleep 2; done', - 'rsyslogd', - 'bash -o pipefail ./build/columnstore_startup.sh', - 'git clone --recurse-submodules --branch ' + branch + ' --depth 1 https://github.com/mariadb-corporation/mariadb-columnstore-regression-test', - 'wget -qO- https://cspkg.s3.amazonaws.com/testData.tar.lz4 | lz4 -dc - | tar xf - -C mariadb-columnstore-regression-test/', - 'cd mariadb-columnstore-regression-test/mysql/queries/nightly/alltest', - './go.sh --sm_unit_test_dir=/drone/src/storage-manager' + (if event == 'pull_request' then ' --tests=test000.sh' else ''), - 'cat go.log', - 'test -f testErrorLogs.tgz && mv testErrorLogs.tgz /drone/src/result/ || echo no-errors-archive', + 'docker run -e DEBIAN_FRONTEND=noninteractive -e MCS_USE_S3_STORAGE=0 --name smoke --privileged --detach --volume /sys/fs/cgroup:/sys/fs/cgroup:ro ' + img + ' ' + init + ' --unit=basic.target', + 'docker cp /drone/src/result smoke:/', + if (std.split(platform, ':')[0] == 'centos') then 'docker exec -t smoke bash -c "yum install -y git which rsyslog hostname && yum install -y /result/*.' + pkg_format + '"' else '', + if (std.split(platform, ':')[0] == 'debian' || std.split(platform, ':')[0] == 'ubuntu') then 'docker exec -t smoke bash -c "apt update && apt install -y git rsyslog hostname && apt install -y -f /result/*.' + pkg_format + '"' else '', + if (std.split(platform, '/')[0] == 'opensuse') then 'docker exec -t smoke bash -c "zypper install -y git which hostname rsyslog && zypper install -y --allow-unsigned-rpm /result/*.' + pkg_format + '"' else '', + // "docker exec -t smoke sed -i '/\\[mariadb\\]/a plugin_maturity=stable' /etc/" + (if pkg_format == 'deb' then 'mysql/mariadb.conf.d/50-' else 'my.cnf.d/') + 'server.cnf', + 'docker exec -t smoke systemctl start mariadb', + 'docker exec -t smoke systemctl start mariadb-columnstore', + 'docker exec -t smoke mysql -e "create database if not exists test; create table test.t1 (a int) engine=Columnstore; insert into test.t1 values (1); select * from test.t1"', + 'docker exec -t smoke systemctl restart mariadb', + 'docker exec -t smoke systemctl restart mariadb-columnstore', + 'sleep 5', + 'docker exec -t smoke mysql -e "insert into test.t1 values (2); select * from test.t1"', ], }, + regression:: { + name: 'regression', + image: 'docker:git', + // failure: 'ignore', + volumes: [pipeline._volumes.docker, pipeline._volumes.mdb], + commands: [ + 'docker run -e DEBIAN_FRONTEND=noninteractive -e MCS_USE_S3_STORAGE=0 --name regression --privileged --detach --volume /sys/fs/cgroup:/sys/fs/cgroup:ro ' + img + ' ' + init + ' --unit=basic.target', + 'docker cp /drone/src/result regression:/', + 'docker cp /mdb/' + builddir + '/storage/columnstore/columnstore/storage-manager regression:/', + if (std.split(platform, ':')[0] == 'centos') then 'docker exec -t regression bash -c "yum install -y diffutils tar lz4 wget git which rsyslog hostname && yum install -y /result/*.' + pkg_format + '"' else '', + if (std.split(platform, ':')[0] == 'debian' || std.split(platform, ':')[0] == 'ubuntu') then 'docker exec -t regression bash -c "apt update && apt install -y tar liblz4-tool wget git rsyslog hostname && apt install -y -f /result/*.' + pkg_format + '"' else '', + if (std.split(platform, '/')[0] == 'opensuse') then 'docker exec -t regression bash -c "zypper install -y gzip tar lz4 wget git which hostname rsyslog && zypper install -y --allow-unsigned-rpm /result/*.' + pkg_format + '"' else '', + 'docker exec -t regression systemctl start mariadb', + 'docker exec -t regression systemctl start mariadb-columnstore', + 'docker exec -t regression mysql -e "create database if not exists test; create table test.t1 (a int) engine=Columnstore; insert into test.t1 values (1); select * from test.t1"', + 'git clone --recurse-submodules --branch ' + branch + ' --depth 1 https://github.com/mariadb-corporation/mariadb-columnstore-regression-test', + 'docker cp mariadb-columnstore-regression-test regression:/', + 'docker exec -t regression bash -c "wget -qO- https://cspkg.s3.amazonaws.com/testData.tar.lz4 | lz4 -dc - | tar xf - -C mariadb-columnstore-regression-test/"', + // 'docker exec -t --workdir /mariadb-columnstore-regression-test/mysql/queries/nightly/alltest regression ./go.sh --sm_unit_test_dir=/storage-manager' + (if event == 'pull_request' then ' --tests=test000.sh,test001.sh' else ''), + 'docker exec -t --workdir /mariadb-columnstore-regression-test/mysql/queries/nightly/alltest regression ./go.sh --sm_unit_test_dir=/storage-manager' + (if event == 'pull_request' then ' --tests=test000.sh' else ''), + ], + }, + smokelog:: { + name: 'smokelog', + image: 'docker', + volumes: [pipeline._volumes.docker], + commands: [ + 'docker exec -t smoke journalctl -ru mariadb --no-pager || true', + 'docker exec -t smoke cat /var/log/mariadb/columnstore/debug.log || true', + 'docker stop smoke && docker rm smoke || true', + ], + when: { + status: ['success', 'failure'], + }, + }, + regressionlog: { + name: 'regressionlog', + image: 'docker', + volumes: [pipeline._volumes.docker], + commands: [ + 'docker exec -t --workdir /mariadb-columnstore-regression-test/mysql/queries/nightly/alltest regression cat go.log', + 'docker cp regression:/mariadb-columnstore-regression-test/mysql/queries/nightly/alltest/testErrorLogs.tgz /drone/src/result/ || true', + 'docker stop regression && docker rm regression || true', + ], + when: { + status: ['success', 'failure'], + }, + }, kind: 'pipeline', type: 'docker', name: std.join(' ', [branch, platform, event]), @@ -91,6 +141,7 @@ local Pipeline(branch, platform, event) = { commands: [ 'mkdir -p /mdb/' + builddir + ' && cd /mdb/' + builddir, codebase_map[branch], + 'git rev-parse HEAD', 'git config cmake.update-submodules no', 'rm -rf storage/columnstore/columnstore', 'cp -r /drone/src /mdb/' + builddir + '/storage/columnstore/columnstore', @@ -132,13 +183,17 @@ local Pipeline(branch, platform, event) = { 'echo "engine: $DRONE_COMMIT" > buildinfo.txt', 'echo "server: $$(git rev-parse HEAD)" >> buildinfo.txt', 'echo "buildNo: $DRONE_BUILD_NUMBER" >> buildinfo.txt', - 'cp ' + (if (std.split(platform, ':')[0] == 'centos' || std.split(platform, ':')[0] == 'opensuse/leap') then '*.rpm' else '../*.deb') + ' buildinfo.txt /drone/src/result/', + 'cp ' + (if pkg_format == 'deb' then '../' else '') + '*.' + pkg_format + ' buildinfo.txt /drone/src/result/', 'ls -l /drone/src/result', ], }, ] + - (if branch == 'develop-1.4' && std.split(platform, ':')[0] == 'centos' then [pipeline.tests] else []) + + (if branch == 'develop' then [pipeline.smoke] else []) + + (if branch == 'develop' then [pipeline.smokelog] else []) + + (if branch == 'develop' then [pipeline.regression] else []) + + (if branch == 'develop' then [pipeline.regressionlog] else []) + [ + { name: 'publish', image: 'plugins/s3', @@ -159,8 +214,7 @@ local Pipeline(branch, platform, event) = { }, }, ], - - volumes: [pipeline._volumes.mdb { temp: {} }], + volumes: [pipeline._volumes.mdb { temp: {} }, pipeline._volumes.docker { host: { path: '/var/run/docker.sock' } }], trigger: { event: [event], branch: [branch], @@ -200,11 +254,11 @@ local FinalPipeline(branch, event) = { [ Pipeline(b, p, e) - for b in ['develop', 'develop-1.4', 'proper_python'] + for b in ['develop', 'develop-1.4'] for p in platforms[b] for e in ['pull_request', 'cron', 'custom'] ] + [ FinalPipeline(b, e) - for b in ['develop', 'develop-1.4', 'proper_python'] + for b in ['develop', 'develop-1.4'] for e in ['pull_request', 'cron', 'custom'] ] diff --git a/.gitignore b/.gitignore index 8c48084c0..1c5439ce3 100644 --- a/.gitignore +++ b/.gitignore @@ -162,3 +162,5 @@ gitversionEngine mcsconfig.h storage-manager/testS3Connection storage-manager/unit_tests +.drone.yml +result/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f31249bd..42f0d2649 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,18 +95,6 @@ SET (ENGINE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE(columnstore_version) INCLUDE(misc) -OPTION(USE_CCACHE "reduce compile time with ccache." FALSE) -if(NOT USE_CCACHE) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "") - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "") -else() - find_program(CCACHE_FOUND ccache) - if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) - endif(CCACHE_FOUND) -endif() - 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!") @@ -313,8 +301,12 @@ ENDIF () 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}) -ADD_SUBDIRECTORY(utils) +ADD_SUBDIRECTORY(dbcon/mysql) +IF(NOT TARGET columnstore) + RETURN() +ENDIF() +ADD_SUBDIRECTORY(utils) ADD_SUBDIRECTORY(oam/oamcpp) ADD_SUBDIRECTORY(dbcon/execplan) ADD_SUBDIRECTORY(dbcon/joblist) @@ -328,7 +320,6 @@ ADD_SUBDIRECTORY(dbcon/ddlpackage) ADD_SUBDIRECTORY(dbcon/ddlpackageproc) ADD_SUBDIRECTORY(dbcon/dmlpackage) ADD_SUBDIRECTORY(dbcon/dmlpackageproc) -ADD_SUBDIRECTORY(dbcon/mysql) ADD_SUBDIRECTORY(exemgr) ADD_SUBDIRECTORY(ddlproc) ADD_SUBDIRECTORY(dmlproc) @@ -373,39 +364,6 @@ IF (INSTALL_LAYOUT) ADD_DEPENDENCIES(funcexp GenError) ADD_DEPENDENCIES(oamcpp GenError) ADD_DEPENDENCIES(regr_mysql GenError) - # Don't know why, but this doesn't work if you make the above line PARENT_SCOPE - SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE) - IF (RPM) - SET(ignored - "%ignore ${CMAKE_INSTALL_PREFIX}" - "%ignore ${CMAKE_INSTALL_PREFIX}/local" - "%ignore ${CMAKE_INSTALL_PREFIX}/bin" - "%ignore ${CMAKE_INSTALL_PREFIX}/lib" - "%ignore ${CMAKE_INSTALL_PREFIX}/sbin" - "%ignore ${CMAKE_INSTALL_PREFIX}/lib64/mysql" - "%ignore ${CMAKE_INSTALL_PREFIX}/lib64/mysql/plugin" - "%ignore /var/lib" - "%ignore /var" - ) - SET(CPACK_RPM_columnstore-engine_USER_FILELIST ${ignored} "%config(noreplace) ${INSTALL_SYSCONF2DIR}/*" PARENT_SCOPE) - - SET(SUSE_VERSION_NUMBER OFF) - 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 (${SUSE_VERSION_NUMBER} EQUAL 12) - SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "expect" "boost-devel >= 1.54.0" "snappy" "jemalloc" "net-tools MariaDB-server" PARENT_SCOPE) - else () - SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "snappy" "jemalloc" "net-tools MariaDB-server" PARENT_SCOPE) - endif() - - SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preInstall_storage_engine.sh PARENT_SCOPE) - SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/postInstall_storage_engine.sh PARENT_SCOPE) - SET(CPACK_RPM_columnstore-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/preUn_storage_engine.sh PARENT_SCOPE) - - ENDIF () ELSE () # MariaDB has its own packaging routines INCLUDE(cpackEngineRPM) diff --git a/cmake/cpackEngineDEB.cmake b/cmake/cpackEngineDEB.cmake index 4099392da..65fc8f5bb 100644 --- a/cmake/cpackEngineDEB.cmake +++ b/cmake/cpackEngineDEB.cmake @@ -56,11 +56,11 @@ if (EXISTS "/etc/debian_version") set(DEBIAN_VERSION_NUMBER "${CMAKE_MATCH_1}") endif () if ("${DEBIAN_VERSION_NUMBER}" EQUAL "8") - SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1, libjemalloc1") + SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1, libjemalloc1, MariaDB-server, python3") elseif ("${DEBIAN_VERSION_NUMBER}" EQUAL "9") - SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1v5, libreadline5, libjemalloc1") + SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libreadline-dev, rsync, net-tools, libboost-all-dev, libsnappy1v5, libreadline5, libjemalloc1, MariaDB-server, python3") else() - SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1") + SET(CPACK_DEBIAN_PLATFORM_PACKAGE_DEPENDS "openssl, file, libdbi-perl, libboost-all-dev, libreadline-dev, rsync, libsnappy1v5, net-tools, libjemalloc1, MariaDB-server, python3") endif () set(CPACK_DEBIAN_COLUMNSTORE-ENGINE_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/build/debian/storageEngine/postinst;${CMAKE_CURRENT_SOURCE_DIR}/build/debian/storageEngine/prerm;") diff --git a/cmake/cpackEngineRPM.cmake b/cmake/cpackEngineRPM.cmake index 913d9f584..f0ab9e114 100644 --- a/cmake/cpackEngineRPM.cmake +++ b/cmake/cpackEngineRPM.cmake @@ -77,13 +77,13 @@ IF (EXISTS "/etc/SuSE-release") 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") + 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" "jemalloc" "net-tools" "MariaDB-server") + SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost-devel >= 1.54.0" "libsnappy1" "jemalloc" "net-tools" "MariaDB-server" "python3") else () - SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "jemalloc" "net-tools" "MariaDB-server") + SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "jemalloc" "net-tools" "MariaDB-server" "python3") endif() SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_storage_engine.sh) diff --git a/dbcon/ddlpackageproc/ddlpackageprocessor.h b/dbcon/ddlpackageproc/ddlpackageprocessor.h index 121a69888..5714d5cd6 100644 --- a/dbcon/ddlpackageproc/ddlpackageprocessor.h +++ b/dbcon/ddlpackageproc/ddlpackageprocessor.h @@ -88,7 +88,7 @@ public: */ enum ResultCode { NO_ERROR, CREATE_ERROR, ALTER_ERROR, DROP_ERROR, TRUNC_ERROR, TOKENIZATION_ERROR, NOT_ACCEPTING_PACKAGES, PK_NOTNULL_ERROR, WARNING, USER_ERROR, NETWORK_ERROR, PARTITION_WARNING, - WARN_NO_PARTITION + WARN_NO_PARTITION, DROP_TABLE_NOT_IN_CATALOG_ERROR }; enum DebugLevel /** @brief Debug level type enumeration */ @@ -281,14 +281,14 @@ public: /** @brief Is it required to debug */ - const bool isDebug( const DebugLevel level ) const + bool isDebug( const DebugLevel level ) const { return level <= fDebugLevel; } /** @brief Get debug level */ - const DebugLevel getDebugLevel() const + DebugLevel getDebugLevel() const { return fDebugLevel; } diff --git a/dbcon/ddlpackageproc/droptableprocessor.cpp b/dbcon/ddlpackageproc/droptableprocessor.cpp index 2de7174a0..769bab407 100644 --- a/dbcon/ddlpackageproc/droptableprocessor.cpp +++ b/dbcon/ddlpackageproc/droptableprocessor.cpp @@ -151,12 +151,9 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage(ddlpackage::Dro { Message::Args args; Message message(1); - args.add("Table dropped with warning "); - args.add("Table does not exist in columnstore engine."); - args.add(""); - args.add(""); + args.add("Table does not exist in ColumnStore."); message.format(args); - result.result = WARNING; + result.result = DROP_TABLE_NOT_IN_CATALOG_ERROR; result.message = message; fSessionManager.rolledback(txnID); return result; diff --git a/dbcon/dmlpackage/calpontdmlpackage.h b/dbcon/dmlpackage/calpontdmlpackage.h index 839fb87b1..34f67c947 100644 --- a/dbcon/dmlpackage/calpontdmlpackage.h +++ b/dbcon/dmlpackage/calpontdmlpackage.h @@ -137,7 +137,7 @@ public: /** @brief get the logging flag */ - const bool get_Logging() const + bool get_Logging() const { return fLogging; } @@ -153,7 +153,7 @@ public: /** @brief get the logending flag */ - const bool get_Logending() const + bool get_Logending() const { return fLogending; } @@ -169,7 +169,7 @@ public: /** @brief get the isFromCol flag */ - const bool get_IsFromCol() const + bool get_IsFromCol() const { return fIsFromCol; } diff --git a/dbcon/dmlpackage/dmlcolumn.h b/dbcon/dmlpackage/dmlcolumn.h index c45d99f6e..ffed035ae 100644 --- a/dbcon/dmlpackage/dmlcolumn.h +++ b/dbcon/dmlpackage/dmlcolumn.h @@ -90,19 +90,19 @@ public: /** @brief get the data for the column */ - const bool get_isnull() const + bool get_isnull() const { return fisNULL; } /** @brief get the fIsFromCol data for the column */ - const bool get_isFromCol() const + bool get_isFromCol() const { return fIsFromCol; } /** @brief get the fFuncScale data for the column */ - const uint32_t get_funcScale() const + uint32_t get_funcScale() const { return fFuncScale; } diff --git a/dbcon/dmlpackage/vendordmlstatement.h b/dbcon/dmlpackage/vendordmlstatement.h index ae1202ebd..4b9dd4b71 100644 --- a/dbcon/dmlpackage/vendordmlstatement.h +++ b/dbcon/dmlpackage/vendordmlstatement.h @@ -197,7 +197,7 @@ public: } /** @brief get the logging flag */ - inline const bool get_Logging() const + inline bool get_Logging() const { return fLogging; } @@ -213,7 +213,7 @@ public: /** @brief get the logging flag */ - inline const bool get_Logending() const + inline bool get_Logending() const { return fLogending; } diff --git a/dbcon/dmlpackageproc/dmlpackageprocessor.h b/dbcon/dmlpackageproc/dmlpackageprocessor.h index 076183956..cc213c347 100644 --- a/dbcon/dmlpackageproc/dmlpackageprocessor.h +++ b/dbcon/dmlpackageproc/dmlpackageprocessor.h @@ -194,7 +194,7 @@ public: /** @brief Is it required to debug */ - inline const bool isDebug( const DebugLevel level ) const + inline bool isDebug( const DebugLevel level ) const { return level <= fDebugLevel; } @@ -202,7 +202,7 @@ public: /** * @brief Get debug level */ - inline const DebugLevel getDebugLevel() const + inline DebugLevel getDebugLevel() const { return fDebugLevel; } diff --git a/dbcon/execplan/aggregatecolumn.h b/dbcon/execplan/aggregatecolumn.h index 20b049dad..cea23c259 100644 --- a/dbcon/execplan/aggregatecolumn.h +++ b/dbcon/execplan/aggregatecolumn.h @@ -132,7 +132,7 @@ public: /** * accessor */ - virtual const uint8_t aggOp() const + virtual uint8_t aggOp() const { return fAggOp; } @@ -192,7 +192,7 @@ public: /** * ASC flag */ - inline virtual const bool asc() const + inline virtual bool asc() const { return fAsc; } @@ -214,6 +214,7 @@ public: /** * fData: SQL representation of this object */ + using ReturnedColumn::data; virtual void data(const std::string& data) { fData = data; @@ -245,6 +246,7 @@ public: * Do a deep, strict (as opposed to semantic) equivalence test. * @return true iff every member of t is a duplicate copy of every member of this; false otherwise */ + using ReturnedColumn::operator=; virtual bool operator==(const AggregateColumn& t) const; /** @brief Do a deep, strict (as opposed to semantic) equivalence test @@ -259,6 +261,7 @@ public: * Do a deep, strict (as opposed to semantic) equivalence test. * @return false iff every member of t is a duplicate copy of every member of this; true otherwise */ + using ReturnedColumn::operator!=; virtual bool operator!=(const AggregateColumn& t) const; /** @brief push back arg to group by column list*/ @@ -306,6 +309,7 @@ public: */ static AggOp agname2num(const std::string&); + using ReturnedColumn::hasAggregate; virtual bool hasAggregate(); virtual bool hasWindowFunc() { diff --git a/dbcon/execplan/arithmeticcolumn.h b/dbcon/execplan/arithmeticcolumn.h index 2dfed7349..5aeb6f435 100644 --- a/dbcon/execplan/arithmeticcolumn.h +++ b/dbcon/execplan/arithmeticcolumn.h @@ -87,7 +87,7 @@ public: /** * get asc flag */ - inline const bool asc() const + inline bool asc() const { return fAsc; } @@ -164,6 +164,7 @@ public: */ bool operator!=(const ArithmeticColumn& t) const; + using ReturnedColumn::hasAggregate; virtual bool hasAggregate(); virtual bool hasWindowFunc(); @@ -272,6 +273,7 @@ public: private: ParseTree* fExpression; + using TreeNode::evaluate; void evaluate(rowgroup::Row& row) {} }; diff --git a/dbcon/execplan/arithmeticoperator.h b/dbcon/execplan/arithmeticoperator.h index 7277ccd65..ddf0b7ead 100644 --- a/dbcon/execplan/arithmeticoperator.h +++ b/dbcon/execplan/arithmeticoperator.h @@ -106,38 +106,46 @@ public: /*********************************************************** * F&E framework * ***********************************************************/ + using Operator::evaluate; inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop); + using Operator::getStrVal; virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getStrVal(fTimeZone); } + using Operator::getIntVal; virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getIntVal(); } + using Operator::getUintVal; virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getUintVal(); } + using Operator::getFloatVal; virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getFloatVal(); } + using Operator::getDoubleVal; virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getDoubleVal(); } + using Operator::getLongDoubleVal; virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getLongDoubleVal(); } + using Operator::getDecimalVal; virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); @@ -156,26 +164,31 @@ public: return TreeNode::getDecimalVal(); } + using Operator::getDateIntVal; virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getDateIntVal(); } + using Operator::getDatetimeIntVal; virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getDatetimeIntVal(); } + using Operator::getTimestampIntVal; virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getTimestampIntVal(); } + using Operator::getTimeIntVal; virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); return TreeNode::getTimeIntVal(); } + using Operator::getBoolVal; virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { evaluate(row, isNull, lop, rop); diff --git a/dbcon/execplan/calpontselectexecutionplan.h b/dbcon/execplan/calpontselectexecutionplan.h index ecfa4aa4a..6f0faa645 100644 --- a/dbcon/execplan/calpontselectexecutionplan.h +++ b/dbcon/execplan/calpontselectexecutionplan.h @@ -525,7 +525,7 @@ public: { fDistinctUnionNum = distinctUnionNum; } - const uint8_t distinctUnionNum() const + uint8_t distinctUnionNum() const { return fDistinctUnionNum; } @@ -574,7 +574,7 @@ public: { fHasOrderBy = hasOrderBy; } - const bool hasOrderBy() const + bool hasOrderBy() const { return fHasOrderBy; } @@ -583,7 +583,7 @@ public: { fSpecHandlerProcessed = hand; } - const bool specHandlerProcessed() const + bool specHandlerProcessed() const { return fSpecHandlerProcessed; } diff --git a/dbcon/execplan/calpontsystemcatalog.cpp b/dbcon/execplan/calpontsystemcatalog.cpp index 610b0c221..c2bb50c6e 100644 --- a/dbcon/execplan/calpontsystemcatalog.cpp +++ b/dbcon/execplan/calpontsystemcatalog.cpp @@ -418,7 +418,7 @@ CalpontSystemCatalog::CatalogMap CalpontSystemCatalog::fCatalogMap; /*static*/ uint32_t CalpontSystemCatalog::fModuleID = numeric_limits::max(); -const CalpontSystemCatalog::OID CalpontSystemCatalog::lookupTableOID(const TableName& tablename) +CalpontSystemCatalog::OID CalpontSystemCatalog::lookupTableOID(const TableName& tablename) { TableName aTableName; aTableName.schema = tablename.schema; @@ -511,7 +511,7 @@ const CalpontSystemCatalog::OID CalpontSystemCatalog::lookupTableOID(const Table return (OID)0; } -const CalpontSystemCatalog::OID CalpontSystemCatalog::lookupOID(const TableColName& tableColName) +CalpontSystemCatalog::OID CalpontSystemCatalog::lookupOID(const TableColName& tableColName) { if (tableColName.schema.length() == 0 || tableColName.table.length() == 0 || tableColName.column.length() == 0) return -1; @@ -1583,7 +1583,7 @@ const CalpontSystemCatalog::TableColName CalpontSystemCatalog::dictColName(const return tableColName; } -const uint64_t CalpontSystemCatalog::nextAutoIncrValue ( TableName aTableName) +uint64_t CalpontSystemCatalog::nextAutoIncrValue ( TableName aTableName) { transform( aTableName.schema.begin(), aTableName.schema.end(), aTableName.schema.begin(), to_lower() ); transform( aTableName.table.begin(), aTableName.table.end(), aTableName.table.begin(), to_lower() ); @@ -2897,7 +2897,7 @@ const vector< pair > } /* SQL statement: select objectid from systable */ -const int CalpontSystemCatalog::getTableCount () +int CalpontSystemCatalog::getTableCount () { int tableCnt = 0; @@ -4020,7 +4020,7 @@ const CalpontSystemCatalog::ROPair CalpontSystemCatalog::indexRID(const IndexNam } #endif -const int CalpontSystemCatalog::colNumbers(const TableName& tableName) +int CalpontSystemCatalog::colNumbers(const TableName& tableName) { DEBUG << "Enter colNumbers: " << tableName.schema << "|" << tableName.table << endl; @@ -4891,7 +4891,7 @@ void CalpontSystemCatalog::updateColInfo(void) } #endif -const int CalpontSystemCatalog::colPosition (const OID& oid) +int CalpontSystemCatalog::colPosition (const OID& oid) { DEBUG << "Enter colPosition: " << oid << endl; ColType col = colType (oid); diff --git a/dbcon/execplan/calpontsystemcatalog.h b/dbcon/execplan/calpontsystemcatalog.h index 9f6892a5f..ae2fb05d2 100644 --- a/dbcon/execplan/calpontsystemcatalog.h +++ b/dbcon/execplan/calpontsystemcatalog.h @@ -550,13 +550,13 @@ public: * * For a unique table_name return the internal OID */ - const OID lookupTableOID(const TableName& tableName); + OID lookupTableOID(const TableName& tableName); /** looks up a column's OID in the System Catalog * * For a unique table_name.column_name return the internal OID */ - const OID lookupOID(const TableColName& tableColName); + OID lookupOID(const TableColName& tableColName); /** returns the column type attribute(s) for a column * @@ -588,7 +588,7 @@ public: * 0: Autoincrement does not exist for this table * Throws runtime_error if no such table found */ - const uint64_t nextAutoIncrValue ( TableName tableName); + uint64_t nextAutoIncrValue ( TableName tableName); /** returns the rid of next autoincrement value for the table oid * @@ -606,13 +606,13 @@ public: * * return the bitmap file object number for a given OID: */ - const OID colBitmap(const OID& oid) const; + OID colBitmap(const OID& oid) const; /** return the current SCN * * returns the current System Change Number (for versioning support) */ - const SCN scn(void) const; + SCN scn(void) const; /** return the RID's of the indexes for a table * @@ -624,7 +624,7 @@ public: * * returns the total number of columns for a table */ - const int colNumbers(const TableName& tableName); + int colNumbers(const TableName& tableName); /** return the RID's of the colindexes for a table * @@ -648,7 +648,7 @@ public: * * returns a RID of the constraint for a ConstrainName fron table SYSCONSTRAINT */ - const RID constraintRID(const std::string constraintName); + RID constraintRID(const std::string constraintName); /** return the list of IndexName for a given TableColName * @@ -666,7 +666,7 @@ public: * * returns the RID of the colconstraints for a column */ - const RID constraintColRID(const TableColName& tableColName); + RID constraintColRID(const TableColName& tableColName); /** return the value for the given RID and column name from table SYSCONSTRAINTCOL * @@ -812,7 +812,7 @@ public: /** sessionid access and mutator methods * */ - const uint32_t sessionID() const + uint32_t sessionID() const { return fSessionID; } @@ -823,7 +823,7 @@ public: /** identity access and mutator methods * */ - const int identity() const + int identity() const { return fIdentity; } @@ -836,7 +836,7 @@ public: * * return the column position for a given OID */ - const int colPosition (const OID& oid); + int colPosition (const OID& oid); /** return primary key name for the given table */ const std::string primaryKeyName (const TableName& tableName ); /** return the table info @@ -849,7 +849,7 @@ public: /** return the list of tables for a given schema */ const std::vector< std::pair > getTables (const std::string schema = ""); /** return the number of tables in the whole database */ - const int getTableCount (); + int getTableCount (); /** return the constraint info for a given constraint */ const ConstraintInfo constraintInfo (const IndexName& constraintName); /** return the constraintName list for a given referencePKName */ diff --git a/dbcon/execplan/constantcolumn.h b/dbcon/execplan/constantcolumn.h index bdeb1e014..a5c0a074b 100644 --- a/dbcon/execplan/constantcolumn.h +++ b/dbcon/execplan/constantcolumn.h @@ -239,6 +239,7 @@ public: /** * F&E */ + using ReturnedColumn::evaluate; virtual void evaluate(rowgroup::Row& row) {} /** * F&E diff --git a/dbcon/execplan/existsfilter.h b/dbcon/execplan/existsfilter.h index 537f4d0d5..1a907a32b 100644 --- a/dbcon/execplan/existsfilter.h +++ b/dbcon/execplan/existsfilter.h @@ -66,7 +66,7 @@ public: fSub = sub; } - const bool notExists() const + bool notExists() const { return fNotExists; } @@ -75,7 +75,7 @@ public: fNotExists = notExists; } - const bool correlated() const + bool correlated() const { return fCorrelated; } diff --git a/dbcon/execplan/functioncolumn.h b/dbcon/execplan/functioncolumn.h index c8274e087..2be25897f 100644 --- a/dbcon/execplan/functioncolumn.h +++ b/dbcon/execplan/functioncolumn.h @@ -156,6 +156,7 @@ public: virtual void serialize(messageqcpp::ByteStream&) const; virtual void unserialize(messageqcpp::ByteStream&); + using ReturnedColumn::hasAggregate; virtual bool hasAggregate(); virtual bool hasWindowFunc(); virtual void setDerivedTable(); diff --git a/dbcon/execplan/groupconcatcolumn.h b/dbcon/execplan/groupconcatcolumn.h index 87ecd75c2..8a1982e74 100644 --- a/dbcon/execplan/groupconcatcolumn.h +++ b/dbcon/execplan/groupconcatcolumn.h @@ -118,6 +118,7 @@ public: * @return true iff every member of t is a duplicate copy of every member of this; * false otherwise */ + using AggregateColumn::operator==; virtual bool operator==(const GroupConcatColumn& t) const; /** @brief Do a deep, strict (as opposed to semantic) equivalence test @@ -134,6 +135,7 @@ public: * @return false iff every member of t is a duplicate copy of every member of this; * true otherwise */ + using AggregateColumn::operator!=; virtual bool operator!=(const GroupConcatColumn& t) const; private: diff --git a/dbcon/execplan/intervalcolumn.h b/dbcon/execplan/intervalcolumn.h index 02725c186..6c6765422 100644 --- a/dbcon/execplan/intervalcolumn.h +++ b/dbcon/execplan/intervalcolumn.h @@ -76,7 +76,7 @@ public: { fVal = val; } - const int intervalType() const + int intervalType() const { return fIntervalType; } @@ -90,6 +90,7 @@ public: return new IntervalColumn (*this); } + using ReturnedColumn::hasAggregate; virtual bool hasAggregate() { return false; diff --git a/dbcon/execplan/logicoperator.h b/dbcon/execplan/logicoperator.h index 00ca52175..74cbc0cf8 100644 --- a/dbcon/execplan/logicoperator.h +++ b/dbcon/execplan/logicoperator.h @@ -124,6 +124,7 @@ public: //result_t evaluate(result_t op1, result_t op2); // F&E framework + using Operator::getBoolVal; inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { switch (fOp) @@ -167,6 +168,7 @@ public: } } + using TreeNode::evaluate; inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { fResult.boolVal = getBoolVal(row, isNull, lop, rop); diff --git a/dbcon/execplan/operator.h b/dbcon/execplan/operator.h index d6f5af0ba..660f9f8c6 100644 --- a/dbcon/execplan/operator.h +++ b/dbcon/execplan/operator.h @@ -156,53 +156,66 @@ public: { fOp = op; } + using TreeNode::evaluate; virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) {} // The following methods should be pure virtual. Currently too many instanslization exists. + using TreeNode::getStrVal; virtual const std::string& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.strVal; } + using TreeNode::getIntVal; virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.intVal; } + using TreeNode::getUintVal; virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.uintVal; } + using TreeNode::getFloatVal; virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.floatVal; } + using TreeNode::getDoubleVal; virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.doubleVal; } + using TreeNode::getLongDoubleVal; virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.longDoubleVal; } + using TreeNode::getDecimalVal; virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.decimalVal; } + using TreeNode::getDateIntVal; virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.intVal; } + using TreeNode::getDatetimeIntVal; virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.intVal; } + using TreeNode::getTimestampIntVal; virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.intVal; } + using TreeNode::getTimeIntVal; virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.intVal; } + using TreeNode::getBoolVal; virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) { return fResult.boolVal; diff --git a/dbcon/execplan/predicateoperator.h b/dbcon/execplan/predicateoperator.h index cda9ce9e2..4cd5d37f0 100644 --- a/dbcon/execplan/predicateoperator.h +++ b/dbcon/execplan/predicateoperator.h @@ -115,6 +115,7 @@ public: /*********************************************************** * F&E framework * ***********************************************************/ + using Operator::getBoolVal; virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop); void setOpType(Type& l, Type& r); diff --git a/dbcon/execplan/pseudocolumn.h b/dbcon/execplan/pseudocolumn.h index 55419e8cc..51ad55dcb 100644 --- a/dbcon/execplan/pseudocolumn.h +++ b/dbcon/execplan/pseudocolumn.h @@ -106,7 +106,7 @@ public: /** * Accessor and mutator */ - const uint32_t pseudoType() const + uint32_t pseudoType() const { return fPseudoType; } diff --git a/dbcon/execplan/returnedcolumn.h b/dbcon/execplan/returnedcolumn.h index 9f9e1f03c..45f23c047 100644 --- a/dbcon/execplan/returnedcolumn.h +++ b/dbcon/execplan/returnedcolumn.h @@ -105,7 +105,7 @@ public: fData = data; } - virtual const bool returnAll() const + virtual bool returnAll() const { return fReturnAll; } @@ -114,7 +114,7 @@ public: fReturnAll = returnAll; } - const uint32_t sessionID() const + uint32_t sessionID() const { return fSessionID; } @@ -123,7 +123,7 @@ public: fSessionID = sessionID; } - inline const int32_t sequence() const + inline int32_t sequence() const { return fSequence; } @@ -159,7 +159,7 @@ public: fDistinct = distinct; } - const uint32_t expressionId() const + uint32_t expressionId() const { return fExpressionId; } @@ -177,7 +177,7 @@ public: fJoinInfo = joinInfo; } - virtual const bool asc() const + virtual bool asc() const { return fAsc; } @@ -186,7 +186,7 @@ public: fAsc = asc; } - virtual const bool nullsFirst() const + virtual bool nullsFirst() const { return fNullsFirst; } diff --git a/dbcon/execplan/rowcolumn.h b/dbcon/execplan/rowcolumn.h index 526deafd1..7a227f974 100644 --- a/dbcon/execplan/rowcolumn.h +++ b/dbcon/execplan/rowcolumn.h @@ -135,6 +135,7 @@ public: * @return false iff every member of t is a duplicate copy of every member of this; true otherwise */ bool operator!=(const RowColumn& t) const; + using ReturnedColumn::hasAggregate; virtual bool hasAggregate() { return false; @@ -162,6 +163,7 @@ public: { return new SubSelect(); } + using ReturnedColumn::hasAggregate; virtual bool hasAggregate() { return false; diff --git a/dbcon/execplan/selectfilter.h b/dbcon/execplan/selectfilter.h index c696330c3..b6deca824 100644 --- a/dbcon/execplan/selectfilter.h +++ b/dbcon/execplan/selectfilter.h @@ -100,7 +100,7 @@ public: fSub = sub; } - const bool correlated() const + bool correlated() const { return fCorrelated; } @@ -120,7 +120,7 @@ public: fData = data; } - const uint64_t returnedColPos() const + uint64_t returnedColPos() const { return fReturnedColPos; } diff --git a/dbcon/execplan/sessionmanager.cpp b/dbcon/execplan/sessionmanager.cpp index c3d1becfb..80041d576 100644 --- a/dbcon/execplan/sessionmanager.cpp +++ b/dbcon/execplan/sessionmanager.cpp @@ -143,12 +143,12 @@ void SessionManager::reset() dbrm.sessionmanager_reset(); } -const uint32_t SessionManager::getUnique32() +uint32_t SessionManager::getUnique32() { return dbrm.getUnique32(); } -const bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bIsDbrmUp, SIDTIDEntry& blocker ) +bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bIsDbrmUp, SIDTIDEntry& blocker ) { bIsDbrmUp = true; int arrayLenth = 0; @@ -176,7 +176,7 @@ const bool SessionManager::checkActiveTransaction( const SID sessionId, bool& bI return ret; } -const bool SessionManager::isTransactionActive(const SID sessionId, bool& bIsDbrmUp) +bool SessionManager::isTransactionActive(const SID sessionId, bool& bIsDbrmUp) { bIsDbrmUp = true; int arrayLenth = 0; diff --git a/dbcon/execplan/sessionmanager.h b/dbcon/execplan/sessionmanager.h index f1f9ad71e..e7dab7874 100644 --- a/dbcon/execplan/sessionmanager.h +++ b/dbcon/execplan/sessionmanager.h @@ -186,7 +186,7 @@ public: * object on the PM. * @return A "unique" uint32_t. */ - const uint32_t getUnique32(); + uint32_t getUnique32(); /** @brief Returns the number of active transactions. Only useful in testing. * @@ -206,8 +206,8 @@ public: std::string getTxnIDFilename() const; - const bool checkActiveTransaction(const SID sessionId, bool& bIsDbrmUp, BRM::SIDTIDEntry& blocker); - const bool isTransactionActive(const SID sessionId, bool& bIsDbrmUp); + bool checkActiveTransaction(const SID sessionId, bool& bIsDbrmUp, BRM::SIDTIDEntry& blocker); + bool isTransactionActive(const SID sessionId, bool& bIsDbrmUp); private: BRM::DBRM dbrm; diff --git a/dbcon/execplan/simplecolumn.h b/dbcon/execplan/simplecolumn.h index 72f633a25..54193fba5 100644 --- a/dbcon/execplan/simplecolumn.h +++ b/dbcon/execplan/simplecolumn.h @@ -160,7 +160,7 @@ public: { fTimeZone = timeZone; } - inline const bool isColumnStore() const + inline bool isColumnStore() const { return fisColumnStore; } diff --git a/dbcon/execplan/simplefilter.h b/dbcon/execplan/simplefilter.h index f29d505e3..4b3679777 100644 --- a/dbcon/execplan/simplefilter.h +++ b/dbcon/execplan/simplefilter.h @@ -104,6 +104,7 @@ public: fTimeZone = timeZone; } + using Filter::data; virtual const std::string data() const; /** assign fLhs @@ -191,7 +192,7 @@ public: { fIndexFlag = indexFlag; } - const int indexFlag() const + int indexFlag() const { return fIndexFlag; } @@ -201,7 +202,7 @@ public: { fJoinFlag = joinFlag; } - const int joinFlag() const + int joinFlag() const { return fJoinFlag; } diff --git a/dbcon/execplan/udafcolumn.h b/dbcon/execplan/udafcolumn.h index 3486740ca..da9f7fff3 100644 --- a/dbcon/execplan/udafcolumn.h +++ b/dbcon/execplan/udafcolumn.h @@ -102,6 +102,7 @@ public: * @return true iff every member of t is a duplicate copy of every member of this; * false otherwise */ + using AggregateColumn::operator==; virtual bool operator==(const UDAFColumn& t) const; /** @brief Do a deep, strict (as opposed to semantic) equivalence test @@ -118,6 +119,7 @@ public: * @return false iff every member of t is a duplicate copy of every member of this; * true otherwise */ + using AggregateColumn::operator!=; virtual bool operator!=(const UDAFColumn& t) const; private: diff --git a/dbcon/execplan/windowfunctioncolumn.h b/dbcon/execplan/windowfunctioncolumn.h index 2d06b735e..36ef2099b 100644 --- a/dbcon/execplan/windowfunctioncolumn.h +++ b/dbcon/execplan/windowfunctioncolumn.h @@ -129,6 +129,7 @@ public: // util function for connector to use. void addToPartition(std::vector& groupByList); + using ReturnedColumn::hasAggregate; virtual bool hasAggregate() { return false; diff --git a/dbcon/joblist/columncommand-jl.h b/dbcon/joblist/columncommand-jl.h index 2f2c9b01c..826a8279c 100644 --- a/dbcon/joblist/columncommand-jl.h +++ b/dbcon/joblist/columncommand-jl.h @@ -56,7 +56,7 @@ public: return COLUMN_COMMAND; } // @bug 1098 - const uint8_t getBOP() const + uint8_t getBOP() const { return BOP; } @@ -64,7 +64,7 @@ public: { return filterString; } - const uint16_t getFilterCount() const + uint16_t getFilterCount() const { return filterCount; } diff --git a/dbcon/joblist/expressionstep.h b/dbcon/joblist/expressionstep.h index 63423fc7d..1974ad42e 100644 --- a/dbcon/joblist/expressionstep.h +++ b/dbcon/joblist/expressionstep.h @@ -68,14 +68,17 @@ public: { return fTableOids.empty() ? 0 : fTableOids.front(); } + using JobStep::alias; std::string alias() const { return fAliases.empty() ? "" : fAliases.front(); } + using JobStep::view; std::string view() const { return fViews.empty() ? "" : fViews.front(); } + using JobStep::schema; std::string schema() const { return fSchemas.empty() ? "" : fSchemas.front(); diff --git a/dbcon/joblist/filtercommand-jl.h b/dbcon/joblist/filtercommand-jl.h index 5f391da5b..99ec566a0 100644 --- a/dbcon/joblist/filtercommand-jl.h +++ b/dbcon/joblist/filtercommand-jl.h @@ -46,7 +46,7 @@ public: void createCommand(messageqcpp::ByteStream& bs) const; void runCommand(messageqcpp::ByteStream& bs) const; uint16_t getWidth(); - const uint8_t getBOP() const + uint8_t getBOP() const { return fBOP; }; diff --git a/dbcon/joblist/groupconcat.h b/dbcon/joblist/groupconcat.h index 40a4d7e53..e0bc243c1 100644 --- a/dbcon/joblist/groupconcat.h +++ b/dbcon/joblist/groupconcat.h @@ -84,6 +84,7 @@ public: EXPORT GroupConcatAgUM(rowgroup::SP_GroupConcat&); EXPORT ~GroupConcatAgUM(); + using rowgroup::GroupConcatAg::merge; void initialize(); void processRow(const rowgroup::Row&); EXPORT void merge(const rowgroup::Row&, int64_t); @@ -147,6 +148,7 @@ public: void processRow(const rowgroup::Row&); void merge(GroupConcator*); + using GroupConcator::getResult; void getResult(uint8_t* buff, const std::string& sep); const std::string toString() const; @@ -172,11 +174,13 @@ public: GroupConcatOrderBy(); virtual ~GroupConcatOrderBy(); + using ordering::IdbOrderBy::initialize; void initialize(const rowgroup::SP_GroupConcat&); void processRow(const rowgroup::Row&); uint64_t getKeyLength() const; void merge(GroupConcator*); + using GroupConcator::getResult; void getResult(uint8_t* buff, const std::string& sep); const std::string toString() const; diff --git a/dbcon/joblist/jlf_subquery.cpp b/dbcon/joblist/jlf_subquery.cpp index 27c0129e6..ac2f4b950 100644 --- a/dbcon/joblist/jlf_subquery.cpp +++ b/dbcon/joblist/jlf_subquery.cpp @@ -85,8 +85,8 @@ void getColumnValue(ConstantColumn** cc, uint64_t i, const Row& row, const strin *cc = new ConstantColumn(oss.str(), row.getIntField(i)); break; } - - // else > 0; fall through + /* fall through */ + /* else > 0 */ case CalpontSystemCatalog::DECIMAL: case CalpontSystemCatalog::UDECIMAL: diff --git a/dbcon/joblist/joblist.h b/dbcon/joblist/joblist.h index 4940e038d..ce85db6d3 100644 --- a/dbcon/joblist/joblist.h +++ b/dbcon/joblist/joblist.h @@ -101,7 +101,7 @@ public: errInfo = sp; } - virtual const uint32_t status() const + virtual uint32_t status() const { return errInfo->errCode; } diff --git a/dbcon/joblist/limitedorderby.h b/dbcon/joblist/limitedorderby.h index ec2d9d4f9..62517277b 100644 --- a/dbcon/joblist/limitedorderby.h +++ b/dbcon/joblist/limitedorderby.h @@ -45,7 +45,7 @@ class LimitedOrderBy : public ordering::IdbOrderBy public: LimitedOrderBy(); virtual ~LimitedOrderBy(); - + using ordering::IdbOrderBy::initialize; void initialize(const rowgroup::RowGroup&, const JobInfo&, bool invertRules = false, diff --git a/dbcon/joblist/primitivestep.h b/dbcon/joblist/primitivestep.h index 72f9c7dbf..b07001c7d 100644 --- a/dbcon/joblist/primitivestep.h +++ b/dbcon/joblist/primitivestep.h @@ -460,6 +460,7 @@ public: * * The main loop for the receive-side thread. Don't call it directly. */ + using PrimitiveMsg::receivePrimitiveMessages; void receivePrimitiveMessages(uint64_t i = 0); /** @brief Add a filter when the column is a 4-byte float type diff --git a/dbcon/joblist/tupleaggregatestep.cpp b/dbcon/joblist/tupleaggregatestep.cpp index 8ba3473c5..d3d9b2165 100644 --- a/dbcon/joblist/tupleaggregatestep.cpp +++ b/dbcon/joblist/tupleaggregatestep.cpp @@ -1307,7 +1307,7 @@ void TupleAggregateStep::prep1PhaseAggregate( case ROWAGG_AVG: avgFuncMap.insert(make_pair(key, funct)); - + /* fall through */ case ROWAGG_SUM: { if (typeProj[colProj] == CalpontSystemCatalog::CHAR || @@ -1890,6 +1890,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate( else break; } + /* fall through */ case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_COL_NAME: @@ -3166,6 +3167,7 @@ void TupleAggregateStep::prep2PhasesAggregate( // let fall through to add a count column for average function if (aggOp != ROWAGG_AVG) break; + /* fall through */ case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_COL_NAME: @@ -4048,6 +4050,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate( funct->fAuxColumnIndex = colAggPm; else break; + /* fall through */ case ROWAGG_COUNT_ASTERISK: case ROWAGG_COUNT_COL_NAME: diff --git a/dbcon/joblist/tupleconstantstep.h b/dbcon/joblist/tupleconstantstep.h index c98227805..ee38dad1e 100644 --- a/dbcon/joblist/tupleconstantstep.h +++ b/dbcon/joblist/tupleconstantstep.h @@ -134,6 +134,7 @@ public: uint32_t nextBand(messageqcpp::ByteStream& bs); protected: + using TupleConstantStep::fillInConstants; void fillInConstants(); }; @@ -159,6 +160,7 @@ public: However (for now), it's ok, because it's only called in one place and doesn't need to be virtual there. */ + using TupleConstantStep::initialize; void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo); const std::string toString() const; @@ -175,6 +177,7 @@ public: protected: void execute() {} + using TupleConstantStep::fillInConstants; void fillInConstants() {} void constructContanstRow(const JobInfo& jobInfo) {} diff --git a/dbcon/joblist/tuplehashjoin.h b/dbcon/joblist/tuplehashjoin.h index 164f1f541..884644eba 100644 --- a/dbcon/joblist/tuplehashjoin.h +++ b/dbcon/joblist/tuplehashjoin.h @@ -176,7 +176,7 @@ public: { fCorrelatedSide = c; } - + using JobStep::tupleId; uint64_t tupleId() const { return fTupleId2; @@ -234,7 +234,7 @@ public: { return largeRG; } - const uint32_t getSmallKey() const + uint32_t getSmallKey() const { return smallSideKeys[0][0]; } diff --git a/dbcon/joblist/tuplehavingstep.h b/dbcon/joblist/tuplehavingstep.h index a7fc679ab..7b950d4a9 100644 --- a/dbcon/joblist/tuplehavingstep.h +++ b/dbcon/joblist/tuplehavingstep.h @@ -68,6 +68,7 @@ public: bool deliverStringTableRowGroup() const; void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo); + using ExpressionStep::expressionFilter; void expressionFilter(const execplan::ParseTree* filter, JobInfo& jobInfo); virtual bool stringTableFriendly() diff --git a/dbcon/mysql/CMakeLists.txt b/dbcon/mysql/CMakeLists.txt index eafba7e5e..9f005ed8a 100644 --- a/dbcon/mysql/CMakeLists.txt +++ b/dbcon/mysql/CMakeLists.txt @@ -35,9 +35,12 @@ add_definitions(-DMYSQL_DYNAMIC_PLUGIN) set_source_files_properties(ha_mcs.cpp PROPERTIES COMPILE_FLAGS "-fno-implicit-templates") if (COMMAND mysql_add_plugin) - mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY DEFAULT - LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool - COMPONENT columnstore-engine) + IF(NOT(RPM OR DEB)) + SET(disabled DISABLED) + ENDIF() + mysql_add_plugin(columnstore ${libcalmysql_SRCS} STORAGE_ENGINE MODULE_ONLY ${disabled} + LINK_LIBRARIES ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool + COMPONENT columnstore-engine) else () add_library(ha_columnstore SHARED ${libcalmysql_SRCS}) SET_TARGET_PROPERTIES(ha_columnstore PROPERTIES PREFIX "") diff --git a/dbcon/mysql/ha_mcs_ddl.cpp b/dbcon/mysql/ha_mcs_ddl.cpp index 05a3717cb..bcf5d4d83 100644 --- a/dbcon/mysql/ha_mcs_ddl.cpp +++ b/dbcon/mysql/ha_mcs_ddl.cpp @@ -2128,6 +2128,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl ci->isAlter = false; } + if (b == ddlpackageprocessor::DDLPackageProcessor::DROP_TABLE_NOT_IN_CATALOG_ERROR) + { + return ER_NO_SUCH_TABLE_IN_ENGINE; + } + if ((b != 0) && (b != ddlpackageprocessor::DDLPackageProcessor::WARNING)) { thd->get_stmt_da()->set_overwrite_status(true); @@ -2583,7 +2588,7 @@ int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_i stmt += ";"; int rc = ProcessDDLStatement(stmt, schema, tbl, tid2sid(thd->thread_id), emsg); - if (rc != 0) + if (rc != 0 && rc != ER_NO_SUCH_TABLE_IN_ENGINE) { push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, emsg.c_str()); } diff --git a/dbcon/mysql/ha_mcs_dml.cpp b/dbcon/mysql/ha_mcs_dml.cpp index 8d5ac4ba8..d79b1c6cb 100644 --- a/dbcon/mysql/ha_mcs_dml.cpp +++ b/dbcon/mysql/ha_mcs_dml.cpp @@ -545,28 +545,26 @@ int ha_mcs_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abo return rc; //@Bug 4605 + int rc1 = 0; if ( (rc == 0) && !abort && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) { ci.rowsHaveInserted += size; command = "COMMIT"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc1 = ProcessCommandStatement ( thd, command, ci, schema ); } else if (useHdfs) { ci.rowsHaveInserted += size; command = "COMMIT"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc1 = ProcessCommandStatement ( thd, command, ci, schema ); } else if (( rc != 0) || abort ) { command = "ROLLBACK"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc1 = ProcessCommandStatement ( thd, command, ci, schema ); } - else - { - return rc; - } - + rc = max(rc, rc1); + return rc; } @@ -630,26 +628,28 @@ int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info& if ( thd->killed > 0 ) { command = "ROLLBACK"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc = ProcessCommandStatement ( thd, command, ci, schema ); } else if (rc != dmlpackageprocessor::DMLPackageProcessor::ACTIVE_TRANSACTION_ERROR) { //@Bug 4605 + int rc1 = 0; if ( rc != 0 ) { command = "ROLLBACK"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc1 = ProcessCommandStatement ( thd, command, ci, schema ); } else if (( rc == 0 ) && (!(thd->variables.option_bits & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))) { command = "COMMIT"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc1 = ProcessCommandStatement ( thd, command, ci, schema ); } else if (useHdfs) { command = "COMMIT"; - ProcessCommandStatement ( thd, command, ci, schema ); + rc1 = ProcessCommandStatement ( thd, command, ci, schema ); } + rc = max(rc, rc1); } } @@ -1702,7 +1702,7 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca } else { - buf = buf + 2 ; + buf = buf + 2; } } else //utf8 diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 1da9d8175..8ae75b42d 100755 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -3323,6 +3323,7 @@ ReturnedColumn* buildReturnedColumn( break; } } + /* fall through */ case Item::NULL_ITEM: { @@ -4087,7 +4088,20 @@ ReturnedColumn* buildFunctionColumn( fc->operationType(functor->operationType(funcParms, fc->resultType())); fc->expressionId(ci->expressionId++); - fc->charsetNumber(ifp->collation.collation->number); + // A few functions use a different collation than that found in + // the base ifp class + if (funcName == "locate" || + funcName == "find_in_set" || + funcName == "strcmp") + { + DTCollation dt; + ifp->Type_std_attributes::agg_arg_charsets_for_comparison(dt, ifp->func_name(), ifp->arguments(), 1, 1); + fc->charsetNumber(dt.collation->number); + } + else + { + fc->charsetNumber(ifp->collation.collation->number); + } } else if (ifp->type() == Item::COND_ITEM || ifp->functype() == Item_func::EQ_FUNC || @@ -4828,6 +4842,7 @@ ReturnedColumn* buildAggregateColumn(Item* item, gp_walk_info& gwi) break; } } + /* fall through */ default: { diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index 4d2988103..b462fd99d 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -1604,27 +1604,7 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c aTableName.schema = first_table->table->s->db.str; aTableName.table = first_table->table->s->table_name.str; } -#if 0 - CalpontSystemCatalog::ROPair roPair; - try - { - roPair = csc->tableRID( aTableName ); - } - catch (IDBExcept& ie) - { - setError(thd, ER_INTERNAL_ERROR, ie.what()); - return ER_INTERNAL_ERROR; - } - catch (std::exception& ex) - { - setError(thd, ER_INTERNAL_ERROR, - logging::IDBErrorInfo::instance()->errorMsg(ERR_SYSTEM_CATALOG) + ex.what()); - return ER_INTERNAL_ERROR; - } - - ci->tableOid = roPair.objnum; -#endif CalpontDMLPackage* pDMLPackage = 0; // dmlStmt += ";"; IDEBUG( cout << "STMT: " << dmlStmt << " and sessionID " << thd->thread_id << endl ); @@ -2271,7 +2251,6 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector& c delete ci->dmlProc; ci->dmlProc = nullptr; - return rc; } diff --git a/dbcon/mysql/ha_mcs_partition.cpp b/dbcon/mysql/ha_mcs_partition.cpp index 3bf6beab3..1bd8b65ba 100644 --- a/dbcon/mysql/ha_mcs_partition.cpp +++ b/dbcon/mysql/ha_mcs_partition.cpp @@ -263,6 +263,7 @@ const string format(int64_t v, CalpontSystemCatalog::ColType& ct) case CalpontSystemCatalog::TIME: oss << DataConvert::timeToString(v); + break; case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::VARCHAR: @@ -314,7 +315,7 @@ const string format(int64_t v, CalpontSystemCatalog::ColType& ct) return oss.str(); } -const int64_t IDB_format(char* str, CalpontSystemCatalog::ColType& ct, uint8_t& rf) +int64_t IDB_format(char* str, CalpontSystemCatalog::ColType& ct, uint8_t& rf) { int64_t v = 0; bool pushWarning = false; diff --git a/dbcon/mysql/ha_subquery.h b/dbcon/mysql/ha_subquery.h index 506cdf0eb..03cd48033 100644 --- a/dbcon/mysql/ha_subquery.h +++ b/dbcon/mysql/ha_subquery.h @@ -54,7 +54,7 @@ public: { return fGwip; } - const bool correlated() const + bool correlated() const { return fCorrelated; } @@ -126,7 +126,7 @@ public: execplan::ParseTree* transform_between(); execplan::ParseTree* transform_in(); execplan::ParseTree* buildParseTree(execplan::PredicateOperator* op); - const uint64_t returnedColPos() const + uint64_t returnedColPos() const { return fReturnedColPos; } diff --git a/oam/etc/Columnstore.xml b/oam/etc/Columnstore.xml index 879dc3237..b9683325d 100644 --- a/oam/etc/Columnstore.xml +++ b/oam/etc/Columnstore.xml @@ -4,10 +4,6 @@ MariaDB service engineers. Incorrect settings can render your system unusable and will require a service call to correct. --> - 0.0.0.0 - 1 - 2 - 2 127.0.0.1 8601 diff --git a/oam/install_scripts/CMakeLists.txt b/oam/install_scripts/CMakeLists.txt index 17ad87c9b..d701ff2cd 100644 --- a/oam/install_scripts/CMakeLists.txt +++ b/oam/install_scripts/CMakeLists.txt @@ -22,13 +22,6 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-ddlproc.service.in" "${CMAKE_CUR configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-storagemanager.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-storagemanager.service" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh" @ONLY) - -IF(RPM MATCHES "(rhel|centos)8|(sles|suse)15|fedora") - SET(PYTHON_SHEBANG "#!/usr/bin/env python3") -ELSE() - SET(PYTHON_SHEBANG "#!/usr/bin/env python") -ENDIF() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.py") configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-start-storagemanager.py.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-start-storagemanager.py") diff --git a/oam/install_scripts/mcs-start-storagemanager.py.in b/oam/install_scripts/mcs-start-storagemanager.py.in index d6d1b2a62..08ca216cd 100644 --- a/oam/install_scripts/mcs-start-storagemanager.py.in +++ b/oam/install_scripts/mcs-start-storagemanager.py.in @@ -1,32 +1,14 @@ -${PYTHON_SHEBANG} +#!/usr/bin/env python3 import sys - -if sys.version_info < (3,0): - import ConfigParser -else: - import configparser +import configparser if __name__ == '__main__': - if sys.version_info < (3,0): - config = ConfigParser.ConfigParser() - else: - config = configparser.ConfigParser() - + config = configparser.ConfigParser() config.read('/etc/columnstore/storagemanager.cnf') - - if sys.version_info < (3,0): - storage = config.get('ObjectStorage', 'service') - if storage is None: - storage = 'LocalStorage' - bucket = config.get('S3', 'bucket') - if bucket is None: - bucket = 'some_bucket' - else: - storage = config.get('ObjectStorage', 'service', fallback='LocalStorage') - bucket = config.get('S3', 'bucket', fallback='some_bucket') - + storage = config.get('ObjectStorage', 'service', fallback='LocalStorage') + bucket = config.get('S3', 'bucket', fallback='some_bucket') if storage.lower() == 's3' and not bucket.lower() == 'some_bucket': print("Using S3 storage.") diff --git a/oamapps/alarmmanager/alarm.h b/oamapps/alarmmanager/alarm.h index 9d3185775..a82398657 100644 --- a/oamapps/alarmmanager/alarm.h +++ b/oamapps/alarmmanager/alarm.h @@ -58,7 +58,7 @@ public: /* * @brief access methods */ - inline const uint16_t getAlarmID() const + inline uint16_t getAlarmID() const { return alarmID; } @@ -76,25 +76,25 @@ public: } void setComponentID (const std::string&); - inline const uint16_t getSeverity() const + inline uint16_t getSeverity() const { return severity; } void setSeverity (const uint16_t); - inline const bool getState () const + inline bool getState () const { return state; } void setState (const bool); - inline const uint16_t getCtnThreshold() const + inline uint16_t getCtnThreshold() const { return ctnThreshold; } void setCtnThreshold (const uint16_t); - inline const uint16_t getOccurrence() const + inline uint16_t getOccurrence() const { return occurrence; } @@ -106,19 +106,19 @@ public: } void setReceiveTime (const time_t); - inline const uint32_t getLastIssueTime() const + inline uint32_t getLastIssueTime() const { return lastIssueTime; } void setLastIssueTime (const uint32_t); - inline const uint16_t getPid () const + inline uint16_t getPid () const { return pid; } void setPid (const uint16_t); - inline const uint16_t getTid () const + inline uint16_t getTid () const { return tid; } @@ -130,7 +130,7 @@ public: } void setTimestamp (const std::string&); - inline const time_t getTimestampSeconds () const + inline time_t getTimestampSeconds () const { return timestampseconds; } diff --git a/primitives/blockcache/blockcacheclient.h b/primitives/blockcache/blockcacheclient.h index e9f3dbe95..7560a9d9f 100644 --- a/primitives/blockcache/blockcacheclient.h +++ b/primitives/blockcache/blockcacheclient.h @@ -80,7 +80,7 @@ public: /** * @brief retrieve the Disk Block at lbid, ver from the Disk Block Buffer Cache **/ - inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb) + inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb) { return fBCCBrp->read(lbid, ver, fb); } @@ -88,12 +88,12 @@ public: /** * @brief retrieve the Disk Block at lbid, ver from the Disk Block Buffer Cache **/ - inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr) + inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr) { return fBCCBrp->read(lbid, ver, bufferPtr); } - inline const int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, const BRM::VER_t txn, const int compType, + inline int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, const BRM::VER_t txn, const int compType, void* bufferPtr, bool flg, bool& wasCached, bool* wasVersioned = NULL, bool insertIntoCache = true, bool readFromCache = true) { diff --git a/primitives/blockcache/blockrequestprocessor.cpp b/primitives/blockcache/blockrequestprocessor.cpp index 5463005ed..d43c889f8 100644 --- a/primitives/blockcache/blockrequestprocessor.cpp +++ b/primitives/blockcache/blockrequestprocessor.cpp @@ -210,7 +210,7 @@ int BlockRequestProcessor::check(BRM::LBID_t lbid, const BRM::QueryContext& ver, } } -const int BlockRequestProcessor::getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn, +int BlockRequestProcessor::getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn, int compType, void* bufferPtr, bool vbFlg, bool& wasCached, bool* versioned, bool insertIntoCache, bool readFromCache) { diff --git a/primitives/blockcache/blockrequestprocessor.h b/primitives/blockcache/blockrequestprocessor.h index fdb86e433..d6ee5320a 100644 --- a/primitives/blockcache/blockrequestprocessor.h +++ b/primitives/blockcache/blockrequestprocessor.h @@ -90,7 +90,7 @@ public: return fbMgr.findPtr(HashObject_t(lbid, ver, flg)); } - inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb) + inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, FileBuffer& fb) { return (fbMgr.find(HashObject_t(lbid, ver, 0), fb) ? 1 : 0); } @@ -98,12 +98,12 @@ public: /** * @brief retrieve the lbid@ver disk block from the block cache **/ - inline const int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr) + inline int read(const BRM::LBID_t& lbid, const BRM::VER_t& ver, void* bufferPtr) { return (fbMgr.find(HashObject_t(lbid, ver, 0), bufferPtr) ? 1 : 0); } - const int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn, int compType, + int getBlock(const BRM::LBID_t& lbid, const BRM::QueryContext& ver, BRM::VER_t txn, int compType, void* bufferPtr, bool flg, bool& wasCached, bool* wasVersioned, bool insertIntoCache, bool readFromCache); diff --git a/primitives/blockcache/filebuffer.h b/primitives/blockcache/filebuffer.h index 1719cf6d7..5aee1bd1c 100644 --- a/primitives/blockcache/filebuffer.h +++ b/primitives/blockcache/filebuffer.h @@ -103,7 +103,7 @@ public: return fByteData; } - inline const uint32_t datLen() const + inline uint32_t datLen() const { return fDataLen; } @@ -136,7 +136,7 @@ public: /** * @brief return the lbid value of disk bloc **/ - inline const BRM::LBID_t Lbid() const + inline BRM::LBID_t Lbid() const { return fLbid; } @@ -148,7 +148,7 @@ public: /** * @brief return the version of this disk block. ignored for range retrievals **/ - inline const BRM::VER_t Verid() const + inline BRM::VER_t Verid() const { return fVerid; } diff --git a/primitives/blockcache/filebuffermgr.h b/primitives/blockcache/filebuffermgr.h index aab8a8235..7a64ab875 100644 --- a/primitives/blockcache/filebuffermgr.h +++ b/primitives/blockcache/filebuffermgr.h @@ -201,7 +201,7 @@ public: } void setReportingFrequency(const uint32_t d); - const uint32_t ReportingFrequency() const + uint32_t ReportingFrequency() const { return fReportFrequency; } diff --git a/primitives/blockcache/filerequest.h b/primitives/blockcache/filerequest.h index d69a14ed2..3dcf967a9 100644 --- a/primitives/blockcache/filerequest.h +++ b/primitives/blockcache/filerequest.h @@ -130,7 +130,7 @@ public: /** * @brief lbid requested **/ - const BRM::LBID_t Lbid() const + BRM::LBID_t Lbid() const { return fLBID; } @@ -146,17 +146,17 @@ public: /** * @brief VBBM flag of the LBID/Ver **/ - const bool Flg() const + bool Flg() const { return fFlg; } - const BRM::VER_t Txn() const + BRM::VER_t Txn() const { return fTxn; } - const int CompType() const + int CompType() const { return fCompType; } @@ -164,7 +164,7 @@ public: /** * @brief number of blocks requested **/ - const uint32_t BlocksRequested() const + uint32_t BlocksRequested() const { return fLength; } @@ -180,11 +180,11 @@ public: /** * @brief number of blocks read from disk **/ - const uint32_t BlocksRead() const + uint32_t BlocksRead() const { return fblksRead; } - const uint32_t BlocksLoaded() const + uint32_t BlocksLoaded() const { return fblksLoaded; } diff --git a/primitives/blockcache/iomanager.cpp b/primitives/blockcache/iomanager.cpp index 019368313..af65d6918 100644 --- a/primitives/blockcache/iomanager.cpp +++ b/primitives/blockcache/iomanager.cpp @@ -1368,7 +1368,7 @@ void ioManager::buildOidFileName(const BRM::OID_t oid, uint16_t dbRoot, const ui fFileOp.getFileNameForPrimProc(oid, file_name, dbRoot, partNum, segNum); } -const int ioManager::localLbidLookup(BRM::LBID_t lbid, +int ioManager::localLbidLookup(BRM::LBID_t lbid, BRM::VER_t verid, bool vbFlag, BRM::OID_t& oid, diff --git a/primitives/blockcache/iomanager.h b/primitives/blockcache/iomanager.h index 8f0f629ac..b7c93fd6f 100644 --- a/primitives/blockcache/iomanager.h +++ b/primitives/blockcache/iomanager.h @@ -73,7 +73,7 @@ public: return fConfig; } - const int localLbidLookup(BRM::LBID_t lbid, + int localLbidLookup(BRM::LBID_t lbid, BRM::VER_t verid, bool vbFlag, BRM::OID_t& oid, @@ -88,7 +88,7 @@ public: const uint16_t segNum, char* file_name); - const uint32_t getExtentRows() + uint32_t getExtentRows() { return fdbrm.getExtentRows(); } diff --git a/primitives/primproc/bppseeder.cpp b/primitives/primproc/bppseeder.cpp index aca03af25..62ee37c00 100644 --- a/primitives/primproc/bppseeder.cpp +++ b/primitives/primproc/bppseeder.cpp @@ -389,7 +389,7 @@ void BPPSeeder::sendErrorMsg(uint32_t id, uint16_t status, uint32_t step) { ISMPacketHeader ism; - PrimitiveHeader ph = {0}; + PrimitiveHeader ph = {0,0,0,0,0,0}; ism.Status = status; ph.UniqueID = id; diff --git a/primitives/primproc/columncommand.cpp b/primitives/primproc/columncommand.cpp index 95c614323..db90b3577 100644 --- a/primitives/primproc/columncommand.cpp +++ b/primitives/primproc/columncommand.cpp @@ -899,7 +899,7 @@ void ColumnCommand::enableFilters() * RETURN: * emptyVal - the value of empty row ***********************************************************/ -const uint64_t ColumnCommand::getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const +uint64_t ColumnCommand::getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const { uint64_t emptyVal = 0; int offset; @@ -998,7 +998,7 @@ void ColumnCommand::getLBIDList(uint32_t loopCount, vector* lbids) lbids->push_back(i); } -const int64_t ColumnCommand::getLastLbid() +int64_t ColumnCommand::getLastLbid() { if (!_isScan) return 0; diff --git a/primitives/primproc/columncommand.h b/primitives/primproc/columncommand.h index 4639ac10a..e1d67aa0d 100644 --- a/primitives/primproc/columncommand.h +++ b/primitives/primproc/columncommand.h @@ -82,8 +82,8 @@ public: makeAbsRids = m; } bool willPrefetch(); - const uint64_t getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const; - const int64_t getLastLbid(); + uint64_t getEmptyRowValue( const execplan::CalpontSystemCatalog::ColDataType dataType, const int width ) const; + int64_t getLastLbid(); void getLBIDList(uint32_t loopCount, std::vector* lbids); virtual SCommand duplicate(); diff --git a/primitives/primproc/primitiveserver.h b/primitives/primproc/primitiveserver.h index 69f0afe11..6fa680475 100644 --- a/primitives/primproc/primitiveserver.h +++ b/primitives/primproc/primitiveserver.h @@ -150,7 +150,7 @@ public: } // int fCacheCount; - const int ReadAheadBlocks() const + int ReadAheadBlocks() const { return fReadAheadBlocks; } diff --git a/storage-manager/src/CloudStorage.h b/storage-manager/src/CloudStorage.h index 978d130a4..a844fd1e1 100644 --- a/storage-manager/src/CloudStorage.h +++ b/storage-manager/src/CloudStorage.h @@ -29,7 +29,7 @@ namespace storagemanager class CloudStorage { public: - + virtual ~CloudStorage(){}; /* These behave like syscalls. return code -1 means an error, and errno is set */ virtual int getObject(const std::string &sourceKey, const std::string &destFile, size_t *size = NULL) = 0; virtual int getObject(const std::string &sourceKey, boost::shared_array *data, size_t *size = NULL) = 0; diff --git a/storage-manager/src/Config.h b/storage-manager/src/Config.h index 4fc7dd17d..9818ffc90 100644 --- a/storage-manager/src/Config.h +++ b/storage-manager/src/Config.h @@ -33,6 +33,7 @@ namespace storagemanager class ConfigListener { public: + virtual ~ConfigListener(){}; virtual void configListener() = 0; }; diff --git a/storage-manager/src/Downloader.h b/storage-manager/src/Downloader.h index 3f8766961..0c2e73410 100644 --- a/storage-manager/src/Downloader.h +++ b/storage-manager/src/Downloader.h @@ -77,7 +77,7 @@ class Downloader : public ConfigListener { Download(const std::string &source, const boost::filesystem::path &_dlPath, boost::mutex *, Downloader *); Download(const std::string &source); - ~Download(); + virtual ~Download(); void operator()(); boost::filesystem::path dlPath; const std::string key; diff --git a/storage-manager/src/Synchronizer.h b/storage-manager/src/Synchronizer.h index 908a4e5e8..a11dc4131 100644 --- a/storage-manager/src/Synchronizer.h +++ b/storage-manager/src/Synchronizer.h @@ -91,6 +91,7 @@ class Synchronizer : public boost::noncopyable , public ConfigListener struct Job : public ThreadPool::Job { + virtual ~Job(){}; Job(Synchronizer *s, std::list::iterator i); void operator()(); Synchronizer *sync; diff --git a/storage-manager/src/ThreadPool.h b/storage-manager/src/ThreadPool.h index 3bf811a55..651ca8110 100644 --- a/storage-manager/src/ThreadPool.h +++ b/storage-manager/src/ThreadPool.h @@ -40,6 +40,7 @@ class ThreadPool : public boost::noncopyable class Job { public: + virtual ~Job(){}; virtual void operator()() = 0; }; diff --git a/utils/common/any.hpp b/utils/common/any.hpp index 5f7d6c0a5..78c65ffb2 100755 --- a/utils/common/any.hpp +++ b/utils/common/any.hpp @@ -29,20 +29,27 @@ namespace anyimpl virtual void move(void* const* src, void** dest) = 0; virtual void* get_value(void** src) = 0; virtual size_t get_size() = 0; + protected: + ~base_any_policy() = default; }; + //inline base_any_policy::~base_any_policy() throw () {} + template struct typed_base_any_policy : base_any_policy { virtual size_t get_size() { return sizeof(T); - } + } + protected: + ~typed_base_any_policy() = default; }; template struct small_any_policy : typed_base_any_policy { + virtual ~small_any_policy() = default; virtual void static_delete(void** x) { *x = 0; @@ -68,6 +75,7 @@ namespace anyimpl template struct big_any_policy : typed_base_any_policy { + virtual ~big_any_policy() = default; virtual void static_delete(void** x) { if (*x) diff --git a/utils/common/hasher.h b/utils/common/hasher.h index e70f62600..4978689c4 100644 --- a/utils/common/hasher.h +++ b/utils/common/hasher.h @@ -114,10 +114,10 @@ public: { case 3: k1 ^= tail[2] << 16; - + /* fall through */ case 2: k1 ^= tail[1] << 8; - + /* fall through */ case 1: k1 ^= tail[0]; k1 *= c1; diff --git a/utils/funcexp/func_char.cpp b/utils/funcexp/func_char.cpp index 9fd603ad4..88d0e01ff 100644 --- a/utils/funcexp/func_char.cpp +++ b/utils/funcexp/func_char.cpp @@ -163,7 +163,7 @@ string Func_char::getStrVal(Row& row, numBytes += getChar(value, pBuf); } - + isNull = false; /* Check whether we got a well-formed string */ MY_STRCOPY_STATUS status; int32_t actualBytes = cs->well_formed_char_length(buf, buf + numBytes, numBytes, &status); diff --git a/utils/funcexp/func_hour.cpp b/utils/funcexp/func_hour.cpp index 666e84ce0..918fe193d 100644 --- a/utils/funcexp/func_hour.cpp +++ b/utils/funcexp/func_hour.cpp @@ -84,6 +84,7 @@ int64_t Func_hour::getIntVal(rowgroup::Row& row, { isNull = true; } + /* fall through */ case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::CHAR: diff --git a/utils/funcexp/func_insert.cpp b/utils/funcexp/func_insert.cpp index a869ef4bf..8e5864433 100644 --- a/utils/funcexp/func_insert.cpp +++ b/utils/funcexp/func_insert.cpp @@ -73,8 +73,6 @@ std::string Func_insert::getStrVal(rowgroup::Row& row, if (isNull) return ""; - start--; // Because SQL syntax is 1 based and we want 0 based. - CHARSET_INFO* cs = fp[0]->data()->resultType().getCharset(); // binLen represents the number of bytes @@ -91,6 +89,8 @@ std::string Func_insert::getStrVal(rowgroup::Row& row, if ((length < 0) || (length > strLen)) length = strLen; + start--; // Because SQL syntax is 1 based and we want 0 based. + // Convert start and length from characters to bytes. start = cs->charpos(pos, end, start); length = cs->charpos(pos+start, end, length); diff --git a/utils/funcexp/func_minute.cpp b/utils/funcexp/func_minute.cpp index 6cdd109a6..fdad4e9cf 100644 --- a/utils/funcexp/func_minute.cpp +++ b/utils/funcexp/func_minute.cpp @@ -83,6 +83,7 @@ int64_t Func_minute::getIntVal(rowgroup::Row& row, { isNull = true; } + /* fall through */ case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::CHAR: diff --git a/utils/funcexp/func_nullif.cpp b/utils/funcexp/func_nullif.cpp index ca835e5bc..90c546ea3 100644 --- a/utils/funcexp/func_nullif.cpp +++ b/utils/funcexp/func_nullif.cpp @@ -912,6 +912,7 @@ execplan::IDB_Decimal Func_nullif::getDecimalVal(rowgroup::Row& row, exp2.value = value; exp2.scale = 0; } + /* fall through */ case execplan::CalpontSystemCatalog::DOUBLE: case execplan::CalpontSystemCatalog::UDOUBLE: diff --git a/utils/funcexp/func_quarter.cpp b/utils/funcexp/func_quarter.cpp index 6cc4316c4..c1dcda89e 100644 --- a/utils/funcexp/func_quarter.cpp +++ b/utils/funcexp/func_quarter.cpp @@ -130,6 +130,7 @@ int64_t Func_quarter::getIntVal(rowgroup::Row& row, else { isNull = true; + break; } } diff --git a/utils/funcexp/func_second.cpp b/utils/funcexp/func_second.cpp index 45cca7e21..475f7495e 100644 --- a/utils/funcexp/func_second.cpp +++ b/utils/funcexp/func_second.cpp @@ -81,8 +81,9 @@ int64_t Func_second::getIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::DOUBLE: case execplan::CalpontSystemCatalog::FLOAT: { - isNull = true; + isNull = true; } + /* fall through */ case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::CHAR: diff --git a/utils/funcexp/func_strcmp.cpp b/utils/funcexp/func_strcmp.cpp index 743903f42..68584f705 100644 --- a/utils/funcexp/func_strcmp.cpp +++ b/utils/funcexp/func_strcmp.cpp @@ -74,7 +74,7 @@ int64_t Func_strcmp::getIntVal(rowgroup::Row& row, const string& str = fp[0]->data()->getStrVal(row, isNull); const string& str1 = fp[1]->data()->getStrVal(row, isNull); - int ret = cs->strnncoll(str.c_str(), str.length(), str1.c_str(), str1.length()); + int ret = cs->strnncollsp(str.c_str(), str.length(), str1.c_str(), str1.length()); // mysql's strcmp returns only -1, 0, and 1 return (ret < 0 ? -1 : (ret > 0 ? 1 : 0)); } diff --git a/utils/funcexp/func_timediff.cpp b/utils/funcexp/func_timediff.cpp index 5bf16e413..3c629933f 100644 --- a/utils/funcexp/func_timediff.cpp +++ b/utils/funcexp/func_timediff.cpp @@ -129,6 +129,7 @@ string Func_timediff::getStrVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIME: isTime1 = true; + /* fall through */ case execplan::CalpontSystemCatalog::DATETIME: // Diff between time and datetime returns NULL in MariaDB if ((type2 == execplan::CalpontSystemCatalog::TIME || @@ -229,6 +230,7 @@ string Func_timediff::getStrVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::TIME: isTime2 = true; + /* fall through */ case execplan::CalpontSystemCatalog::DATETIME: val2 = parm[1]->data()->getDatetimeIntVal(row, isNull); break; diff --git a/utils/funcexp/functor.h b/utils/funcexp/functor.h index 12dadc83a..c9a74e08c 100644 --- a/utils/funcexp/functor.h +++ b/utils/funcexp/functor.h @@ -170,15 +170,15 @@ public: return getDoubleVal(row, fp, isNull, op_ct); } - const float floatNullVal() const + float floatNullVal() const { return fFloatNullVal; } - const double doubleNullVal() const + double doubleNullVal() const { return fDoubleNullVal; } - const long double longDoubleNullVal() const + long double longDoubleNullVal() const { return fLongDoubleNullVal; } diff --git a/utils/funcexp/functor_str.h b/utils/funcexp/functor_str.h index aa17fde97..8706f918d 100644 --- a/utils/funcexp/functor_str.h +++ b/utils/funcexp/functor_str.h @@ -116,7 +116,7 @@ public: } protected: - const void stringValue(execplan::SPTP& fp, rowgroup::Row& row, bool& isNull, std::string& fFloatStr) + void stringValue(execplan::SPTP& fp, rowgroup::Row& row, bool& isNull, std::string& fFloatStr) { // Bug3788, use the shorter of fixed or scientific notation for floating point values. // [ the default format in treenode.h is fixed-point notation ] diff --git a/utils/messageqcpp/compressed_iss.h b/utils/messageqcpp/compressed_iss.h index ec4ea1292..71c17b2f2 100644 --- a/utils/messageqcpp/compressed_iss.h +++ b/utils/messageqcpp/compressed_iss.h @@ -42,7 +42,9 @@ class CompressedInetStreamSocket : public InetStreamSocket { public: CompressedInetStreamSocket(); + virtual ~CompressedInetStreamSocket(){}; + using InetStreamSocket::operator=; virtual Socket* clone() const; virtual const SBS read(const struct timespec* timeout = 0, bool* isTimeOut = NULL, Stats* stats = NULL) const; diff --git a/utils/messageqcpp/inetstreamsocket.cpp b/utils/messageqcpp/inetstreamsocket.cpp index ef6782e68..df11ac341 100644 --- a/utils/messageqcpp/inetstreamsocket.cpp +++ b/utils/messageqcpp/inetstreamsocket.cpp @@ -1105,7 +1105,7 @@ const string InetStreamSocket::addr2String() const return s; } -const bool InetStreamSocket::isSameAddr(const Socket* rhs) const +bool InetStreamSocket::isSameAddr(const Socket* rhs) const { const InetStreamSocket* issp = dynamic_cast(rhs); diff --git a/utils/messageqcpp/inetstreamsocket.h b/utils/messageqcpp/inetstreamsocket.h index 8cf050691..0851c7720 100644 --- a/utils/messageqcpp/inetstreamsocket.h +++ b/utils/messageqcpp/inetstreamsocket.h @@ -105,7 +105,7 @@ public: /** test if this socket is open * */ - inline virtual const bool isOpen() const; + inline virtual bool isOpen() const; /** read a message from the socket * @@ -180,7 +180,7 @@ public: fSyncProto = use; } - const int getConnectionNum() const + int getConnectionNum() const { return fSocketParms.sd(); } @@ -199,7 +199,7 @@ public: /** compare 2 addresses * */ - virtual const bool isSameAddr(const Socket* rhs) const; + virtual bool isSameAddr(const Socket* rhs) const; /** ping an ip address * @@ -255,7 +255,7 @@ private: void doCopy(const InetStreamSocket& rhs); }; -inline const bool InetStreamSocket::isOpen() const +inline bool InetStreamSocket::isOpen() const { return (fSocketParms.sd() >= 0); } diff --git a/utils/messageqcpp/iosocket.h b/utils/messageqcpp/iosocket.h index 07f6b541b..0d09fa161 100644 --- a/utils/messageqcpp/iosocket.h +++ b/utils/messageqcpp/iosocket.h @@ -119,7 +119,7 @@ public: /** test if the socket is open * */ - inline virtual const bool isOpen() const; + inline virtual bool isOpen() const; /** get the socket params * @@ -150,7 +150,7 @@ public: fSocket->syncProto(use); } - EXPORT virtual const int getConnectionNum() const; + EXPORT virtual int getConnectionNum() const; // Debug EXPORT void setSockID(uint32_t id) @@ -175,7 +175,7 @@ public: /** * @brief compare 2 addresses */ - virtual const bool isSameAddr(const IOSocket* rhs) const + virtual bool isSameAddr(const IOSocket* rhs) const { return fSocket->isSameAddr(rhs->fSocket); } @@ -235,7 +235,7 @@ inline void IOSocket::close() { if (fSocket) fSocket->close(); } -inline const bool IOSocket::isOpen() const +inline bool IOSocket::isOpen() const { return (fSocket && fSocket->isOpen()); } @@ -274,7 +274,7 @@ inline void IOSocket::setSocketImpl(Socket* socket) delete fSocket; fSocket = socket; } -inline const int IOSocket::getConnectionNum() const +inline int IOSocket::getConnectionNum() const { return fSocket->getConnectionNum(); } diff --git a/utils/messageqcpp/messagequeue.h b/utils/messageqcpp/messagequeue.h index ca4d1f389..265fe0d3a 100644 --- a/utils/messageqcpp/messagequeue.h +++ b/utils/messageqcpp/messagequeue.h @@ -237,7 +237,7 @@ public: { return fOtherEnd; } - EXPORT const bool isAvailable() const + EXPORT bool isAvailable() const { return fIsAvailable; } @@ -267,7 +267,7 @@ public: /** * @brief compare the addresses of 2 MessageQueueClient */ - inline const bool isSameAddr(const MessageQueueClient& rhs) const; + inline bool isSameAddr(const MessageQueueClient& rhs) const; bool isConnected() { @@ -316,7 +316,7 @@ inline const std::string MessageQueueClient::addr2String() const { return fClientSock.addr2String(); } -inline const bool MessageQueueClient::isSameAddr(const MessageQueueClient& rhs) const +inline bool MessageQueueClient::isSameAddr(const MessageQueueClient& rhs) const { return fClientSock.isSameAddr(&rhs.fClientSock); } diff --git a/utils/messageqcpp/socket.h b/utils/messageqcpp/socket.h index 15268f174..41c5e4628 100644 --- a/utils/messageqcpp/socket.h +++ b/utils/messageqcpp/socket.h @@ -126,7 +126,7 @@ public: /** test if this socket is open * */ - virtual const bool isOpen() const = 0; + virtual bool isOpen() const = 0; /** get the SocketParms * @@ -158,7 +158,7 @@ public: */ virtual void syncProto(bool use) = 0; - virtual const int getConnectionNum() const = 0; + virtual int getConnectionNum() const = 0; /** return the address as a string * @@ -168,7 +168,7 @@ public: /** compare 2 addresses * */ - virtual const bool isSameAddr(const Socket* rhs) const = 0; + virtual bool isSameAddr(const Socket* rhs) const = 0; virtual bool isConnected() const = 0; virtual bool hasData() const = 0; diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index 5c02d0c48..b59ce6542 100755 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -1709,6 +1709,7 @@ void RowAggregation::updateEntry(const Row& rowIn) // if NOT null, let execution fall through. if (isNull(&fRowGroupIn, rowIn, colIn) == true) break; + /* fall through */ case ROWAGG_COUNT_ASTERISK: fRow.setUintField<8>(fRow.getUintField<8>(colOut) + 1, colOut); @@ -2467,6 +2468,7 @@ void RowAggregationUM::updateEntry(const Row& rowIn) // if NOT null, let execution fall through. if (isNull(&fRowGroupIn, rowIn, colIn) == true) break; + /* fall through */ case ROWAGG_COUNT_ASTERISK: fRow.setUintField<8>(fRow.getUintField<8>(colOut) + 1, colOut); diff --git a/utils/rowgroup/rowaggregation.h b/utils/rowgroup/rowaggregation.h index 5a51f90af..f0d50381f 100644 --- a/utils/rowgroup/rowaggregation.h +++ b/utils/rowgroup/rowaggregation.h @@ -1096,9 +1096,12 @@ public: const std::vector& funct); void setInputOutput(const RowGroup& pRowGroupIn, RowGroup* pRowGroupOut); + using RowAggregationDistinct::addRowGroup; void addRowGroup(const RowGroup* pRowGroupIn); + using RowAggregationDistinct::doDistinctAggregation; virtual void doDistinctAggregation(); + using RowAggregationDistinct::doDistinctAggregation_rowVec; virtual void doDistinctAggregation_rowVec(std::vector >& inRows); inline virtual RowAggregationMultiDistinct* clone() const diff --git a/utils/rowgroup/rowgroup.cpp b/utils/rowgroup/rowgroup.cpp index 2bfcca9fc..f3922fbe3 100644 --- a/utils/rowgroup/rowgroup.cpp +++ b/utils/rowgroup/rowgroup.cpp @@ -744,6 +744,7 @@ void Row::initToNull() case CalpontSystemCatalog::LONGDOUBLE: *((long double*) &data[offsets[i]]) = joblist::LONGDOUBLENULL; + break; case CalpontSystemCatalog::DATETIME: *((uint64_t*) &data[offsets[i]]) = joblist::DATETIMENULL; diff --git a/utils/threadpool/prioritythreadpool.cpp b/utils/threadpool/prioritythreadpool.cpp index ebed4e9c9..ce1d3c388 100644 --- a/utils/threadpool/prioritythreadpool.cpp +++ b/utils/threadpool/prioritythreadpool.cpp @@ -277,7 +277,7 @@ void PriorityThreadPool::threadFcn(const Priority preferredQueue) throw() void PriorityThreadPool::sendErrorMsg(uint32_t id, uint32_t step, primitiveprocessor::SP_UM_IOSOCK sock) { ISMPacketHeader ism; - PrimitiveHeader ph = {}; + PrimitiveHeader ph = {0,0,0,0,0,0}; ism.Status = logging::primitiveServerErr; ph.UniqueID = id; diff --git a/versioning/BRM/dbrm.cpp b/versioning/BRM/dbrm.cpp index dff639666..67c1d639b 100644 --- a/versioning/BRM/dbrm.cpp +++ b/versioning/BRM/dbrm.cpp @@ -3257,7 +3257,7 @@ boost::shared_array DBRM::SIDTIDMap(int& len) return ret; } -const uint32_t DBRM::getUnique32() +uint32_t DBRM::getUnique32() { #ifdef BRM_INFO @@ -3306,7 +3306,7 @@ const uint32_t DBRM::getUnique32() return ret; } -const uint64_t DBRM::getUnique64() +uint64_t DBRM::getUnique64() { #ifdef BRM_INFO diff --git a/versioning/BRM/dbrm.h b/versioning/BRM/dbrm.h index 1aac747f4..db112a9fb 100644 --- a/versioning/BRM/dbrm.h +++ b/versioning/BRM/dbrm.h @@ -791,8 +791,8 @@ public: /* Note, these pull #s from two separate sequences. That is, they both return 0, then 1, 2, 3, etc. */ - EXPORT const uint32_t getUnique32(); - EXPORT const uint64_t getUnique64(); + EXPORT uint32_t getUnique32(); + EXPORT uint64_t getUnique64(); /* New table lock interface */ /* returns a unique ID (> 0) for the lock on success, 0 on failure. diff --git a/writeengine/bulk/cpimport.cpp b/writeengine/bulk/cpimport.cpp index 4a878210a..c54fc2ee3 100644 --- a/writeengine/bulk/cpimport.cpp +++ b/writeengine/bulk/cpimport.cpp @@ -418,6 +418,7 @@ void parseCmdLineArgs( case 'h': // -h: help { printUsage(); + break; } case 'i': // -i: log info to console diff --git a/writeengine/bulk/we_bulkloadbuffer.h b/writeengine/bulk/we_bulkloadbuffer.h index 2d1094d5a..b5e817741 100644 --- a/writeengine/bulk/we_bulkloadbuffer.h +++ b/writeengine/bulk/we_bulkloadbuffer.h @@ -357,7 +357,7 @@ public: * TableInfo::fSyncUpdatesTI mutex should be locked when calling this * function (see fColumnLocks discussion). */ - const int getColumnLocker(const int& columnId) const + int getColumnLocker(const int& columnId) const { return fColumnLocks[columnId].locker; } diff --git a/writeengine/bulk/we_colbufmgr.h b/writeengine/bulk/we_colbufmgr.h index 574c8facc..30d0a5017 100644 --- a/writeengine/bulk/we_colbufmgr.h +++ b/writeengine/bulk/we_colbufmgr.h @@ -272,6 +272,7 @@ public: virtual ~ColumnBufferManagerDctnry(); virtual int rowsExtentCheck( int nRows, int& nRows2 ); + using ColumnBufferManager::writeToFileExtentCheck; virtual int writeToFileExtentCheck(uint32_t startOffset, uint32_t writeSize); }; diff --git a/writeengine/dictionary/we_dctnry.cpp b/writeengine/dictionary/we_dctnry.cpp index df87a9789..5b5473b8f 100644 --- a/writeengine/dictionary/we_dctnry.cpp +++ b/writeengine/dictionary/we_dctnry.cpp @@ -222,7 +222,7 @@ int Dctnry::createDctnry( const OID& dctnryOID, int colWidth, } rc = BRMWrapper::getInstance()->allocateDictStoreExtent( - (const OID)m_dctnryOID, m_dbRoot, m_partition, m_segment, + (OID)m_dctnryOID, m_dbRoot, m_partition, m_segment, startLbid, allocSize); if (rc != NO_ERROR) diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index bf805870e..191dd56ea 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -3033,6 +3033,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, // else // fall through to integer cases } + /* fall through */ case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::UBIGINT: @@ -3377,6 +3378,7 @@ uint8_t WE_DMLCommandProc::processUpdate(messageqcpp::ByteStream& bs, // else // fall through to integer cases } + /* fall through */ case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::UBIGINT: diff --git a/writeengine/shared/we_bulkrollbackmgr.h b/writeengine/shared/we_bulkrollbackmgr.h index 691080816..433dcdadd 100644 --- a/writeengine/shared/we_bulkrollbackmgr.h +++ b/writeengine/shared/we_bulkrollbackmgr.h @@ -119,7 +119,7 @@ public: /** * @brief Mutator to enable/disable debug logging to console. */ - const void setDebugConsole ( bool debug ) + void setDebugConsole ( bool debug ) { fDebugConsole = debug; } diff --git a/writeengine/shared/we_cache.cpp b/writeengine/shared/we_cache.cpp index 87c31a9a5..227f19927 100644 --- a/writeengine/shared/we_cache.cpp +++ b/writeengine/shared/we_cache.cpp @@ -95,7 +95,7 @@ void Cache::clear() * RETURN: * NO_ERROR if success, other otherwise ***********************************************************/ -const int Cache::flushCache() +int Cache::flushCache() { bool bHasReadBlock = false; BlockBuffer* curBuf; @@ -216,7 +216,7 @@ void Cache::freeMemory() * RETURN: * NO_ERROR if success, other otherwise ***********************************************************/ -const int Cache::getListSize( const CacheListType listType ) +int Cache::getListSize( const CacheListType listType ) { int size = 0; @@ -287,7 +287,7 @@ void Cache::init( const int totalBlock, const int chkPoint, const int pctFree ) * RETURN: * NO_ERROR if success, other otherwise ***********************************************************/ -const int Cache::insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf ) +int Cache::insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf ) { BlockBuffer* buffer; vector::iterator it; @@ -322,7 +322,7 @@ const int Cache::insertLRUList( CommBlock& cb, const uint64_t lbid, const uint6 * RETURN: * NO_ERROR if success, other otherwise ***********************************************************/ -const int Cache::loadCacheBlock( const CacheKey& key, unsigned char* buf ) +int Cache::loadCacheBlock( const CacheKey& key, unsigned char* buf ) { BlockBuffer* buffer; CacheMapIt iter; @@ -356,7 +356,7 @@ const int Cache::loadCacheBlock( const CacheKey& key, unsigned char* buf ) * RETURN: * NO_ERROR if success, other otherwise ***********************************************************/ -const int Cache::modifyCacheBlock( const CacheKey& key, const unsigned char* buf ) +int Cache::modifyCacheBlock( const CacheKey& key, const unsigned char* buf ) { BlockBuffer* buffer; CacheMapIt iter; @@ -437,7 +437,7 @@ void Cache::printCacheList() * RETURN: * NO_ERROR if success, other otherwise ***********************************************************/ -const int Cache::processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType ) +int Cache::processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType ) { RETURN_ON_NULL( buffer, ERR_NULL_BLOCK ); CacheMapIt iter; diff --git a/writeengine/shared/we_cache.h b/writeengine/shared/we_cache.h index 07f845ca5..70d302851 100644 --- a/writeengine/shared/we_cache.h +++ b/writeengine/shared/we_cache.h @@ -100,16 +100,16 @@ public: /** * @brief Check whether cache key exists */ - static const bool cacheKeyExist( CacheMap* map, const OID oid, const uint64_t lbid ) + static bool cacheKeyExist( CacheMap* map, const OID oid, const uint64_t lbid ) { CacheKey key = getCacheKey( oid, lbid ); return map->find(key) == map->end() ? false : true; } - static const bool cacheKeyExist( CacheMap* map, BlockBuffer* buffer ) + static bool cacheKeyExist( CacheMap* map, BlockBuffer* buffer ) { return cacheKeyExist( map, (*buffer).cb.file.oid, (*buffer).block.lbid ); } - static const bool cacheKeyExist( const OID oid, const uint64_t lbid ) + static bool cacheKeyExist( const OID oid, const uint64_t lbid ) { return cacheKeyExist( m_lruList, oid, lbid ) || cacheKeyExist( m_writeList, oid, lbid ); } @@ -127,7 +127,7 @@ public: /** * @brief Flush the write cache */ - EXPORT static const int flushCache(); + EXPORT static int flushCache(); /** * @brief Get the cache key @@ -142,7 +142,7 @@ public: return getCacheKey( (*buffer).cb.file.oid, (*buffer).block.lbid ); } - EXPORT static const int getListSize( const CacheListType listType ); + EXPORT static int getListSize( const CacheListType listType ); /** * @brief Init the buffers @@ -156,8 +156,8 @@ public: /** * @brief Insert into LRU list */ - EXPORT static const int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf ); - static const int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const DataBlock& block ) + EXPORT static int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const unsigned char* buf ); + static int insertLRUList( CommBlock& cb, const uint64_t lbid, const uint64_t fbo, const DataBlock& block ) { return insertLRUList( cb, lbid, fbo, block.data ); } @@ -170,20 +170,20 @@ public: /** * @brief Load cache block to a buffer */ - static const int loadCacheBlock( const CacheKey& key, DataBlock& block ) + static int loadCacheBlock( const CacheKey& key, DataBlock& block ) { return loadCacheBlock( key, block.data ); } - EXPORT static const int loadCacheBlock( const CacheKey& key, unsigned char* buf ); + EXPORT static int loadCacheBlock( const CacheKey& key, unsigned char* buf ); /** * @brief Modify a cache block */ - static const int modifyCacheBlock( const CacheKey& key, const DataBlock& block ) + static int modifyCacheBlock( const CacheKey& key, const DataBlock& block ) { return modifyCacheBlock( key, block.data ); } - EXPORT static const int modifyCacheBlock( const CacheKey& key, const unsigned char* buf ); + EXPORT static int modifyCacheBlock( const CacheKey& key, const unsigned char* buf ); /** * @brief Print @@ -194,14 +194,14 @@ public: /** * @brief Insert/Delete an element in cache map */ - EXPORT static const int processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType ); + EXPORT static int processCacheMap( CacheMap* map, BlockBuffer* buffer, OpType opType ); // accessory - static const int getTotalBlock() + static int getTotalBlock() { return m_cacheParam->totalBlock; } - static const bool getUseCache() + static bool getUseCache() { return m_useCache; } diff --git a/writeengine/shared/we_dbfileop.cpp b/writeengine/shared/we_dbfileop.cpp index f92b883f2..a2f7e4b36 100644 --- a/writeengine/shared/we_dbfileop.cpp +++ b/writeengine/shared/we_dbfileop.cpp @@ -217,7 +217,7 @@ int DbFileOp::readDBFile( CommBlock& cb, * NO_ERROR if success * other number if something wrong ***********************************************************/ -const int DbFileOp::readSubBlockEntry( IDBDataFile* pFile, DataBlock* block, +int DbFileOp::readSubBlockEntry( IDBDataFile* pFile, DataBlock* block, const uint64_t lbid, const int sbid, const int entryNo, const int width, void* pStruct ) @@ -229,7 +229,7 @@ const int DbFileOp::readSubBlockEntry( IDBDataFile* pFile, DataBlock* block, } -const int DbFileOp::readSubBlockEntry( CommBlock& cb, DataBlock* block, +int DbFileOp::readSubBlockEntry( CommBlock& cb, DataBlock* block, const uint64_t lbid, const int sbid, const int entryNo, const int width, void* pStruct ) @@ -406,7 +406,7 @@ int DbFileOp::writeDBFileFbo(IDBDataFile* pFile, const unsigned char* writeBuf, * NO_ERROR if success * other number if something wrong ***********************************************************/ -const int DbFileOp::writeSubBlockEntry( IDBDataFile* pFile, DataBlock* block, +int DbFileOp::writeSubBlockEntry( IDBDataFile* pFile, DataBlock* block, const uint64_t lbid, const int sbid, const int entryNo, const int width, void* pStruct ) @@ -417,7 +417,7 @@ const int DbFileOp::writeSubBlockEntry( IDBDataFile* pFile, DataBlock* block, return writeDBFile( pFile, block->data, lbid ); } -const int DbFileOp::writeSubBlockEntry( CommBlock& cb, DataBlock* block, +int DbFileOp::writeSubBlockEntry( CommBlock& cb, DataBlock* block, const uint64_t lbid, const int sbid, const int entryNo, const int width, void* pStruct ) @@ -438,7 +438,7 @@ const int DbFileOp::writeSubBlockEntry( CommBlock& cb, DataBlock* block, * NO_ERROR if success * other number if something wrong ***********************************************************/ -const int DbFileOp::writeVB( IDBDataFile* pFile, const OID oid, const uint64_t lbid ) +int DbFileOp::writeVB( IDBDataFile* pFile, const OID oid, const uint64_t lbid ) { if ( !BRMWrapper::getUseVb() ) return NO_ERROR; diff --git a/writeengine/shared/we_dbfileop.h b/writeengine/shared/we_dbfileop.h index 6df3441bd..1ec160573 100644 --- a/writeengine/shared/we_dbfileop.h +++ b/writeengine/shared/we_dbfileop.h @@ -105,7 +105,7 @@ public: * @brief Get an entry within a subblock and also populate block buffer * */ - EXPORT const int readSubBlockEntry(IDBDataFile* pFile, + EXPORT int readSubBlockEntry(IDBDataFile* pFile, DataBlock* block, const uint64_t lbid, const int sbid, @@ -113,7 +113,7 @@ public: const int width, void* pStruct ) ; - EXPORT const int readSubBlockEntry(CommBlock& cb, + EXPORT int readSubBlockEntry(CommBlock& cb, DataBlock* block, const uint64_t lbid, const int sbid, @@ -196,7 +196,7 @@ public: /** * @brief Write a sub block entry directly to a DB file */ - EXPORT const int writeSubBlockEntry(IDBDataFile* pFile, + EXPORT int writeSubBlockEntry(IDBDataFile* pFile, DataBlock* block, const uint64_t lbid, const int sbid, @@ -204,7 +204,7 @@ public: const int width, void* pStruct ); - EXPORT const int writeSubBlockEntry(CommBlock& cb, + EXPORT int writeSubBlockEntry(CommBlock& cb, DataBlock* block, const uint64_t lbid, const int sbid, @@ -215,7 +215,7 @@ public: /** * @brief Write to version buffer */ - EXPORT const int writeVB( IDBDataFile* pFile, + EXPORT int writeVB( IDBDataFile* pFile, const OID oid, const uint64_t lbid ); diff --git a/writeengine/shared/we_dbrootextenttracker.h b/writeengine/shared/we_dbrootextenttracker.h index f8eaf2f94..b7d0c3618 100644 --- a/writeengine/shared/we_dbrootextenttracker.h +++ b/writeengine/shared/we_dbrootextenttracker.h @@ -200,7 +200,7 @@ public: /** @brief get the CurrentDBRootIdx */ - inline const int getCurrentDBRootIdx() + inline int getCurrentDBRootIdx() { boost::mutex::scoped_lock lock(fDBRootExtTrkMutex); return fCurrentDBRootIdx; diff --git a/writeengine/shared/we_fileop.cpp b/writeengine/shared/we_fileop.cpp index d81a1927f..8c0623d66 100644 --- a/writeengine/shared/we_fileop.cpp +++ b/writeengine/shared/we_fileop.cpp @@ -256,7 +256,7 @@ int FileOp::createFile(FID fid, BRM::LBID_t startLbid; uint32_t startBlock; RETURN_ON_ERROR( BRMWrapper::getInstance()->allocateColExtentExactFile( - (const OID)fid, (uint32_t)width, dbRootx, partitionx, segment, colDataType, + (OID)fid, (uint32_t)width, dbRootx, partitionx, segment, colDataType, startLbid, allocSize, startBlock) ); // We allocate a full extent from BRM, but only write an abbreviated 256K diff --git a/writeengine/shared/we_obj.h b/writeengine/shared/we_obj.h index 6db130ff2..52019d23b 100644 --- a/writeengine/shared/we_obj.h +++ b/writeengine/shared/we_obj.h @@ -49,7 +49,7 @@ public: /** * @brief Is it required to debug */ - const bool isDebug( const DebugLevel level ) const + bool isDebug( const DebugLevel level ) const { return level <= m_debugLevel; } @@ -57,7 +57,7 @@ public: /** * @brief Get debug level */ - const DebugLevel getDebugLevel() const + DebugLevel getDebugLevel() const { return m_debugLevel; }