You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-05 16:15:50 +03:00
MSan added with fixes for libc++
This commit is contained in:
@@ -32,7 +32,7 @@ source "$SCRIPT_LOCATION"/utils.sh
|
||||
|
||||
echo "Arguments received: $@"
|
||||
|
||||
optparse.define short=A long=asan desc="Build with ASAN" variable=ASAN default=false value=true
|
||||
optparse.define short=A long=asan desc="Build with ASan" variable=ASAN default=false value=true
|
||||
optparse.define short=a long=build-path desc="Path for build output" variable=MARIA_BUILD_PATH default=$DEFAULT_MARIA_BUILD_PATH
|
||||
optparse.define short=B long=run-microbench desc="Compile and run microbenchmarks " variable=RUN_BENCHMARKS default=false value=true
|
||||
optparse.define short=c long=cloud desc="Enable cloud storage" variable=CLOUD_STORAGE_ENABLED default=false value=true
|
||||
@@ -44,7 +44,8 @@ optparse.define short=f long=do-not-freeze-revision desc="Disable revision freez
|
||||
optparse.define short=g long=alien desc="Turn off maintainer mode (ex. -Werror)" variable=MAINTAINER_MODE default=true value=false
|
||||
optparse.define short=G long=draw-deps desc="Draw dependencies graph" variable=DRAW_DEPS default=false value=true
|
||||
optparse.define short=j long=parallel desc="Number of paralles for build" variable=CPUS default=$(getconf _NPROCESSORS_ONLN)
|
||||
optparse.define short=M long=skip-smoke desc="Skip final smoke test" variable=SKIP_SMOKE default=false value=true
|
||||
optparse.define short=M long=msan desc="Build with MSan" variable=MSAN default=false value=true
|
||||
optparse.define short=m long=skip-smoke desc="Skip final smoke test" variable=SKIP_SMOKE default=false value=true
|
||||
optparse.define short=N long=ninja desc="Build with ninja" variable=USE_NINJA default=false value=true
|
||||
optparse.define short=n long=no-clean-install desc="Do not perform a clean install (keep existing db files)" variable=NO_CLEAN default=false value=true
|
||||
optparse.define short=o long=recompile-only variable=RECOMPILE_ONLY default=false value=true
|
||||
@@ -55,9 +56,9 @@ optparse.define short=r long=restart-services variable=RESTART_SERVICES default=
|
||||
optparse.define short=R long=gcc-toolset-for-rocky-8 variable=GCC_TOOLSET default=false value=true
|
||||
optparse.define short=S long=skip-columnstore-submodules desc="Skip columnstore submodules initialization" variable=SKIP_SUBMODULES default=false value=true
|
||||
optparse.define short=t long=build-type desc="Build Type: ${BUILD_TYPE_OPTIONS[*]}" variable=MCS_BUILD_TYPE
|
||||
optparse.define short=T long=tsan desc="Build with TSAN" variable=TSAN default=false value=true
|
||||
optparse.define short=T long=tsan desc="Build with TSan" variable=TSAN default=false value=true
|
||||
optparse.define short=u long=skip-unit-tests desc="Skip UnitTests" variable=SKIP_UNIT_TESTS default=false value=true
|
||||
optparse.define short=U long=ubsan desc="Build with UBSAN" variable=UBSAN default=false value=true
|
||||
optparse.define short=U long=ubsan desc="Build with UBSan" variable=UBSAN default=false value=true
|
||||
optparse.define short=v long=verbose desc="Verbose makefile commands" variable=MAKEFILE_VERBOSE default=false value=true
|
||||
optparse.define short=V long=add-branch-name-to-outdir desc="Add branch name to build output directory" variable=BRANCH_NAME_TO_OUTDIR default=false value=true
|
||||
optparse.define short=W long=without-core-dumps desc="Do not produce core dumps" variable=WITHOUT_COREDUMPS default=false value=true
|
||||
@@ -397,6 +398,11 @@ construct_cmake_flags() {
|
||||
MDB_CMAKE_FLAGS+=(-DWITH_UBSAN=ON -DWITH_COLUMNSTORE_REPORT_PATH=${REPORT_PATH})
|
||||
fi
|
||||
|
||||
if [[ $MSAN = true ]]; then
|
||||
warn "Building with Memory Sanitizer"
|
||||
MDB_CMAKE_FLAGS+=(-DWITH_MSAN=ON -DWITH_COLUMNSTORE_REPORT_PATH=${REPORT_PATH})
|
||||
fi
|
||||
|
||||
if [[ $WITHOUT_COREDUMPS = true ]]; then
|
||||
warn "Cores are not dumped"
|
||||
else
|
||||
|
@@ -22,6 +22,10 @@ set(Boost_LIBRARY_DIRS "${INSTALL_LOCATION}/lib")
|
||||
link_directories("${Boost_LIBRARY_DIRS}")
|
||||
|
||||
set(_cxxargs "-fPIC -DBOOST_NO_AUTO_PTR -fvisibility=default")
|
||||
if(WITH_MSAN)
|
||||
set(_cxxargs "${_cxxargs} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++")
|
||||
endif()
|
||||
|
||||
set(_b2args cxxflags=${_cxxargs};cflags=-fPIC;threading=multi;${_extra};toolset=${_toolset}
|
||||
--without-mpi;--without-charconv;--without-python;--prefix=${INSTALL_LOCATION}
|
||||
)
|
||||
|
@@ -33,6 +33,11 @@ set(THRIFT_INCLUDE_DIRS "${INSTALL_LOCATION}/include")
|
||||
set(THRIFT_LIBRARY_DIRS "${INSTALL_LOCATION}/lib")
|
||||
set(THRIFT_LIBRARY ${THRIFT_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX})
|
||||
|
||||
set(cxxflags -fPIC)
|
||||
if(WITH_MSAN)
|
||||
set(cxxflags "'${cxxflags} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++'")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
external_thrift
|
||||
URL https://github.com/apache/thrift/archive/refs/tags/v0.22.0.tar.gz
|
||||
@@ -49,10 +54,19 @@ ExternalProject_Add(
|
||||
-DBUILD_PYTHON=NO
|
||||
-DBUILD_TESTING=NO
|
||||
-DBUILD_SHARED_LIBS=NO
|
||||
-DCMAKE_CXX_FLAGS:STRING="-fPIC"
|
||||
-DBUILD_TUTORIALS=NO
|
||||
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_CXX_FLAGS:STRING=${cxxflags}
|
||||
-DBOOST_ROOT=${BOOST_ROOT}
|
||||
BUILD_BYPRODUCTS "${THRIFT_LIBRARY_DIRS}/${CMAKE_STATIC_LIBRARY_PREFIX}thrift${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||
EXCLUDE_FROM_ALL TRUE
|
||||
)
|
||||
|
||||
ExternalProject_Add_Step(
|
||||
external_thrift print_cmake_flags
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "!!!!!!!! CXX_FLAGS: ${CMAKE_CXX_FLAGS}"
|
||||
DEPENDEES configure
|
||||
)
|
||||
|
||||
add_dependencies(external_thrift external_boost)
|
||||
|
@@ -19,18 +19,18 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stack>
|
||||
#include <tr1/unordered_map>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <tr1/unordered_set>
|
||||
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
using namespace std;
|
||||
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
#include <unordered.h>
|
||||
#include "dataconvert.h"
|
||||
using namespace dataconvert;
|
||||
|
||||
|
@@ -35,8 +35,6 @@ typedef int32_t mcs_sint32_t;
|
||||
struct charset_info_st;
|
||||
typedef const struct charset_info_st CHARSET_INFO;
|
||||
|
||||
using namespace std; // e.g. string
|
||||
|
||||
namespace ddlpackage
|
||||
{
|
||||
struct ColumnType;
|
||||
@@ -1019,8 +1017,8 @@ class TypeHandler
|
||||
static const TypeHandler* find_by_ddltype(const ddlpackage::ColumnType& ct);
|
||||
virtual ~TypeHandler() = default;
|
||||
|
||||
virtual const string& name() const = 0;
|
||||
virtual const string print(const SystemCatalog::TypeAttributesStd& /*attr*/) const
|
||||
virtual const std::string& name() const = 0;
|
||||
virtual const std::string print(const SystemCatalog::TypeAttributesStd& /*attr*/) const
|
||||
{
|
||||
return name();
|
||||
}
|
||||
@@ -1062,7 +1060,7 @@ class TypeHandler
|
||||
virtual MinMaxPartitionInfo getExtentPartitionInfo(const SystemCatalog::TypeAttributesStd& attr,
|
||||
BRM::DBRM& em, const BRM::EMEntry& entry,
|
||||
int* state) const;
|
||||
virtual string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
virtual std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const
|
||||
@@ -1086,7 +1084,7 @@ class TypeHandler
|
||||
// QQ: perhaps not needed yet
|
||||
class TypeHandlerBit : public TypeHandler
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::BIT;
|
||||
@@ -1155,7 +1153,7 @@ class TypeHandlerInt : public TypeHandler
|
||||
class TypeHandlerSInt8 : public TypeHandlerInt
|
||||
{
|
||||
public:
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::TINYINT;
|
||||
@@ -1202,7 +1200,7 @@ class TypeHandlerSInt8 : public TypeHandlerInt
|
||||
class TypeHandlerSInt16 : public TypeHandlerInt
|
||||
{
|
||||
public:
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::SMALLINT;
|
||||
@@ -1248,7 +1246,7 @@ class TypeHandlerSInt16 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerSInt24 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::MEDINT;
|
||||
@@ -1297,7 +1295,7 @@ class TypeHandlerSInt24 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerSInt32 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::INT;
|
||||
@@ -1346,7 +1344,7 @@ class TypeHandlerSInt32 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerSInt64 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::BIGINT;
|
||||
@@ -1392,7 +1390,7 @@ class TypeHandlerSInt64 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerUInt8 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UTINYINT;
|
||||
@@ -1435,7 +1433,7 @@ class TypeHandlerUInt8 : public TypeHandlerInt
|
||||
{
|
||||
return MinMaxInfo::widenUInt64(a, b);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1457,7 +1455,7 @@ class TypeHandlerUInt8 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerUInt16 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::USMALLINT;
|
||||
@@ -1499,7 +1497,7 @@ class TypeHandlerUInt16 : public TypeHandlerInt
|
||||
{
|
||||
return MinMaxInfo::widenUInt64(a, b);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1521,7 +1519,7 @@ class TypeHandlerUInt16 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerUInt24 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UMEDINT;
|
||||
@@ -1566,7 +1564,7 @@ class TypeHandlerUInt24 : public TypeHandlerInt
|
||||
{
|
||||
return MinMaxInfo::widenUInt64(a, b);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1588,7 +1586,7 @@ class TypeHandlerUInt24 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerUInt32 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UINT;
|
||||
@@ -1633,7 +1631,7 @@ class TypeHandlerUInt32 : public TypeHandlerInt
|
||||
{
|
||||
return MinMaxInfo::widenUInt64(a, b);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1655,7 +1653,7 @@ class TypeHandlerUInt32 : public TypeHandlerInt
|
||||
|
||||
class TypeHandlerUInt64 : public TypeHandlerInt
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::BIGINT;
|
||||
@@ -1697,7 +1695,7 @@ class TypeHandlerUInt64 : public TypeHandlerInt
|
||||
{
|
||||
return MinMaxInfo::widenUInt64(a, b);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1739,9 +1737,10 @@ class TypeHandlerXDecimal : public TypeHandler
|
||||
const BRM::EMEntry& entry, int* state) const;
|
||||
MinMaxPartitionInfo getExtentPartitionInfo128(const SystemCatalog::TypeAttributesStd& attr, BRM::DBRM& em,
|
||||
const BRM::EMEntry& entry, int* state) const;
|
||||
string PrintPartitionValue128(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue128(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal, round_style_t rfMax) const;
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const;
|
||||
|
||||
public:
|
||||
size_t ColWriteBatch(WriteBatchField* field, const unsigned char* buf, bool nullVal,
|
||||
@@ -1760,7 +1759,7 @@ class TypeHandlerXDecimal : public TypeHandler
|
||||
class TypeHandlerSDecimal64 : public TypeHandlerXDecimal
|
||||
{
|
||||
public:
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::DECIMAL;
|
||||
@@ -1804,7 +1803,7 @@ class TypeHandlerSDecimal64 : public TypeHandlerXDecimal
|
||||
{
|
||||
return getExtentPartitionInfo64(attr, em, entry, state);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1826,7 +1825,7 @@ class TypeHandlerSDecimal64 : public TypeHandlerXDecimal
|
||||
class TypeHandlerUDecimal64 : public TypeHandlerXDecimal
|
||||
{
|
||||
public:
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UDECIMAL;
|
||||
@@ -1870,7 +1869,7 @@ class TypeHandlerUDecimal64 : public TypeHandlerXDecimal
|
||||
{
|
||||
return getExtentPartitionInfo64(attr, em, entry, state);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1892,7 +1891,7 @@ class TypeHandlerUDecimal64 : public TypeHandlerXDecimal
|
||||
class TypeHandlerSDecimal128 : public TypeHandlerXDecimal
|
||||
{
|
||||
public:
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::DECIMAL;
|
||||
@@ -1936,7 +1935,7 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal
|
||||
{
|
||||
return getExtentPartitionInfo128(attr, em, entry, state);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -1958,7 +1957,7 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal
|
||||
class TypeHandlerUDecimal128 : public TypeHandlerXDecimal
|
||||
{
|
||||
public:
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UDECIMAL;
|
||||
@@ -2002,7 +2001,7 @@ class TypeHandlerUDecimal128 : public TypeHandlerXDecimal
|
||||
{
|
||||
return getExtentPartitionInfo128(attr, em, entry, state);
|
||||
}
|
||||
string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
std::string PrintPartitionValue(const SystemCatalog::TypeAttributesStd& attr,
|
||||
const MinMaxPartitionInfo& partInfo, const SimpleValue& startVal,
|
||||
round_style_t rfMin, const SimpleValue& endVal,
|
||||
round_style_t rfMax) const override
|
||||
@@ -2043,7 +2042,7 @@ class TypeHandlerReal : public TypeHandler
|
||||
|
||||
class TypeHandlerSFloat : public TypeHandlerReal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::FLOAT;
|
||||
@@ -2071,7 +2070,7 @@ class TypeHandlerSFloat : public TypeHandlerReal
|
||||
|
||||
class TypeHandlerSDouble : public TypeHandlerReal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::DOUBLE;
|
||||
@@ -2099,7 +2098,7 @@ class TypeHandlerSDouble : public TypeHandlerReal
|
||||
|
||||
class TypeHandlerUFloat : public TypeHandlerReal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UFLOAT;
|
||||
@@ -2127,7 +2126,7 @@ class TypeHandlerUFloat : public TypeHandlerReal
|
||||
|
||||
class TypeHandlerUDouble : public TypeHandlerReal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::UDOUBLE;
|
||||
@@ -2155,7 +2154,7 @@ class TypeHandlerUDouble : public TypeHandlerReal
|
||||
|
||||
class TypeHandlerSLongDouble : public TypeHandlerReal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::LONGDOUBLE;
|
||||
@@ -2219,14 +2218,14 @@ class TypeHandlerStr : public TypeHandler
|
||||
|
||||
class TypeHandlerChar : public TypeHandlerStr
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::CHAR;
|
||||
}
|
||||
const string print(const SystemCatalog::TypeAttributesStd& attr) const override
|
||||
const std::string print(const SystemCatalog::TypeAttributesStd& attr) const override
|
||||
{
|
||||
ostringstream oss;
|
||||
std::ostringstream oss;
|
||||
oss << name() << "(" << attr.colWidth << ")";
|
||||
return oss.str();
|
||||
}
|
||||
@@ -2256,14 +2255,14 @@ class TypeHandlerChar : public TypeHandlerStr
|
||||
|
||||
class TypeHandlerVarchar : public TypeHandlerStr
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::VARCHAR;
|
||||
}
|
||||
const string print(const SystemCatalog::TypeAttributesStd& attr) const override
|
||||
const std::string print(const SystemCatalog::TypeAttributesStd& attr) const override
|
||||
{
|
||||
ostringstream oss;
|
||||
std::ostringstream oss;
|
||||
oss << name() << "(" << attr.colWidth << ")";
|
||||
return oss.str();
|
||||
}
|
||||
@@ -2297,7 +2296,7 @@ class TypeHandlerVarchar : public TypeHandlerStr
|
||||
|
||||
class TypeHandlerVarbinary : public TypeHandlerStr
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::VARBINARY;
|
||||
@@ -2317,7 +2316,7 @@ class TypeHandlerVarbinary : public TypeHandlerStr
|
||||
|
||||
class TypeHandlerBlob : public TypeHandlerStr
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::BLOB;
|
||||
@@ -2344,7 +2343,7 @@ class TypeHandlerBlob : public TypeHandlerStr
|
||||
|
||||
class TypeHandlerText : public TypeHandlerStr
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::TEXT;
|
||||
@@ -2374,7 +2373,7 @@ class TypeHandlerText : public TypeHandlerStr
|
||||
|
||||
class TypeHandlerClob : public TypeHandlerStr
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::CLOB;
|
||||
@@ -2423,7 +2422,7 @@ class TypeHandlerTemporal : public TypeHandler
|
||||
|
||||
class TypeHandlerDate : public TypeHandlerTemporal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::DATE;
|
||||
@@ -2449,7 +2448,7 @@ class TypeHandlerDate : public TypeHandlerTemporal
|
||||
|
||||
class TypeHandlerDatetime : public TypeHandlerTemporal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::DATETIME;
|
||||
@@ -2475,7 +2474,7 @@ class TypeHandlerDatetime : public TypeHandlerTemporal
|
||||
|
||||
class TypeHandlerTime : public TypeHandlerTemporal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::TIME;
|
||||
@@ -2501,7 +2500,7 @@ class TypeHandlerTime : public TypeHandlerTemporal
|
||||
|
||||
class TypeHandlerTimestamp : public TypeHandlerTemporal
|
||||
{
|
||||
const string& name() const override;
|
||||
const std::string& name() const override;
|
||||
code_t code() const override
|
||||
{
|
||||
return SystemCatalog::TIMESTAMP;
|
||||
|
20
datatypes/unordered.h
Normal file
20
datatypes/unordered.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#if (_LIBCPP_VERSION)
|
||||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
namespace std
|
||||
{
|
||||
namespace tr1
|
||||
{
|
||||
using std::hash;
|
||||
using std::swap;
|
||||
using std::unordered_map;
|
||||
using std::unordered_multimap;
|
||||
using std::unordered_set;
|
||||
} // namespace tr1
|
||||
} // namespace std
|
||||
#else
|
||||
#include <tr1/unordered_set>
|
||||
#include <tr1/unordered_map>
|
||||
#endif
|
@@ -801,7 +801,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
|
||||
* Return a string rep of the CSEP
|
||||
* @return a string
|
||||
*/
|
||||
void printSubCSEP(const size_t& ident, ostringstream& output, CalpontSelectExecutionPlan*& plan) const;
|
||||
void printSubCSEP(const size_t& ident, std::ostringstream& output, CalpontSelectExecutionPlan*& plan) const;
|
||||
virtual std::string toString(const size_t ident = 0) const;
|
||||
|
||||
/** @brief Is this an internal query?
|
||||
@@ -968,7 +968,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
|
||||
uint32_t fDJSMaxPartitionTreeDepth = 8;
|
||||
bool fDJSForceRun = false;
|
||||
uint32_t fMaxPmJoinResultCount = 1048576;
|
||||
int64_t fUMMemLimit = numeric_limits<int64_t>::max();
|
||||
int64_t fUMMemLimit = std::numeric_limits<int64_t>::max();
|
||||
bool fIsDML = false;
|
||||
long fTimeZone = 0;
|
||||
std::vector<execplan::ParseTree*> fDynamicParseTreeVec;
|
||||
|
@@ -135,7 +135,7 @@ class GroupConcatColumn : public AggregateColumn
|
||||
using AggregateColumn::operator!=;
|
||||
virtual bool operator!=(const GroupConcatColumn& t) const;
|
||||
|
||||
string toCppCode(IncludeSet& includes) const override;
|
||||
std::string toCppCode(IncludeSet& includes) const override;
|
||||
|
||||
private:
|
||||
std::vector<SRCP> fOrderCols;
|
||||
|
@@ -698,7 +698,7 @@ inline void ParseTree::drawTree(std::string filename)
|
||||
dotFile.close();
|
||||
}
|
||||
|
||||
inline string ParseTree::toCppCode(IncludeSet& includes) const
|
||||
inline std::string ParseTree::toCppCode(IncludeSet& includes) const
|
||||
{
|
||||
includes.insert("parsetree.h");
|
||||
std::stringstream ss;
|
||||
@@ -711,7 +711,7 @@ inline string ParseTree::toCppCode(IncludeSet& includes) const
|
||||
|
||||
inline void ParseTree::codeToFile(std::string filename, std::string varname) const
|
||||
{
|
||||
ofstream hFile(filename.c_str(), std::ios::app);
|
||||
std::ofstream hFile(filename.c_str(), std::ios::app);
|
||||
IncludeSet includes;
|
||||
auto result = toCppCode(includes);
|
||||
for (const auto& inc : includes)
|
||||
|
@@ -222,7 +222,7 @@ class SimpleFilter : public Filter
|
||||
|
||||
static std::string escapeString(const std::string& input);
|
||||
|
||||
string toCppCode(IncludeSet& includes) const override;
|
||||
std::string toCppCode(IncludeSet& includes) const override;
|
||||
|
||||
private:
|
||||
SOP fOp; /// operator
|
||||
|
@@ -154,7 +154,7 @@ class SimpleScalarFilter : public Filter
|
||||
*/
|
||||
bool operator!=(const SimpleScalarFilter& t) const;
|
||||
|
||||
string toCppCode(IncludeSet& includes) const override;
|
||||
std::string toCppCode(IncludeSet& includes) const override;
|
||||
|
||||
private:
|
||||
// default okay?
|
||||
|
@@ -754,7 +754,7 @@ inline uint64_t TreeNode::getUintVal()
|
||||
literal::Converter<literal::UnsignedInteger> cnv(fResult.strVal.safeString(""), cnverr);
|
||||
if (datatypes::DataCondition::Code(cnverr) != 0)
|
||||
{
|
||||
cerr << "error in unsigned int conversion from '" << fResult.strVal.safeString() << "'";
|
||||
std::cerr << "error in unsigned int conversion from '" << fResult.strVal.safeString() << "'";
|
||||
}
|
||||
return cnv.toXIntPositive<uint64_t>(cnverr);
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ class DiskJoinStep : public JobStep
|
||||
private:
|
||||
void initializeFIFO(uint32_t threadCount);
|
||||
void processJoinPartitions(const uint32_t threadID, const uint32_t smallSideSizeLimitPerThread,
|
||||
const vector<joiner::JoinPartition*>& joinPartitions);
|
||||
const std::vector<joiner::JoinPartition*>& joinPartitions);
|
||||
void prepareJobs(const std::vector<joiner::JoinPartition*>& joinPartitions,
|
||||
JoinPartitionJobs& joinPartitionsJobs);
|
||||
void outputResult(const std::vector<rowgroup::RGData>& result);
|
||||
|
@@ -124,7 +124,7 @@ class GroupConcator
|
||||
virtual void merge(GroupConcator*) = 0;
|
||||
virtual uint8_t* getResultImpl(const std::string& sep) = 0;
|
||||
virtual uint8_t* getResult(const std::string& sep);
|
||||
uint8_t* swapStreamWithStringAndReturnBuf(ostringstream& oss, bool isNull);
|
||||
uint8_t* swapStreamWithStringAndReturnBuf(std::ostringstream& oss, bool isNull);
|
||||
|
||||
virtual const std::string toString() const;
|
||||
|
||||
@@ -178,7 +178,10 @@ class GroupConcatNoOrder : public GroupConcator
|
||||
const std::string toString() const override;
|
||||
|
||||
protected:
|
||||
std::vector<rowgroup::RGDataUnPtr>& getRGDatas() { return fDataVec; }
|
||||
std::vector<rowgroup::RGDataUnPtr>& getRGDatas()
|
||||
{
|
||||
return fDataVec;
|
||||
}
|
||||
|
||||
void createNewRGData();
|
||||
rowgroup::RowGroup fRowGroup;
|
||||
@@ -247,8 +250,14 @@ class GroupConcatOrderBy : public GroupConcator, public ordering::IdbCompare
|
||||
void createNewRGData();
|
||||
uint64_t getCurrentRowIdx() const;
|
||||
static uint64_t shiftGroupIdxBy(uint64_t idx, uint32_t shift);
|
||||
std::vector<rowgroup::RGDataUnPtr>& getRGDatas() { return fDataVec; }
|
||||
SortingPQ* getQueue() { return fOrderByQueue.get(); }
|
||||
std::vector<rowgroup::RGDataUnPtr>& getRGDatas()
|
||||
{
|
||||
return fDataVec;
|
||||
}
|
||||
SortingPQ* getQueue()
|
||||
{
|
||||
return fOrderByQueue.get();
|
||||
}
|
||||
|
||||
rowgroup::RGDataSizeType fMemSize{0};
|
||||
static constexpr uint64_t fRowsPerRG{128};
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
@@ -55,10 +55,10 @@ extern void timespec_sub(const struct timespec& tv1, const struct timespec& tv2,
|
||||
|
||||
namespace joblist
|
||||
{
|
||||
const string createHashStr("create hash");
|
||||
const string hashJoinStr("hash join");
|
||||
const string insertResultsStr("insert results");
|
||||
const string insertLastResultsStr("insert last results");
|
||||
const std::string createHashStr("create hash");
|
||||
const std::string hashJoinStr("hash join");
|
||||
const std::string insertResultsStr("insert results");
|
||||
const std::string insertLastResultsStr("insert last results");
|
||||
|
||||
template <typename element_t>
|
||||
void* HashJoinByBucket_thr(void* arg);
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include "bytestream.h"
|
||||
#include <iostream>
|
||||
#include "brm.h"
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
namespace joblist
|
||||
{
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <tr1/memory>
|
||||
#include <memory>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
@@ -888,9 +888,9 @@ class BatchPrimitive : public JobStep, public DECEventListener
|
||||
struct _CPInfo
|
||||
{
|
||||
_CPInfo(int64_t MIN, int64_t MAX, uint64_t l, bool dictScan, bool val)
|
||||
: min(MIN), max(MAX), LBID(l), valid(val), dictScan(dictScan){};
|
||||
: min(MIN), max(MAX), LBID(l), valid(val), dictScan(dictScan) {};
|
||||
_CPInfo(int128_t BIGMIN, int128_t BIGMAX, uint64_t l, bool val)
|
||||
: bigMin(BIGMIN), bigMax(BIGMAX), LBID(l), valid(val), dictScan(false){};
|
||||
: bigMin(BIGMIN), bigMax(BIGMAX), LBID(l), valid(val), dictScan(false) {};
|
||||
union
|
||||
{
|
||||
int128_t bigMin;
|
||||
@@ -946,9 +946,9 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
||||
void receiveMultiPrimitiveMessages();
|
||||
|
||||
// Processes the vector of `bytestream` starting from `begin` index to the `end` index, non inclusive.
|
||||
void processByteStreamVector(vector<boost::shared_ptr<messageqcpp::ByteStream>>& bsv, const uint32_t begin,
|
||||
const uint32_t end, vector<_CPInfo>& cpv, RowGroupDL* dlp,
|
||||
const uint32_t threadID);
|
||||
void processByteStreamVector(std::vector<boost::shared_ptr<messageqcpp::ByteStream>>& bsv,
|
||||
const uint32_t begin, const uint32_t end, std::vector<_CPInfo>& cpv,
|
||||
RowGroupDL* dlp, const uint32_t threadID);
|
||||
|
||||
/** @brief Add a filter when the column is anything but a 4-byte float type.
|
||||
*
|
||||
@@ -1207,9 +1207,9 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
||||
void startPrimitiveThread();
|
||||
void startAggregationThread();
|
||||
// Processes the vector of `bytestream` starting from `begin` index to the `end` index, non inclusive.
|
||||
void startProcessingThread(TupleBPS* tbps, vector<boost::shared_ptr<messageqcpp::ByteStream>>& bsv,
|
||||
const uint32_t begin, const uint32_t end, vector<_CPInfo>& cpv, RowGroupDL* dlp,
|
||||
const uint32_t threadID);
|
||||
void startProcessingThread(TupleBPS* tbps, std::vector<boost::shared_ptr<messageqcpp::ByteStream>>& bsv,
|
||||
const uint32_t begin, const uint32_t end, std::vector<_CPInfo>& cpv,
|
||||
RowGroupDL* dlp, const uint32_t threadID);
|
||||
void initializeConfigParms();
|
||||
uint64_t getFBO(uint64_t lbid);
|
||||
void checkDupOutputColumns(const rowgroup::RowGroup& rg);
|
||||
@@ -1362,7 +1362,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
||||
private:
|
||||
uint64_t generateJoinResultSet(const uint32_t depth, std::vector<rowgroup::RGData>& outputData,
|
||||
RowGroupDL* dlp);
|
||||
void processFE2(vector<rowgroup::RGData>& rgData);
|
||||
void processFE2(std::vector<rowgroup::RGData>& rgData);
|
||||
|
||||
TupleBPS* tbps; // Parent
|
||||
rowgroup::RowGroup local_primRG;
|
||||
@@ -1384,7 +1384,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
||||
bool doJoin;
|
||||
|
||||
// Join vars.
|
||||
vector<vector<rowgroup::Row::Pointer>> joinerOutput;
|
||||
std::vector<std::vector<rowgroup::Row::Pointer>> joinerOutput;
|
||||
rowgroup::Row largeSideRow;
|
||||
rowgroup::Row joinedBaseRow;
|
||||
rowgroup::Row largeNull;
|
||||
@@ -1394,8 +1394,8 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
|
||||
boost::scoped_array<uint8_t> joinedBaseRowData;
|
||||
boost::scoped_array<uint8_t> joinFERowData;
|
||||
std::shared_ptr<int[]> largeMapping;
|
||||
vector<std::shared_ptr<int[]>> smallMappings;
|
||||
vector<std::shared_ptr<int[]>> fergMappings;
|
||||
std::vector<std::shared_ptr<int[]>> smallMappings;
|
||||
std::vector<std::shared_ptr<int[]>> fergMappings;
|
||||
rowgroup::RGData joinedData;
|
||||
boost::scoped_array<uint8_t> largeNullMemory;
|
||||
boost::scoped_array<std::shared_ptr<uint8_t[]>> smallNullMemory;
|
||||
|
@@ -28,7 +28,7 @@
|
||||
//
|
||||
|
||||
#include "jobstep.h"
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "stlpoolallocator.h"
|
||||
#include "threadnaming.h"
|
||||
@@ -116,7 +116,7 @@ class TupleUnion : public JobStep, public TupleDeliveryStep
|
||||
uint64_t group : 48;
|
||||
uint64_t row : 16;
|
||||
|
||||
inline explicit RowPosition(uint64_t i = 0, uint64_t j = 0) : group(i), row(j){};
|
||||
inline explicit RowPosition(uint64_t i = 0, uint64_t j = 0) : group(i), row(j) {};
|
||||
static const uint64_t normalizedFlag = 0x800000000000ULL; // 48th bit is set
|
||||
};
|
||||
|
||||
|
@@ -24,12 +24,11 @@
|
||||
/** @file */
|
||||
/** class FromSubSelect definition */
|
||||
|
||||
//#define NDEBUG
|
||||
// #define NDEBUG
|
||||
#define PREFER_MY_CONFIG_H
|
||||
#include <my_config.h>
|
||||
#include <cassert>
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
||||
@@ -39,7 +38,7 @@ using namespace std;
|
||||
#include "constantcolumn.h"
|
||||
#include "simplecolumn.h"
|
||||
using namespace execplan;
|
||||
|
||||
using namespace std;
|
||||
#include "ha_subquery.h"
|
||||
|
||||
namespace cal_impl_if
|
||||
|
@@ -27,10 +27,9 @@
|
||||
#define PREFER_MY_CONFIG_H
|
||||
#include <my_config.h>
|
||||
#include <stdint.h>
|
||||
//#define NDEBUG
|
||||
// #define NDEBUG
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
||||
@@ -50,6 +49,8 @@ using namespace logging;
|
||||
|
||||
#include "ha_subquery.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
extern void parse_item(Item* item, vector<Item_field*>& field_vec, bool& hasNonSupportItem,
|
||||
|
@@ -585,7 +585,7 @@ extern "C"
|
||||
stmt->serialize(bytestream);
|
||||
ByteStream::byte b = 0;
|
||||
THD* thd = current_thd;
|
||||
string emsg;
|
||||
std::string emsg;
|
||||
mq.write(bytestream);
|
||||
|
||||
try
|
||||
@@ -606,7 +606,7 @@ extern "C"
|
||||
bytestream >> emsg;
|
||||
}
|
||||
}
|
||||
catch (runtime_error&)
|
||||
catch (std::runtime_error&)
|
||||
{
|
||||
thd->get_stmt_da()->set_overwrite_status(true);
|
||||
thd->raise_error_printf(ER_INTERNAL_ERROR, "Lost connection to DDLProc");
|
||||
|
@@ -25,16 +25,14 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stack>
|
||||
#include <tr1/unordered_map>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
#include <regex>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
using namespace std;
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/tokenizer.hpp>
|
||||
@@ -81,6 +79,7 @@ using namespace execplan;
|
||||
|
||||
#include "resourcemanager.h"
|
||||
using namespace joblist;
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -2203,28 +2202,40 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& /*ta
|
||||
|
||||
if (ddlStatement.find("AUTO_INCREMENT") != string::npos)
|
||||
{
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED, "The syntax auto_increment is not supported in Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.");
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED,
|
||||
"The syntax auto_increment is not supported in Columnstore. Please check the "
|
||||
"Columnstore syntax guide for supported syntax or data types.");
|
||||
}
|
||||
else if(ddlStatement.find("RENAME COLUMN") != string::npos)
|
||||
else if (ddlStatement.find("RENAME COLUMN") != string::npos)
|
||||
{
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED, "The syntax rename column is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.");
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED,
|
||||
"The syntax rename column is not supported by Columnstore. Please check the "
|
||||
"Columnstore syntax guide for supported syntax or data types.");
|
||||
}
|
||||
else if(ddlStatement.find("MAX_ROWS") != string::npos || ddlStatement.find("MIN_ROWS") != string::npos)
|
||||
else if (ddlStatement.find("MAX_ROWS") != string::npos || ddlStatement.find("MIN_ROWS") != string::npos)
|
||||
{
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED, "The syntax min_rows/max_rows is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.");
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED,
|
||||
"The syntax min_rows/max_rows is not supported by Columnstore. Please check "
|
||||
"the Columnstore syntax guide for supported syntax or data types.");
|
||||
}
|
||||
else if(ddlStatement.find("REPLACE TABLE") != string::npos)
|
||||
else if (ddlStatement.find("REPLACE TABLE") != string::npos)
|
||||
{
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED, "The syntax replace table is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.");
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED,
|
||||
"The syntax replace table is not supported by Columnstore. Please check the "
|
||||
"Columnstore syntax guide for supported syntax or data types.");
|
||||
}
|
||||
else if(ddlStatement.find("DROP COLUMN IF EXISTS") != string::npos)
|
||||
else if (ddlStatement.find("DROP COLUMN IF EXISTS") != string::npos)
|
||||
{
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED, "The syntax drop column if exists is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.");
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED,
|
||||
"The syntax drop column if exists is not supported by Columnstore. Please "
|
||||
"check the Columnstore syntax guide for supported syntax or data types.");
|
||||
}
|
||||
else
|
||||
{
|
||||
//@Bug 1888,1885. update error message
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED, "The syntax or the data type(s) is not supported by Columnstore. Please check the Columnstore syntax guide for supported syntax or data types.");
|
||||
thd->raise_error_printf(ER_CHECK_NOT_IMPLEMENTED,
|
||||
"The syntax or the data type(s) is not supported by Columnstore. Please check "
|
||||
"the Columnstore syntax guide for supported syntax or data types.");
|
||||
}
|
||||
|
||||
ci->alterTableState = cal_connection_info::NOT_ALTER;
|
||||
|
@@ -25,13 +25,11 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stack>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
||||
using namespace std;
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
using namespace boost;
|
||||
@@ -75,6 +73,8 @@ using namespace joblist;
|
||||
|
||||
#include "nullstring.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
#define BATCH_INSERT_GROUP_ROWS_FOR_CACHE 100000
|
||||
|
@@ -21,8 +21,7 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stack>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <cerrno>
|
||||
@@ -36,8 +35,6 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
@@ -99,6 +96,8 @@ using namespace funcexp;
|
||||
|
||||
#include "ha_view.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
// This is taken from Item_cond::fix_fields in sql/item_cmpfunc.cc.
|
||||
|
@@ -26,6 +26,8 @@
|
||||
#include "rowcolumn.h"
|
||||
#include "simplefilter.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
// In certain cases, gp_walk is called recursively. When done so,
|
||||
@@ -121,15 +123,15 @@ void gp_walk(const Item* item, void* arg)
|
||||
if (!scp)
|
||||
break;
|
||||
|
||||
string aliasTableName(scp->tableAlias());
|
||||
std::string aliasTableName(scp->tableAlias());
|
||||
scp->tableAlias(aliasTableName);
|
||||
gwip->rcWorkStack.push(scp->clone());
|
||||
boost::shared_ptr<execplan::SimpleColumn> scsp(scp);
|
||||
gwip->scsp = scsp;
|
||||
|
||||
gwip->funcName.clear();
|
||||
gwip->columnMap.insert(
|
||||
execplan::CalpontSelectExecutionPlan::ColumnMap::value_type(string(ifp->field_name.str), scsp));
|
||||
gwip->columnMap.insert(execplan::CalpontSelectExecutionPlan::ColumnMap::value_type(
|
||||
std::string(ifp->field_name.str), scsp));
|
||||
|
||||
//@bug4636 take where clause column as dummy projection column, but only on local column.
|
||||
// varbinary aggregate is not supported yet, so rule it out
|
||||
@@ -138,7 +140,7 @@ void gp_walk(const Item* item, void* arg)
|
||||
{
|
||||
TABLE_LIST* tmp = (ifp->cached_table ? ifp->cached_table : 0);
|
||||
gwip->tableMap[execplan::make_aliastable(scp->schemaName(), scp->tableName(), scp->tableAlias(),
|
||||
scp->isColumnStore())] = make_pair(1, tmp);
|
||||
scp->isColumnStore())] = std::make_pair(1, tmp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +164,8 @@ void gp_walk(const Item* item, void* arg)
|
||||
if (item->type_handler() == &type_handler_hex_hybrid)
|
||||
{
|
||||
Item_hex_hybrid* hip = static_cast<Item_hex_hybrid*>(const_cast<Item*>(item));
|
||||
gwip->rcWorkStack.push(new execplan::ConstantColumn((int64_t)hip->val_int(), execplan::ConstantColumn::NUM));
|
||||
gwip->rcWorkStack.push(
|
||||
new execplan::ConstantColumn((int64_t)hip->val_int(), execplan::ConstantColumn::NUM));
|
||||
execplan::ConstantColumn* cc = dynamic_cast<execplan::ConstantColumn*>(gwip->rcWorkStack.top());
|
||||
cc->timeZone(gwip->timeZone);
|
||||
break;
|
||||
@@ -175,7 +178,7 @@ void gp_walk(const Item* item, void* arg)
|
||||
String val, *str = isp->val_str(&val);
|
||||
if (str)
|
||||
{
|
||||
string cval;
|
||||
std::string cval;
|
||||
|
||||
if (str->ptr())
|
||||
{
|
||||
@@ -218,7 +221,7 @@ void gp_walk(const Item* item, void* arg)
|
||||
break;
|
||||
}
|
||||
|
||||
ostringstream oss;
|
||||
std::ostringstream oss;
|
||||
oss << "Unhandled Item type(): " << item->type();
|
||||
gwip->parseErrorText = oss.str();
|
||||
gwip->fatalParseError = true;
|
||||
@@ -248,7 +251,7 @@ void gp_walk(const Item* item, void* arg)
|
||||
Item* ncitem = const_cast<Item*>(item);
|
||||
Item_func* ifp = static_cast<Item_func*>(ncitem);
|
||||
|
||||
string funcName = ifp->func_name();
|
||||
std::string funcName = ifp->func_name();
|
||||
|
||||
if (!gwip->condPush)
|
||||
{
|
||||
@@ -323,14 +326,14 @@ void gp_walk(const Item* item, void* arg)
|
||||
}
|
||||
|
||||
// try to evaluate const F&E
|
||||
vector<Item_field*> tmpVec;
|
||||
std::vector<Item_field*> tmpVec;
|
||||
uint16_t parseInfo = 0;
|
||||
parse_item(ifp, tmpVec, gwip->fatalParseError, parseInfo, gwip);
|
||||
|
||||
// table mode takes only one table filter
|
||||
if (gwip->condPush)
|
||||
{
|
||||
set<string> tableSet;
|
||||
std::set<std::string> tableSet;
|
||||
|
||||
for (uint32_t i = 0; i < tmpVec.size(); i++)
|
||||
{
|
||||
@@ -389,7 +392,8 @@ void gp_walk(const Item* item, void* arg)
|
||||
{
|
||||
logging::Message::Args args;
|
||||
args.add(funcName);
|
||||
gwip->parseErrorText = logging::IDBErrorInfo::instance()->errorMsg(logging::ERR_NON_SUPPORTED_FUNCTION, args);
|
||||
gwip->parseErrorText =
|
||||
logging::IDBErrorInfo::instance()->errorMsg(logging::ERR_NON_SUPPORTED_FUNCTION, args);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -463,14 +467,15 @@ void gp_walk(const Item* item, void* arg)
|
||||
//@bug3495, @bug5865 error out non-supported OR with correlated subquery
|
||||
if (isOr)
|
||||
{
|
||||
vector<Item_field*> fieldVec;
|
||||
std::vector<Item_field*> fieldVec;
|
||||
uint16_t parseInfo = 0;
|
||||
parse_item(it, fieldVec, gwip->fatalParseError, parseInfo, gwip);
|
||||
|
||||
if (parseInfo & CORRELATED)
|
||||
{
|
||||
gwip->fatalParseError = true;
|
||||
gwip->parseErrorText = logging::IDBErrorInfo::instance()->errorMsg(logging::ERR_CORRELATED_SUB_OR);
|
||||
gwip->parseErrorText =
|
||||
logging::IDBErrorInfo::instance()->errorMsg(logging::ERR_CORRELATED_SUB_OR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -664,7 +669,8 @@ void gp_walk(const Item* item, void* arg)
|
||||
else if (col->type() == Item::FIELD_ITEM && gwip->clauseType == HAVING)
|
||||
{
|
||||
// ReturnedColumn* rc = buildAggFrmTempField(const_cast<Item*>(item), *gwip);
|
||||
execplan::ReturnedColumn* rc = buildReturnedColumn(const_cast<Item*>(item), *gwip, gwip->fatalParseError);
|
||||
execplan::ReturnedColumn* rc =
|
||||
buildReturnedColumn(const_cast<Item*>(item), *gwip, gwip->fatalParseError);
|
||||
if (rc)
|
||||
gwip->rcWorkStack.push(rc);
|
||||
|
||||
@@ -735,7 +741,8 @@ void gp_walk(const Item* item, void* arg)
|
||||
// temp change clause type because the elements of row column are not walked yet
|
||||
gwip->clauseType = SELECT;
|
||||
for (uint32_t i = 0; i < row->cols(); i++)
|
||||
cols.push_back(execplan::SRCP(buildReturnedColumn(row->element_index(i), *gwip, gwip->fatalParseError)));
|
||||
cols.push_back(
|
||||
execplan::SRCP(buildReturnedColumn(row->element_index(i), *gwip, gwip->fatalParseError)));
|
||||
|
||||
gwip->clauseType = WHERE;
|
||||
rowCol->columnVec(cols);
|
||||
@@ -971,7 +978,8 @@ void parse_item(Item* item, vector<Item_field*>& field_vec, bool& hasNonSupportI
|
||||
gwi->fatalParseError = true;
|
||||
// DRRTUY The questionable error text. I've seen
|
||||
// ERR_CORRELATED_SUB_OR
|
||||
string parseErrorText = logging::IDBErrorInfo::instance()->errorMsg(logging::ERR_NON_SUPPORT_SUB_QUERY_TYPE);
|
||||
string parseErrorText =
|
||||
logging::IDBErrorInfo::instance()->errorMsg(logging::ERR_NON_SUPPORT_SUB_QUERY_TYPE);
|
||||
setError(gwi->thd, ER_CHECK_NOT_IMPLEMENTED, parseErrorText);
|
||||
break;
|
||||
}
|
||||
@@ -1633,4 +1641,4 @@ void debug_walk(const Item* item, void* arg)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace cal_impl_if
|
@@ -24,8 +24,8 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <stack>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <cerrno>
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <map>
|
||||
#include <limits>
|
||||
#include <wait.h> //wait()
|
||||
using namespace std;
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
@@ -132,6 +131,8 @@ using namespace funcexp;
|
||||
#include "ha_subquery.h"
|
||||
#include "statistics_manager/statistics.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
extern bool nonConstFunc(Item_func* ifp);
|
||||
@@ -176,7 +177,7 @@ const string infinidb_autoswitch_warning =
|
||||
"was switched to standard mode with downgraded performance.";
|
||||
|
||||
// copied from item_timefunc.cc
|
||||
static const string interval_names[] = {"year",
|
||||
[[maybe_unused]] static const string interval_names[] = {"year",
|
||||
"quarter",
|
||||
"month",
|
||||
"week",
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include <bitset>
|
||||
#include <string>
|
||||
#include <stdint.h>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
#include <iosfwd>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stack>
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include <sstream>
|
||||
// #include <unistd.h>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
|
||||
#include <boost/tokenizer.hpp>
|
||||
|
||||
@@ -65,6 +64,7 @@ using namespace logging;
|
||||
|
||||
#include <boost/algorithm/string/case_conv.hpp>
|
||||
using namespace boost;
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@@ -21,7 +21,8 @@
|
||||
*/
|
||||
|
||||
#include <my_config.h>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
@@ -3,7 +3,6 @@
|
||||
// #include <cmath>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
||||
@@ -24,6 +23,7 @@ using namespace execplan;
|
||||
#include "ha_mcs_impl_if.h"
|
||||
#include "ha_mcs_sysvars.h"
|
||||
using namespace cal_impl_if;
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
|
@@ -24,12 +24,11 @@
|
||||
/** @file */
|
||||
/** class ScalarSub definition */
|
||||
|
||||
//#define NDEBUG
|
||||
// #define NDEBUG
|
||||
#define PREFER_MY_CONFIG_H
|
||||
#include <my_config.h>
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
||||
@@ -49,6 +48,8 @@ using namespace logging;
|
||||
|
||||
#include "ha_subquery.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
ScalarSub::ScalarSub(gp_walk_info& gwip) : WhereSubQuery(gwip), fReturnedColPos(0)
|
||||
|
@@ -23,11 +23,10 @@
|
||||
***********************************************************************/
|
||||
/** class SelectSubQuery definition */
|
||||
|
||||
//#define NDEBUG
|
||||
// #define NDEBUG
|
||||
#define PREFER_MY_CONFIG_H
|
||||
#include <my_config.h>
|
||||
#include <cassert>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
||||
@@ -44,6 +43,7 @@ using namespace execplan;
|
||||
using namespace logging;
|
||||
|
||||
#include "ha_subquery.h"
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include <my_config.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
#include "ha_mcs_impl_if.h"
|
||||
@@ -53,6 +52,8 @@ using namespace mcsv1sdk;
|
||||
|
||||
#include "vlarray.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace cal_impl_if
|
||||
{
|
||||
ReturnedColumn* nullOnError(gp_walk_info& gwi)
|
||||
@@ -96,7 +97,8 @@ WF_FRAME frame(Window_frame_bound::Bound_precedence_type bound, Item* offset)
|
||||
}
|
||||
ReturnedColumn* buildBoundExp(WF_Boundary& bound, SRCP& order, gp_walk_info& gwi)
|
||||
{
|
||||
if (get_fe_conn_info_ptr() == NULL) {
|
||||
if (get_fe_conn_info_ptr() == NULL)
|
||||
{
|
||||
set_fe_conn_info_ptr((void*)new cal_connection_info());
|
||||
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
|
||||
}
|
||||
@@ -305,7 +307,8 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
|
||||
// String str;
|
||||
// item->print(&str, QT_INFINIDB_NO_QUOTE);
|
||||
// cout << str.c_ptr() << endl;
|
||||
if (get_fe_conn_info_ptr() == NULL) {
|
||||
if (get_fe_conn_info_ptr() == NULL)
|
||||
{
|
||||
set_fe_conn_info_ptr((void*)new cal_connection_info());
|
||||
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
|
||||
}
|
||||
@@ -530,8 +533,8 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
|
||||
return nullOnError(gwi);
|
||||
|
||||
srcp->asc(orderCol->direction == ORDER::ORDER_ASC ? true : false);
|
||||
// srcp->nullsFirst(orderCol->nulls); // nulls 2-default, 1-nulls first,
|
||||
//0-nulls last
|
||||
// srcp->nullsFirst(orderCol->nulls); // nulls 2-default, 1-nulls
|
||||
//first, 0-nulls last
|
||||
srcp->nullsFirst(orderCol->direction == ORDER::ORDER_ASC
|
||||
? 1
|
||||
: 0); // WINDOWS TODO: implement NULLS FIRST/LAST in 10.2 front end
|
||||
|
@@ -86,6 +86,24 @@ if(WITH_TSAN)
|
||||
set(STORAGEMANAGER_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${TSAN_PATH}.storagemanager)
|
||||
endif()
|
||||
|
||||
if(WITH_MSAN)
|
||||
set(MSAN_PATH "/tmp/msan")
|
||||
if(WITH_COLUMNSTORE_REPORT_PATH)
|
||||
set(MSAN_PATH "${WITH_COLUMNSTORE_REPORT_PATH}/msan")
|
||||
endif(WITH_COLUMNSTORE_REPORT_PATH)
|
||||
|
||||
set(LD_PRELOAD_STRING "")
|
||||
set(MSAN_OPTIONS abort_on_error=0:log_path=${MSAN_PATH})
|
||||
set(ALLOC_CONFIG MSAN_OPTIONS=${MSAN_OPTIONS})
|
||||
set(PRIMPROC_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.primproc)
|
||||
set(DMLPROC_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.dmlproc)
|
||||
set(DDLPROC_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.ddlproc)
|
||||
set(WRITEENGINE_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.writeengine)
|
||||
set(CONTROLLERNODE_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.controllernode)
|
||||
set(WORKERNODE_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.workernode)
|
||||
set(STORAGEMANAGER_ALLOC_CONFIG ${ALLOC_CONFIG},log_path=${MSAN_PATH}.storagemanager)
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/columnstoreSyslogSetup.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/columnstoreSyslogSetup.sh"
|
||||
@ONLY
|
||||
|
@@ -53,7 +53,7 @@
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#include <string>
|
||||
static const std::string optim(
|
||||
[[maybe_unused]] static const std::string optim(
|
||||
"Build is "
|
||||
#if !defined(__OPTIMIZE__)
|
||||
"NOT "
|
||||
|
@@ -26,7 +26,8 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <deque>
|
||||
|
||||
|
@@ -48,8 +48,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
#include <set>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -61,7 +60,7 @@
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/condition.hpp>
|
||||
#include <pthread.h>
|
||||
//#define NDEBUG
|
||||
// #define NDEBUG
|
||||
#include <cassert>
|
||||
|
||||
using namespace std;
|
||||
|
@@ -20,15 +20,16 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
//#define NDEBUG
|
||||
// #define NDEBUG
|
||||
#include <cassert>
|
||||
#ifdef __linux__
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
using namespace std;
|
||||
|
||||
#include "primitiveprocessor.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace primitives
|
||||
{
|
||||
PrimitiveProcessor::PrimitiveProcessor(int debugLevel)
|
||||
|
@@ -27,7 +27,8 @@
|
||||
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "joblisttypes.h"
|
||||
|
||||
#define POSIX_REGEX
|
||||
@@ -40,7 +41,6 @@
|
||||
#include <cstddef>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
|
||||
#include "primitivemsg.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "stats.h"
|
||||
@@ -50,7 +50,7 @@
|
||||
class PrimTest;
|
||||
|
||||
// XXX: turn off dictionary range setting during scan.
|
||||
//#define XXX_PRIMITIVES_TOKEN_RANGES_XXX
|
||||
// #define XXX_PRIMITIVES_TOKEN_RANGES_XXX
|
||||
|
||||
namespace primitives
|
||||
{
|
||||
@@ -121,13 +121,16 @@ class DictEqualityFilter : public std::tr1::unordered_set<std::string, datatypes
|
||||
: std::tr1::unordered_set<std::string, datatypes::CollationAwareHasher,
|
||||
datatypes::CollationAwareComparator>(10, datatypes::CollationAwareHasher(cs),
|
||||
datatypes::CollationAwareComparator(cs))
|
||||
, charset(cs.getCharset())
|
||||
{
|
||||
}
|
||||
CHARSET_INFO& getCharset() const
|
||||
{
|
||||
idbassert(&_M_h1.getCharset() == &_M_eq.getCharset());
|
||||
return _M_h1.getCharset();
|
||||
return charset;
|
||||
}
|
||||
|
||||
private:
|
||||
CHARSET_INFO& charset;
|
||||
};
|
||||
|
||||
// Not the safest way b/c it doesn't cover uint128_t but the type
|
||||
@@ -493,7 +496,8 @@ T getNullValue(uint8_t type)
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT: return joblist::CHAR8NULL;
|
||||
|
||||
// VARCHARs with width >= 8 are stored as dictionaries (used TypeHandlerVarchar::getNullValueForType as a reference)
|
||||
// VARCHARs with width >= 8 are stored as dictionaries (used TypeHandlerVarchar::getNullValueForType as a
|
||||
// reference)
|
||||
case execplan::CalpontSystemCatalog::VARCHAR: return joblist::UBIGINTNULL;
|
||||
|
||||
case execplan::CalpontSystemCatalog::UBIGINT: return joblist::UBIGINTNULL;
|
||||
|
@@ -34,7 +34,8 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <unistd.h>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "batchprimitiveprocessor.h"
|
||||
|
@@ -65,7 +65,7 @@ void BPPSendThread::sendResult(const Msg_t& msg, bool newConnection)
|
||||
std::unique_lock<std::mutex> sl(msgQueueLock);
|
||||
|
||||
if (gotException)
|
||||
throw runtime_error(exceptionString);
|
||||
throw std::runtime_error(exceptionString);
|
||||
|
||||
(void)atomicops::atomicAdd<uint64_t>(¤tByteSize, msg.msg->lengthWithHdrOverhead());
|
||||
msgQueue.push(msg);
|
||||
@@ -91,7 +91,7 @@ void BPPSendThread::sendResult(const Msg_t& msg, bool newConnection)
|
||||
queueNotEmpty.notify_one();
|
||||
}
|
||||
|
||||
void BPPSendThread::sendResults(const vector<Msg_t>& msgs, bool newConnection)
|
||||
void BPPSendThread::sendResults(const std::vector<Msg_t>& msgs, bool newConnection)
|
||||
{
|
||||
// Wait for the queue to empty out a bit if it's stuffed full
|
||||
if (sizeTooBig())
|
||||
@@ -110,7 +110,7 @@ void BPPSendThread::sendResults(const vector<Msg_t>& msgs, bool newConnection)
|
||||
std::unique_lock<std::mutex> sl(msgQueueLock);
|
||||
|
||||
if (gotException)
|
||||
throw runtime_error(exceptionString);
|
||||
throw std::runtime_error(exceptionString);
|
||||
|
||||
if (!sawAllConnections && newConnection)
|
||||
{
|
||||
|
@@ -36,13 +36,11 @@
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/condition.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <cerrno>
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <utility>
|
||||
@@ -91,6 +89,8 @@ using namespace idbdatafile;
|
||||
|
||||
using namespace threadpool;
|
||||
|
||||
using namespace std;
|
||||
|
||||
#include "threadnaming.h"
|
||||
|
||||
#include "atomicops.h"
|
||||
|
@@ -25,8 +25,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
|
@@ -31,7 +31,7 @@
|
||||
#include <csignal>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <clocale>
|
||||
#include <iterator>
|
||||
|
@@ -339,7 +339,7 @@ class ServiceExeMgr : public Service, public Opt
|
||||
}
|
||||
void getLocalNetIfacesSins()
|
||||
{
|
||||
string ipAddress = "Unable to get IP Address";
|
||||
std::string ipAddress = "Unable to get IP Address";
|
||||
struct ifaddrs* netIfacesList = nullptr;
|
||||
struct ifaddrs* ifaceListMembPtr = nullptr;
|
||||
int success = 0;
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include <signal.h>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <sys/poll.h>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
namespace storagemanager
|
||||
{
|
||||
|
@@ -8,11 +8,17 @@ endif()
|
||||
if(WITH_UNITTESTS)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
set(EXTERNAL_INSTALL_LOCATION ${CMAKE_BINARY_DIR}/external)
|
||||
set(cxxflags "")
|
||||
if(WITH_MSAN)
|
||||
set(cxxflags "'${cxxflags} -fsanitize=memory -fsanitize-memory-track-origins -U_FORTIFY_SOURCE -stdlib=libc++'")
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(
|
||||
googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest
|
||||
GIT_TAG release-1.12.0
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION} -DBUILD_SHARED_LIBS=ON
|
||||
-DCMAKE_CXX_FLAGS:STRING=${cxxflags}
|
||||
)
|
||||
|
||||
# this is a workaround for gtest's bug still not closed https://github.com/google/googletest/issues/3659
|
||||
@@ -93,6 +99,11 @@ if(WITH_UNITTESTS)
|
||||
columnstore_link(stlpoolallocator ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${GTEST_LIBRARIES})
|
||||
gtest_add_tests(TARGET stlpoolallocator TEST_PREFIX columnstore:)
|
||||
|
||||
add_executable(idbdatafile_test BufferedFile.cpp)
|
||||
columnstore_link(idbdatafile_test ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} gtest gtest_main)
|
||||
add_test(NAME columnstore:idbdatafile_test COMMAND idbdatafile_test)
|
||||
|
||||
if(NOT DEFINED WITH_MSAN) # CPPUnit is not build from sources
|
||||
add_executable(comparators_tests comparators-tests.cpp)
|
||||
columnstore_link(comparators_tests ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
add_test(NAME columnstore:comparators_tests COMMAND comparators_tests)
|
||||
@@ -101,15 +112,12 @@ if(WITH_UNITTESTS)
|
||||
columnstore_link(bytestream ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
add_test(NAME columnstore:bytestream COMMAND bytestream)
|
||||
|
||||
add_executable(idbdatafile_test BufferedFile.cpp)
|
||||
columnstore_link(idbdatafile_test ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} gtest gtest_main)
|
||||
add_test(NAME columnstore:idbdatafile_test COMMAND idbdatafile_test)
|
||||
|
||||
# standalone EM routines test
|
||||
add_executable(brm_em_standalone brm-em-standalone.cpp)
|
||||
columnstore_link(brm_em_standalone ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${CPPUNIT_LIBRARIES} cppunit)
|
||||
add_test(NAME columnstore:brm_em_standalone COMMAND brm_em_standalone)
|
||||
set_tests_properties(columnstore:brm_em_standalone PROPERTIES DISABLED True)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_MICROBENCHMARKS AND (NOT CMAKE_BUILD_TYPE STREQUAL "Debug"))
|
||||
|
@@ -24,7 +24,7 @@
|
||||
class CompressionTest : public ::testing::Test
|
||||
{
|
||||
protected:
|
||||
std::string genPermutations(string& data)
|
||||
std::string genPermutations(std::string& data)
|
||||
{
|
||||
std::string generated;
|
||||
generate(data, 0, generated);
|
||||
@@ -32,7 +32,7 @@ class CompressionTest : public ::testing::Test
|
||||
}
|
||||
|
||||
private:
|
||||
void generate(string& data, uint32_t i, std::string& generated)
|
||||
void generate(std::string& data, uint32_t i, std::string& generated)
|
||||
{
|
||||
if (i == data.size())
|
||||
{
|
||||
|
@@ -23,6 +23,8 @@
|
||||
#include "mcs_decimal.h"
|
||||
#include "dataconvert.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
TEST(Decimal, compareCheckInt64)
|
||||
{
|
||||
// remainder-based checks
|
||||
|
@@ -80,8 +80,9 @@ TEST_F(RebuildEMTest, File2OidCheckFileFormatTest)
|
||||
FileId fExpected(getOid(0, 0, 8, 28), 00, 79);
|
||||
|
||||
std::vector<std::pair<std::string, FileId>> expectedFileIds = {
|
||||
make_pair(aFileName, aExpected), make_pair(bFileName, bExpected), make_pair(cFileName, cExpected),
|
||||
make_pair(dFileName, dExpected), make_pair(eFileName, eExpected), make_pair(fFileName, fExpected)};
|
||||
std::make_pair(aFileName, aExpected), std::make_pair(bFileName, bExpected),
|
||||
std::make_pair(cFileName, cExpected), std::make_pair(dFileName, dExpected),
|
||||
std::make_pair(eFileName, eExpected), std::make_pair(fFileName, fExpected)};
|
||||
|
||||
for (const auto& expectedPair : expectedFileIds)
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
@@ -104,7 +104,6 @@ const int64_t IDB_pow[19] = {1,
|
||||
100000000000000000LL,
|
||||
1000000000000000000LL};
|
||||
|
||||
|
||||
const int32_t SECS_PER_MIN = 60;
|
||||
const int32_t MINS_PER_HOUR = 60;
|
||||
const int32_t HOURS_PER_DAY = 24;
|
||||
@@ -1089,7 +1088,7 @@ void number_int_value(const std::string& data, cscDataType typeCode,
|
||||
const datatypes::SystemCatalog::TypeAttributesStd& ct, bool& pushwarning,
|
||||
bool noRoundup, T& intVal, bool* saturate = 0);
|
||||
|
||||
uint64_t number_uint_value(const string& data, cscDataType typeCode,
|
||||
uint64_t number_uint_value(const std::string& data, cscDataType typeCode,
|
||||
const datatypes::SystemCatalog::TypeAttributesStd& ct, bool& pushwarning,
|
||||
bool noRoundup);
|
||||
|
||||
@@ -1319,7 +1318,7 @@ inline void DataConvert::datetimeToString(long long datetimevalue, char* buf, un
|
||||
|
||||
if ((datetimevalue & 0xfffff) > 0)
|
||||
{
|
||||
msec = (unsigned)((datetimevalue)&0xfffff);
|
||||
msec = (unsigned)((datetimevalue) & 0xfffff);
|
||||
}
|
||||
|
||||
snprintf(buf, buflen, "%04d-%02d-%02d %02d:%02d:%02d", (unsigned)((datetimevalue >> 48) & 0xffff),
|
||||
@@ -1377,7 +1376,7 @@ inline void DataConvert::timeToString(long long timevalue, char* buf, unsigned i
|
||||
|
||||
if ((timevalue & 0xffffff) > 0)
|
||||
{
|
||||
msec = (unsigned)((timevalue)&0xffffff);
|
||||
msec = (unsigned)((timevalue) & 0xffffff);
|
||||
}
|
||||
|
||||
if ((hour >= 0) && (timevalue >> 63))
|
||||
@@ -1554,7 +1553,6 @@ inline int128_t strtoll128(const char* data, bool& saturate, char** ep)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
template <class T>
|
||||
T decimalRangeUp(int32_t precision)
|
||||
{
|
||||
|
@@ -22,14 +22,14 @@ CalpontSystemCatalog::ColType Func_json_array::operationType(FunctionParm& fp,
|
||||
return fp.size() > 0 ? fp[0]->data()->resultType() : resultType;
|
||||
}
|
||||
|
||||
string Func_json_array::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_array::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& type)
|
||||
{
|
||||
if (fp.size() == 0)
|
||||
return "[]";
|
||||
|
||||
const CHARSET_INFO* retCS = type.getCharset();
|
||||
string ret("[");
|
||||
std::string ret("[");
|
||||
|
||||
if (appendJSValue(ret, retCS, row, fp[0]))
|
||||
goto error;
|
||||
|
@@ -20,7 +20,7 @@ CalpontSystemCatalog::ColType Func_json_array_append::operationType(
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_array_append::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_array_append::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto& js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -32,7 +32,7 @@ string Func_json_array_append::getStrVal(rowgroup::Row& row, FunctionParm& fp, b
|
||||
json_engine_t jsEg;
|
||||
const uchar* arrEnd;
|
||||
size_t strRestLen;
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
retJS.reserve(js.length() + padding);
|
||||
|
||||
initJSPaths(paths, fp, 1, 2);
|
||||
|
@@ -20,7 +20,7 @@ CalpontSystemCatalog::ColType Func_json_array_insert::operationType(
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_array_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_array_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto& js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -30,7 +30,7 @@ string Func_json_array_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, b
|
||||
const CHARSET_INFO* cs = getCharset(fp[0]);
|
||||
|
||||
json_engine_t jsEg;
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
retJS.reserve(js.length() + 8);
|
||||
|
||||
initJSPaths(paths, fp, 1, 2);
|
||||
|
@@ -32,7 +32,7 @@ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNul
|
||||
if (isNull)
|
||||
return false;
|
||||
|
||||
const string_view js = js_ns.unsafeStringRef();
|
||||
const std::string_view js = js_ns.unsafeStringRef();
|
||||
|
||||
#if MYSQL_VERSION_ID >= 100900
|
||||
int arrayCounters[JSON_DEPTH_LIMIT];
|
||||
@@ -48,7 +48,7 @@ bool Func_json_contains_path::getBoolVal(Row& row, FunctionParm& fp, bool& isNul
|
||||
auto mode_ns = fp[1]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
return false;
|
||||
string mode = mode_ns.unsafeStringRef();
|
||||
std::string mode = mode_ns.unsafeStringRef();
|
||||
|
||||
transform(mode.begin(), mode.end(), mode.begin(), ::tolower);
|
||||
if (mode != "one" && mode != "all")
|
||||
|
@@ -13,7 +13,7 @@ using namespace funcexp::helpers;
|
||||
|
||||
namespace funcexp
|
||||
{
|
||||
int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* type, string& retJS,
|
||||
int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* type, std::string& retJS,
|
||||
bool compareWhole = true)
|
||||
{
|
||||
bool isNull = false;
|
||||
@@ -34,7 +34,7 @@ int Func_json_extract::doExtract(Row& row, FunctionParm& fp, json_value_types* t
|
||||
bool hasNegPath = false;
|
||||
#endif
|
||||
const size_t argSize = fp.size();
|
||||
string tmp;
|
||||
std::string tmp;
|
||||
|
||||
initJSPaths(paths, fp, 1, 1);
|
||||
|
||||
@@ -151,10 +151,10 @@ CalpontSystemCatalog::ColType Func_json_extract::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_extract::getStrVal(Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_extract::getStrVal(Row& row, FunctionParm& fp, bool& isNull,
|
||||
CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
json_value_types valType;
|
||||
if (doExtract(row, fp, &valType, retJS) == 0)
|
||||
return retJS;
|
||||
@@ -166,7 +166,7 @@ string Func_json_extract::getStrVal(Row& row, FunctionParm& fp, bool& isNull,
|
||||
int64_t Func_json_extract::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& /*isNull*/,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
json_value_types valType;
|
||||
int64_t ret = 0;
|
||||
if (doExtract(row, fp, &valType, retJS, false) == 0)
|
||||
@@ -192,7 +192,7 @@ int64_t Func_json_extract::getIntVal(rowgroup::Row& row, FunctionParm& fp, bool&
|
||||
double Func_json_extract::getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& /*isNull*/,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
json_value_types valType;
|
||||
double ret = 0.0;
|
||||
if (doExtract(row, fp, &valType, retJS, false) == 0)
|
||||
@@ -219,7 +219,7 @@ execplan::IDB_Decimal Func_json_extract::getDecimalVal(rowgroup::Row& row, Funct
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
json_value_types valType;
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
|
||||
if (doExtract(row, fp, &valType, retJS, false) == 0)
|
||||
{
|
||||
|
@@ -22,7 +22,7 @@ CalpontSystemCatalog::ColType Func_json_format::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_format::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_format::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto& js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -48,7 +48,7 @@ string Func_json_format::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& i
|
||||
|
||||
json_engine_t jsEg;
|
||||
initJSEngine(jsEg, getCharset(fp[0]), js);
|
||||
string ret;
|
||||
std::string ret;
|
||||
if (doFormat(&jsEg, ret, fmt, tabSize))
|
||||
{
|
||||
isNull = true;
|
||||
|
@@ -20,7 +20,7 @@ CalpontSystemCatalog::ColType Func_json_insert::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto& js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -40,7 +40,7 @@ string Func_json_insert::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& i
|
||||
initJSPaths(paths, fp, 1, 2);
|
||||
|
||||
// Save the result of each merge and the result of the final merge separately
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
utils::NullString tmpJS(js);
|
||||
for (size_t i = 1, j = 0; i < fp.size(); i += 2, j++)
|
||||
{
|
||||
|
@@ -14,7 +14,7 @@ using namespace funcexp::helpers;
|
||||
|
||||
namespace
|
||||
{
|
||||
bool checkKeyInList(const string& res, const uchar* key, const int keyLen)
|
||||
bool checkKeyInList(const std::string& res, const uchar* key, const int keyLen)
|
||||
{
|
||||
const uchar* curr = (const uchar*)res.c_str() + 2; /* beginning '["' */
|
||||
const uchar* end = (const uchar*)res.c_str() + res.size() - 1; /* ending '"' */
|
||||
@@ -51,7 +51,7 @@ CalpontSystemCatalog::ColType Func_json_keys::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_keys::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_keys::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -59,7 +59,7 @@ string Func_json_keys::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isN
|
||||
return "";
|
||||
|
||||
IntType keySize = 0;
|
||||
string ret;
|
||||
std::string ret;
|
||||
json_engine_t jsEg;
|
||||
initJSEngine(jsEg, getCharset(fp[0]), js);
|
||||
|
||||
|
@@ -13,7 +13,7 @@ using namespace funcexp::helpers;
|
||||
|
||||
namespace
|
||||
{
|
||||
int doMerge(string& retJS, json_engine_t* jsEg1, json_engine_t* jsEg2)
|
||||
int doMerge(std::string& retJS, json_engine_t* jsEg1, json_engine_t* jsEg2)
|
||||
{
|
||||
if (json_read_value(jsEg1) || json_read_value(jsEg2))
|
||||
return 1;
|
||||
@@ -214,7 +214,7 @@ CalpontSystemCatalog::ColType Func_json_merge::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_merge::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_merge::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -226,7 +226,7 @@ string Func_json_merge::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& is
|
||||
json_engine_t jsEg1, jsEg2;
|
||||
|
||||
utils::NullString tmpJS(js);
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
|
||||
for (size_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
|
@@ -13,7 +13,7 @@ using namespace funcexp::helpers;
|
||||
|
||||
namespace
|
||||
{
|
||||
int copyValuePatch(string& retJS, json_engine_t* jsEg)
|
||||
int copyValuePatch(std::string& retJS, json_engine_t* jsEg)
|
||||
{
|
||||
int firstKey = 1;
|
||||
|
||||
@@ -69,7 +69,7 @@ int copyValuePatch(string& retJS, json_engine_t* jsEg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int doMergePatch(string& retJS, json_engine_t* jsEg1, json_engine_t* jsEg2, bool& isEmpty)
|
||||
int doMergePatch(std::string& retJS, json_engine_t* jsEg1, json_engine_t* jsEg2, bool& isEmpty)
|
||||
{
|
||||
if (json_read_value(jsEg1))
|
||||
{
|
||||
@@ -266,7 +266,7 @@ CalpontSystemCatalog::ColType Func_json_merge_patch::operationType(
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_merge_patch::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_merge_patch::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
// JSON_MERGE_PATCH return NULL if any argument is NULL
|
||||
@@ -279,7 +279,7 @@ string Func_json_merge_patch::getStrVal(rowgroup::Row& row, FunctionParm& fp, bo
|
||||
jsEg1.s.error = jsEg2.s.error = 0;
|
||||
|
||||
utils::NullString tmpJS(js);
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
for (size_t i = 1; i < fp.size(); i++)
|
||||
{
|
||||
const auto& js2 = fp[i]->data()->getStrVal(row, isNull);
|
||||
|
@@ -22,13 +22,13 @@ CalpontSystemCatalog::ColType Func_json_normalize::operationType(
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_normalize::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_normalize::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto js_ns = fp[0]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
return "";
|
||||
const string_view js = js_ns.unsafeStringRef();
|
||||
const std::string_view js = js_ns.unsafeStringRef();
|
||||
|
||||
using DynamicString = unique_ptr<DYNAMIC_STRING, decltype(&dynstr_free)>;
|
||||
|
||||
|
@@ -25,14 +25,14 @@ CalpontSystemCatalog::ColType Func_json_object::operationType(FunctionParm& fp,
|
||||
return fp.size() > 0 ? fp[0]->data()->resultType() : resultType;
|
||||
}
|
||||
|
||||
string Func_json_object::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_object::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& type)
|
||||
{
|
||||
if (fp.size() == 0)
|
||||
return "{}";
|
||||
|
||||
const CHARSET_INFO* retCS = type.getCharset();
|
||||
string ret("{");
|
||||
std::string ret("{");
|
||||
|
||||
if (appendJSKeyName(ret, retCS, row, fp[0]) || appendJSValue(ret, retCS, row, fp[1]))
|
||||
goto error;
|
||||
|
@@ -14,13 +14,13 @@ namespace funcexp
|
||||
|
||||
class QueryJSONPathWrapper : public JSONPathWrapper
|
||||
{
|
||||
bool checkAndGetValue(JSONEgWrapper* je, string& res, int* error) override
|
||||
bool checkAndGetValue(JSONEgWrapper* je, std::string& res, int* error) override
|
||||
{
|
||||
return je->checkAndGetComplexVal(res, error);
|
||||
}
|
||||
};
|
||||
|
||||
bool JSONEgWrapper::checkAndGetComplexVal(string& ret, int* error)
|
||||
bool JSONEgWrapper::checkAndGetComplexVal(std::string& ret, int* error)
|
||||
{
|
||||
if (json_value_scalar(this))
|
||||
{
|
||||
@@ -47,10 +47,10 @@ CalpontSystemCatalog::ColType Func_json_query::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_query::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_query::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
string ret;
|
||||
std::string ret;
|
||||
QueryJSONPathWrapper qpw;
|
||||
isNull = qpw.extract(ret, row, fp[0], fp[1]);
|
||||
return isNull ? "" : ret;
|
||||
|
@@ -35,7 +35,7 @@ std::string Func_json_quote::getStrVal(rowgroup::Row& row, FunctionParm& fp, boo
|
||||
return "";
|
||||
}
|
||||
|
||||
string ret("\"");
|
||||
std::string ret("\"");
|
||||
|
||||
isNull = appendEscapedJS(ret, &my_charset_utf8mb4_bin, js, getCharset(fp[0]));
|
||||
if (isNull)
|
||||
|
@@ -20,7 +20,7 @@ CalpontSystemCatalog::ColType Func_json_remove::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_remove::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_remove::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto& js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -37,7 +37,7 @@ string Func_json_remove::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& i
|
||||
|
||||
initJSPaths(paths, fp, 1, 1);
|
||||
|
||||
string retJS;
|
||||
std::string retJS;
|
||||
utils::NullString tmpJS(js);
|
||||
for (size_t i = 1, j = 0; i < fp.size(); i++, j++)
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@ using namespace funcexp::helpers;
|
||||
|
||||
namespace
|
||||
{
|
||||
static bool appendJSPath(string& ret, const json_path_t* p)
|
||||
static bool appendJSPath(std::string& ret, const json_path_t* p)
|
||||
{
|
||||
const json_path_step_t* c;
|
||||
|
||||
@@ -35,7 +35,7 @@ static bool appendJSPath(string& ret, const json_path_t* p)
|
||||
else /*JSON_PATH_ARRAY*/
|
||||
{
|
||||
ret.append("[");
|
||||
ret.append(to_string(c->n_item));
|
||||
ret.append(std::to_string(c->n_item));
|
||||
ret.append("]");
|
||||
}
|
||||
}
|
||||
@@ -81,10 +81,10 @@ CalpontSystemCatalog::ColType Func_json_search::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_search::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_search::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
string ret;
|
||||
std::string ret;
|
||||
bool isNullJS = false, isNullVal = false;
|
||||
const auto& js = fp[0]->data()->getStrVal(row, isNull);
|
||||
const auto& cmpStr = fp[2]->data()->getStrVal(row, isNull);
|
||||
@@ -102,7 +102,7 @@ string Func_json_search::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& i
|
||||
const auto& mode_ns = fp[1]->data()->getStrVal(row, isNull);
|
||||
if (isNull)
|
||||
return "";
|
||||
string mode = mode_ns.safeString("");
|
||||
std::string mode = mode_ns.safeString("");
|
||||
|
||||
transform(mode.begin(), mode.end(), mode.begin(), ::tolower);
|
||||
if (mode != "one" && mode != "all")
|
||||
|
@@ -19,7 +19,7 @@ CalpontSystemCatalog::ColType Func_json_type::operationType(FunctionParm& fp,
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
string Func_json_type::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_type::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
const auto js = fp[0]->data()->getStrVal(row, isNull);
|
||||
@@ -27,7 +27,7 @@ string Func_json_type::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isN
|
||||
return "";
|
||||
|
||||
json_engine_t jsEg;
|
||||
string result;
|
||||
std::string result;
|
||||
|
||||
initJSEngine(jsEg, getCharset(fp[0]), js);
|
||||
|
||||
|
@@ -42,7 +42,7 @@ std::string Func_json_unquote::getStrVal(rowgroup::Row& row, FunctionParm& fp, b
|
||||
(uchar*)buf, (uchar*)(buf + jsEg.value_len))) >= 0)
|
||||
{
|
||||
buf[strLen] = '\0';
|
||||
string ret = buf;
|
||||
std::string ret = buf;
|
||||
return strLen == 0 ? "" : ret;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@ using namespace funcexp::helpers;
|
||||
|
||||
namespace funcexp
|
||||
{
|
||||
bool JSONEgWrapper::checkAndGetScalar(string& ret, int* error)
|
||||
bool JSONEgWrapper::checkAndGetScalar(std::string& ret, int* error)
|
||||
{
|
||||
CHARSET_INFO* cs;
|
||||
const uchar* js;
|
||||
@@ -111,16 +111,16 @@ class JSONPathWrapperValue : public JSONPathWrapper
|
||||
{
|
||||
}
|
||||
|
||||
bool checkAndGetValue(JSONEgWrapper* je, string& res, int* error) override
|
||||
bool checkAndGetValue(JSONEgWrapper* je, std::string& res, int* error) override
|
||||
{
|
||||
return je->checkAndGetScalar(res, error);
|
||||
}
|
||||
};
|
||||
|
||||
string Func_json_value::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
std::string Func_json_value::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& /*type*/)
|
||||
{
|
||||
string ret;
|
||||
std::string ret;
|
||||
JSONPathWrapperValue pw;
|
||||
isNull = pw.extract(ret, row, fp[0], fp[1]);
|
||||
return isNull ? "" : ret;
|
||||
|
@@ -26,7 +26,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
#include "rowgroup.h"
|
||||
|
@@ -202,7 +202,8 @@ inline void get_date_from_mysql_daynr(long daynr, dataconvert::DateTime& dateTim
|
||||
// else:
|
||||
// 0 = Monday, 1 = Tuesday, ..., 6 = Sunday
|
||||
// This is a mirror of calc_weekday, at a later date we should use sql_time.h
|
||||
inline uint32_t calc_mysql_weekday(uint32_t year, uint32_t month, uint32_t day, bool sundayFirst, bool& isNull)
|
||||
inline uint32_t calc_mysql_weekday(uint32_t year, uint32_t month, uint32_t day, bool sundayFirst,
|
||||
bool& isNull)
|
||||
{
|
||||
if (!dataconvert::isDateValid(day, month, year) || (day == 0 && month == 0 && year == 0))
|
||||
{
|
||||
@@ -642,21 +643,21 @@ inline int dayOfWeek(std::string day) // Sunday = 0
|
||||
return -1;
|
||||
}
|
||||
|
||||
inline string intToString(int64_t i)
|
||||
inline std::string intToString(int64_t i)
|
||||
{
|
||||
char buf[32];
|
||||
snprintf(buf, sizeof(buf), "%" PRId64 "", i);
|
||||
return buf;
|
||||
}
|
||||
|
||||
inline string uintToString(uint64_t i)
|
||||
inline std::string uintToString(uint64_t i)
|
||||
{
|
||||
char buf[32];
|
||||
snprintf(buf, sizeof(buf), "%" PRIu64 "", i);
|
||||
return buf;
|
||||
}
|
||||
|
||||
inline string doubleToString(double d)
|
||||
inline std::string doubleToString(double d)
|
||||
{
|
||||
// double's can be *really* long to print out. Max mysql
|
||||
// is e308 so allow for 308 + 36 decimal places minimum.
|
||||
@@ -665,7 +666,7 @@ inline string doubleToString(double d)
|
||||
return buf;
|
||||
}
|
||||
|
||||
inline string longDoubleToString(long double ld)
|
||||
inline std::string longDoubleToString(long double ld)
|
||||
{
|
||||
// long double's can be *really* long to print out. Max mysql
|
||||
// is e308 so allow for 308 + 36 decimal places minimum.
|
||||
|
@@ -30,19 +30,19 @@ static const int NO_WILDCARD_ALLOWED = 1;
|
||||
Checks if the path has '.*' '[*]' or '**' constructions
|
||||
and sets the NO_WILDCARD_ALLOWED error if the case.
|
||||
*/
|
||||
int setupJSPath(json_path_t* path, CHARSET_INFO* cs, const string_view& str, bool wildcards);
|
||||
int setupJSPath(json_path_t* path, CHARSET_INFO* cs, const std::string_view& str, bool wildcards);
|
||||
|
||||
// Return true if err occur, let the outer function handle the exception
|
||||
bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullString& js,
|
||||
bool appendEscapedJS(std::string& ret, const CHARSET_INFO* retCS, const utils::NullString& js,
|
||||
const CHARSET_INFO* jsCS);
|
||||
bool appendJSKeyName(string& ret, const CHARSET_INFO* retCS, rowgroup::Row& row, execplan::SPTP& parm);
|
||||
bool appendJSValue(string& ret, const CHARSET_INFO* retCS, rowgroup::Row& row, execplan::SPTP& parm);
|
||||
bool appendJSKeyName(std::string& ret, const CHARSET_INFO* retCS, rowgroup::Row& row, execplan::SPTP& parm);
|
||||
bool appendJSValue(std::string& ret, const CHARSET_INFO* retCS, rowgroup::Row& row, execplan::SPTP& parm);
|
||||
|
||||
static const int TAB_SIZE_LIMIT = 8;
|
||||
static const char tab_arr[TAB_SIZE_LIMIT + 1] = " ";
|
||||
|
||||
// Format the json using format mode
|
||||
int doFormat(json_engine_t* je, string& niceJS, Func_json_format::FORMATS mode, int tabSize = 4);
|
||||
int doFormat(json_engine_t* je, std::string& niceJS, Func_json_format::FORMATS mode, int tabSize = 4);
|
||||
|
||||
static const int SHOULD_END_WITH_ARRAY = 2;
|
||||
static const int TRIVIAL_PATH_NOT_ALLOWED = 3;
|
||||
@@ -94,13 +94,13 @@ inline void initJSEngine(json_engine_t& jsEg, const CHARSET_INFO* jsCS, const ut
|
||||
|
||||
int parseJSPath(JSONPath& path, rowgroup::Row& row, execplan::SPTP& parm, bool wildcards = true);
|
||||
|
||||
inline void initJSPaths(vector<JSONPath>& paths, FunctionParm& fp, const int start, const int step)
|
||||
inline void initJSPaths(std::vector<JSONPath>& paths, FunctionParm& fp, const int start, const int step)
|
||||
{
|
||||
if (paths.empty())
|
||||
for (size_t i = start; i < fp.size(); i += step)
|
||||
paths.emplace_back();
|
||||
}
|
||||
|
||||
bool matchJSPath(const vector<funcexp::JSONPath>& paths, const json_path_t* p, json_value_types valType,
|
||||
bool matchJSPath(const std::vector<funcexp::JSONPath>& paths, const json_path_t* p, json_value_types valType,
|
||||
const int* arrayCounter = nullptr, bool exact = true);
|
||||
} // namespace funcexp::helpers
|
||||
|
@@ -21,7 +21,7 @@
|
||||
#include <vector>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "../common/simpleallocator.h"
|
||||
#include "../joblist/elementtype.h"
|
||||
|
@@ -124,7 +124,7 @@ class TypelessDataDecoder
|
||||
void checkAvailableData(uint32_t nbytes) const
|
||||
{
|
||||
if (mPtr + nbytes > mEnd)
|
||||
throw runtime_error("TypelessData is too short");
|
||||
throw std::runtime_error("TypelessData is too short");
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -172,7 +172,7 @@ class TypelessDataDecoder
|
||||
class LongDoubleEq
|
||||
{
|
||||
public:
|
||||
LongDoubleEq(){};
|
||||
LongDoubleEq() {};
|
||||
inline bool operator()(const long double& pos1, const long double& pos2) const
|
||||
{
|
||||
return pos1 == pos2;
|
||||
@@ -204,7 +204,6 @@ class TypelessDataStructure
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
using RowPointersVec =
|
||||
std::vector<rowgroup::Row::Pointer, allocators::CountingAllocator<rowgroup::Row::Pointer>>;
|
||||
using RowPointersVecUP = std::unique_ptr<RowPointersVec>;
|
||||
@@ -279,7 +278,8 @@ class TupleJoiner
|
||||
/* ctor to use for string & compound join */
|
||||
TupleJoiner(const rowgroup::RowGroup& smallInput, const rowgroup::RowGroup& largeInput,
|
||||
const std::vector<uint32_t>& smallJoinColumns, const std::vector<uint32_t>& largeJoinColumns,
|
||||
joblist::JoinType jt, threadpool::ThreadPool* jsThreadPool, joblist::ResourceManager* rm, const uint64_t numCores);
|
||||
joblist::JoinType jt, threadpool::ThreadPool* jsThreadPool, joblist::ResourceManager* rm,
|
||||
const uint64_t numCores);
|
||||
|
||||
~TupleJoiner();
|
||||
|
||||
@@ -454,7 +454,7 @@ class TupleJoiner
|
||||
|
||||
// Wide-DECIMAL JOIN
|
||||
bool joinHasSkewedKeyColumn();
|
||||
inline const vector<uint32_t>& getSmallSideColumnsWidths() const
|
||||
inline const std::vector<uint32_t>& getSmallSideColumnsWidths() const
|
||||
{
|
||||
return smallRG.getColWidths();
|
||||
}
|
||||
@@ -473,10 +473,11 @@ class TupleJoiner
|
||||
|
||||
void initHashMaps(uint32_t& smallJoinColumn);
|
||||
void clearHashMaps();
|
||||
|
||||
private:
|
||||
template<typename K, typename V>
|
||||
using HashMapTemplate = std::unordered_multimap<K, V, hasher, std::equal_to<K>,
|
||||
utils::STLPoolAllocator<std::pair<const K, V>>>;
|
||||
template <typename K, typename V>
|
||||
using HashMapTemplate =
|
||||
std::unordered_multimap<K, V, hasher, std::equal_to<K>, utils::STLPoolAllocator<std::pair<const K, V>>>;
|
||||
using hash_t = HashMapTemplate<int64_t, uint8_t*>;
|
||||
using sthash_t = HashMapTemplate<int64_t, rowgroup::Row::Pointer>;
|
||||
using typelesshash_t = HashMapTemplate<TypelessData, rowgroup::Row::Pointer>;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class corr : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
corr() : mcsv1_UDAF(){};
|
||||
corr() : mcsv1_UDAF() {};
|
||||
~corr() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class covar_pop : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
covar_pop() : mcsv1_UDAF(){};
|
||||
covar_pop() : mcsv1_UDAF() {};
|
||||
~covar_pop() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class covar_samp : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
covar_samp() : mcsv1_UDAF(){};
|
||||
covar_samp() : mcsv1_UDAF() {};
|
||||
~covar_samp() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "columnwidth.h"
|
||||
|
||||
using namespace mcsv1sdk;
|
||||
using namespace std;
|
||||
|
||||
// This is the standard way to get a UDAF function into the system's
|
||||
// map of UDAF for lookup
|
||||
@@ -104,9 +105,7 @@ mcsv1_UDAF* moda::getImpl(mcsv1Context* context)
|
||||
case execplan::CalpontSystemCatalog::LONGDOUBLE: data->modaImpl = &moda_impl_longdouble; break;
|
||||
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
data->modaImpl = &moda_impl_string;
|
||||
break;
|
||||
case execplan::CalpontSystemCatalog::CHAR: data->modaImpl = &moda_impl_string; break;
|
||||
|
||||
default: data->modaImpl = NULL;
|
||||
}
|
||||
@@ -368,8 +367,7 @@ void ModaData::serialize(messageqcpp::ByteStream& bs) const
|
||||
case execplan::CalpontSystemCatalog::DOUBLE: serializeMap<double>(bs); break;
|
||||
case execplan::CalpontSystemCatalog::LONGDOUBLE: serializeMap<long double>(bs); break;
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
serializeMap<string>(bs); break;
|
||||
case execplan::CalpontSystemCatalog::VARCHAR: serializeMap<string>(bs); break;
|
||||
default: throw std::runtime_error("ModaData::serialize with bad data type"); break;
|
||||
}
|
||||
}
|
||||
@@ -408,8 +406,7 @@ void ModaData::unserialize(messageqcpp::ByteStream& bs)
|
||||
case execplan::CalpontSystemCatalog::DOUBLE: unserializeMap<double>(bs); break;
|
||||
case execplan::CalpontSystemCatalog::LONGDOUBLE: unserializeMap<long double>(bs); break;
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
unserializeMap<string>(bs); break;
|
||||
case execplan::CalpontSystemCatalog::VARCHAR: unserializeMap<string>(bs); break;
|
||||
default: throw std::runtime_error("ModaData::unserialize with bad data type"); break;
|
||||
}
|
||||
}
|
||||
@@ -503,7 +500,7 @@ void ModaData::cleanup()
|
||||
|
||||
/************************************************************************************************
|
||||
* String Specialization
|
||||
************************************************************************************************/
|
||||
************************************************************************************************/
|
||||
|
||||
mcsv1_UDAF::ReturnCode Moda_impl_T<string>::init(mcsv1Context* context, ColumnDatum* /*colTypes*/)
|
||||
{
|
||||
@@ -555,7 +552,8 @@ mcsv1_UDAF::ReturnCode Moda_impl_T<string>::subEvaluate(mcsv1Context* context, c
|
||||
|
||||
ModaData* outData = static_cast<ModaData*>(context->getUserData());
|
||||
const ModaData* inData = static_cast<const ModaData*>(userDataIn);
|
||||
std::unordered_map<string, uint32_t, hasher<string>, comparator<string> >* outMap = outData->getMap<string>();
|
||||
std::unordered_map<string, uint32_t, hasher<string>, comparator<string> >* outMap =
|
||||
outData->getMap<string>();
|
||||
std::unordered_map<string, uint32_t, hasher<string>, comparator<string> >* inMap = inData->getMap<string>();
|
||||
typename std::unordered_map<string, uint32_t, hasher<string>, comparator<string> >::const_iterator iter;
|
||||
|
||||
@@ -630,5 +628,3 @@ mcsv1_UDAF::ReturnCode Moda_impl_T<string>::dropValue(mcsv1Context* context, Col
|
||||
|
||||
return mcsv1_UDAF::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -91,12 +91,12 @@ struct hasher<long double>
|
||||
|
||||
// A collation aware hasher for strings
|
||||
template <>
|
||||
struct hasher<string>
|
||||
struct hasher<std::string>
|
||||
{
|
||||
explicit hasher(uint32_t cs_num) : fHasher(cs_num)
|
||||
{
|
||||
}
|
||||
inline size_t operator()(string val) const
|
||||
inline size_t operator()(std::string val) const
|
||||
{
|
||||
return fHasher(val.c_str(), val.size());
|
||||
}
|
||||
@@ -273,7 +273,7 @@ class Moda_impl_T : public mcsv1_UDAF
|
||||
};
|
||||
|
||||
template <> // string specialization
|
||||
class Moda_impl_T<string> : public mcsv1_UDAF
|
||||
class Moda_impl_T<std::string> : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
@@ -357,7 +357,7 @@ class moda : public mcsv1_UDAF
|
||||
Moda_impl_T<float> moda_impl_float;
|
||||
Moda_impl_T<double> moda_impl_double;
|
||||
Moda_impl_T<long double> moda_impl_longdouble;
|
||||
Moda_impl_T<string> moda_impl_string;
|
||||
Moda_impl_T<std::string> moda_impl_string;
|
||||
};
|
||||
|
||||
}; // namespace mcsv1sdk
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -59,7 +59,7 @@ class regr_avgx : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_avgx() : mcsv1_UDAF(){};
|
||||
regr_avgx() : mcsv1_UDAF() {};
|
||||
~regr_avgx() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_avgy : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_avgy() : mcsv1_UDAF(){};
|
||||
regr_avgy() : mcsv1_UDAF() {};
|
||||
~regr_avgy() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_count : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_count() : mcsv1_UDAF(){};
|
||||
regr_count() : mcsv1_UDAF() {};
|
||||
~regr_count() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_intercept : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_intercept() : mcsv1_UDAF(){};
|
||||
regr_intercept() : mcsv1_UDAF() {};
|
||||
~regr_intercept() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_r2 : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_r2() : mcsv1_UDAF(){};
|
||||
regr_r2() : mcsv1_UDAF() {};
|
||||
~regr_r2() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_slope : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_slope() : mcsv1_UDAF(){};
|
||||
regr_slope() : mcsv1_UDAF() {};
|
||||
~regr_slope() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_sxx : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_sxx() : mcsv1_UDAF(){};
|
||||
regr_sxx() : mcsv1_UDAF() {};
|
||||
~regr_sxx() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_sxy : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_sxy() : mcsv1_UDAF(){};
|
||||
regr_sxy() : mcsv1_UDAF() {};
|
||||
~regr_sxy() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -49,7 +49,7 @@ class regr_syy : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
regr_syy() : mcsv1_UDAF(){};
|
||||
regr_syy() : mcsv1_UDAF() {};
|
||||
~regr_syy() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -3,10 +3,11 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string.h>
|
||||
using namespace std;
|
||||
|
||||
#include "idb_mysql.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace
|
||||
{
|
||||
inline bool isNumeric(int type, const char* attr)
|
||||
|
@@ -32,8 +32,8 @@
|
||||
#include <cstdint>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered.h>
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include <boost/scoped_array.hpp>
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#ifndef NDEBUG
|
||||
#define NDEBUG
|
||||
@@ -239,16 +239,12 @@ again:
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
cerr <<
|
||||
__PRETTY_FUNCTION__ <<
|
||||
":" << __LINE__ << ": caught an exception: " << ex.what() << endl;
|
||||
cerr << __PRETTY_FUNCTION__ << ":" << __LINE__ << ": caught an exception: " << ex.what() << endl;
|
||||
throw;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cerr <<
|
||||
__PRETTY_FUNCTION__ <<
|
||||
":" << __LINE__ << ": caught an exception" << endl;
|
||||
cerr << __PRETTY_FUNCTION__ << ":" << __LINE__ << ": caught an exception" << endl;
|
||||
throw runtime_error("RWLock::down(): caught an exception");
|
||||
}
|
||||
}
|
||||
@@ -293,16 +289,12 @@ again:
|
||||
}
|
||||
catch (std::exception& ex)
|
||||
{
|
||||
cerr <<
|
||||
__PRETTY_FUNCTION__ <<
|
||||
":" << __LINE__ << ": caught an exception: " << ex.what() << endl;
|
||||
cerr << __PRETTY_FUNCTION__ << ":" << __LINE__ << ": caught an exception: " << ex.what() << endl;
|
||||
throw;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
cerr <<
|
||||
__PRETTY_FUNCTION__ <<
|
||||
":" << __LINE__ << ": caught an exception" << endl;
|
||||
cerr << __PRETTY_FUNCTION__ << ":" << __LINE__ << ": caught an exception" << endl;
|
||||
throw runtime_error("RWLock::timed_down(): caught an exception");
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@
|
||||
|
||||
using namespace idbdatafile;
|
||||
using namespace logging;
|
||||
|
||||
using namespace std;
|
||||
namespace statistics
|
||||
{
|
||||
StatisticsManager* StatisticsManager::instance()
|
||||
|
@@ -47,7 +47,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -70,7 +70,7 @@ class allnull : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
allnull() : mcsv1_UDAF(){};
|
||||
allnull() : mcsv1_UDAF() {};
|
||||
~allnull() override = default;
|
||||
|
||||
/**
|
||||
|
@@ -55,7 +55,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -101,7 +101,7 @@ class avg_mode : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
avg_mode() : mcsv1_UDAF(){};
|
||||
avg_mode() : mcsv1_UDAF() {};
|
||||
~avg_mode() override = default;
|
||||
|
||||
/**
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -60,7 +60,7 @@ class avgx : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
avgx() : mcsv1_UDAF(){};
|
||||
avgx() : mcsv1_UDAF() {};
|
||||
~avgx() override = default;
|
||||
|
||||
ReturnCode init(mcsv1Context* context, ColumnDatum* colTypes) override;
|
||||
|
@@ -67,7 +67,8 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "any.hpp"
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "wf_frame.h"
|
||||
|
@@ -55,7 +55,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -101,7 +101,7 @@ class median : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
median() : mcsv1_UDAF(){};
|
||||
median() : mcsv1_UDAF() {};
|
||||
~median() override = default;
|
||||
|
||||
/**
|
||||
|
@@ -55,7 +55,7 @@
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered.h>
|
||||
|
||||
#include "mcsv1_udaf.h"
|
||||
#include "calpontsystemcatalog.h"
|
||||
@@ -80,7 +80,7 @@ class ssq : public mcsv1_UDAF
|
||||
{
|
||||
public:
|
||||
// Defaults OK
|
||||
ssq() : mcsv1_UDAF(){};
|
||||
ssq() : mcsv1_UDAF() {};
|
||||
~ssq() override = default;
|
||||
|
||||
/**
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user