diff --git a/dbcon/execplan/calpontsystemcatalog.cpp b/dbcon/execplan/calpontsystemcatalog.cpp index 3d2baf418..610b0c221 100644 --- a/dbcon/execplan/calpontsystemcatalog.cpp +++ b/dbcon/execplan/calpontsystemcatalog.cpp @@ -77,9 +77,7 @@ using namespace rowgroup; #include "idbregistry.h" #endif -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include +#include "collation.h" #undef BAIL_IF_0 #if 1 diff --git a/dbcon/execplan/predicateoperator.cpp b/dbcon/execplan/predicateoperator.cpp index f7e8bd826..4772a8b8c 100644 --- a/dbcon/execplan/predicateoperator.cpp +++ b/dbcon/execplan/predicateoperator.cpp @@ -30,10 +30,7 @@ #include "liboamcpp.h" -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include -#include +#include "collation.h" using namespace oam; diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index afd8014a4..8007485d2 100755 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -86,9 +86,7 @@ using namespace execplan; #include "functor.h" using namespace funcexp; -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include +#include "collation.h" const uint64_t AGG_BIT = 0x01; const uint64_t SUB_BIT = 0x02; diff --git a/ddlproc/ddlproc.cpp b/ddlproc/ddlproc.cpp index 169c42352..b8b231cb2 100644 --- a/ddlproc/ddlproc.cpp +++ b/ddlproc/ddlproc.cpp @@ -18,10 +18,6 @@ /****************************************************************************************** ******************************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -68,6 +64,8 @@ using namespace execplan; #include "crashtrace.h" #include "installdir.h" +#include "collation.h" + namespace { DistributedEngineComm* Dec; diff --git a/dmlproc/dmlproc.cpp b/dmlproc/dmlproc.cpp index 85cf53ccc..617023973 100644 --- a/dmlproc/dmlproc.cpp +++ b/dmlproc/dmlproc.cpp @@ -20,10 +20,6 @@ * * ***********************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -88,6 +84,8 @@ using namespace joblist; #include "crashtrace.h" #include "installdir.h" +#include "collation.h" + threadpool::ThreadPool DMLServer::fDmlPackagepool(10, 0); namespace diff --git a/exemgr/main.cpp b/exemgr/main.cpp index 88d8c998c..036fbbb75 100644 --- a/exemgr/main.cpp +++ b/exemgr/main.cpp @@ -39,10 +39,6 @@ * on the Front-End Processor where it is returned to the DBMS * front-end. */ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -80,6 +76,8 @@ #include "dbrm.h" +#include "collation.h" + namespace { diff --git a/primitives/linux-port/dictionary.cpp b/primitives/linux-port/dictionary.cpp index e4325c65c..b197a6948 100644 --- a/primitives/linux-port/dictionary.cpp +++ b/primitives/linux-port/dictionary.cpp @@ -34,10 +34,7 @@ using namespace std; #include "dataconvert.h" #include -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include -#include +#include "collation.h" using namespace logging; diff --git a/primitives/primproc/primproc.cpp b/primitives/primproc/primproc.cpp index 72ebef607..6a10c1c95 100644 --- a/primitives/primproc/primproc.cpp +++ b/primitives/primproc/primproc.cpp @@ -21,10 +21,6 @@ * * ***********************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -78,6 +74,8 @@ using namespace idbdatafile; #include "crashtrace.h" #include "installdir.h" +#include "collation.h" + namespace primitiveprocessor { diff --git a/utils/common/utils_utf8.cpp b/utils/common/utils_utf8.cpp index bd64ddd7a..d638e20d9 100644 --- a/utils/common/utils_utf8.cpp +++ b/utils/common/utils_utf8.cpp @@ -13,12 +13,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include -#include - #include "utils_utf8.h" +#include "collation.h" namespace utf8 { diff --git a/utils/funcexp/func_between.cpp b/utils/funcexp/func_between.cpp index e58c78c2b..ab6aef028 100644 --- a/utils/funcexp/func_between.cpp +++ b/utils/funcexp/func_between.cpp @@ -22,10 +22,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include using namespace std; @@ -41,6 +37,9 @@ using namespace execplan; #include "errorcodes.h" #include "idberrorinfo.h" #include "errorids.h" + +#include "collation.h" + using namespace logging; namespace diff --git a/utils/funcexp/func_case.cpp b/utils/funcexp/func_case.cpp index e69c12d84..327c02cc0 100644 --- a/utils/funcexp/func_case.cpp +++ b/utils/funcexp/func_case.cpp @@ -22,10 +22,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include //#define NDEBUG #include @@ -47,6 +43,8 @@ using namespace logging; #include "utils_utf8.h" using namespace funcexp; +#include "collation.h" + namespace { using namespace funcexp; diff --git a/utils/funcexp/func_char_length.cpp b/utils/funcexp/func_char_length.cpp index fb965cb3d..6812e8f0f 100644 --- a/utils/funcexp/func_char_length.cpp +++ b/utils/funcexp/func_char_length.cpp @@ -21,10 +21,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -42,6 +38,9 @@ using namespace execplan; #include "errorcodes.h" #include "idberrorinfo.h" #include "errorids.h" + +#include "collation.h" + using namespace logging; namespace funcexp diff --git a/utils/funcexp/func_concat_ws.cpp b/utils/funcexp/func_concat_ws.cpp index 0fe0c06f8..21d1ae955 100644 --- a/utils/funcexp/func_concat_ws.cpp +++ b/utils/funcexp/func_concat_ws.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -35,6 +32,8 @@ using namespace execplan; #include "rowgroup.h" using namespace rowgroup; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_find_in_set.cpp b/utils/funcexp/func_find_in_set.cpp index 7c4a07bd2..21f45943d 100644 --- a/utils/funcexp/func_find_in_set.cpp +++ b/utils/funcexp/func_find_in_set.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include #include @@ -45,6 +42,8 @@ using namespace execplan; #include "errorids.h" using namespace logging; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_greatest.cpp b/utils/funcexp/func_greatest.cpp index ff93fff3b..2c58ec481 100644 --- a/utils/funcexp/func_greatest.cpp +++ b/utils/funcexp/func_greatest.cpp @@ -22,10 +22,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -44,6 +40,7 @@ using namespace joblist; #include "utils_utf8.h" using namespace funcexp; +#include "collation.h" class to_lower { diff --git a/utils/funcexp/func_in.cpp b/utils/funcexp/func_in.cpp index f8ff745c5..bd0ae3662 100644 --- a/utils/funcexp/func_in.cpp +++ b/utils/funcexp/func_in.cpp @@ -22,10 +22,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include using namespace std; @@ -48,6 +44,8 @@ using namespace logging; #include "utils_utf8.h" using namespace funcexp; +#include "collation.h" + namespace { template diff --git a/utils/funcexp/func_insert.cpp b/utils/funcexp/func_insert.cpp index a3326bb68..a869ef4bf 100644 --- a/utils/funcexp/func_insert.cpp +++ b/utils/funcexp/func_insert.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -40,6 +37,8 @@ using namespace joblist; #include "utf8.h" using namespace utf8; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_instr.cpp b/utils/funcexp/func_instr.cpp index f335eab71..dae5fb473 100644 --- a/utils/funcexp/func_instr.cpp +++ b/utils/funcexp/func_instr.cpp @@ -20,10 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include -#include #include #include @@ -36,6 +32,8 @@ using namespace std; #include "utils_utf8.h" using namespace execplan; +#include "collation.h" + namespace funcexp { CalpontSystemCatalog::ColType Func_instr::operationType( FunctionParm& fp, CalpontSystemCatalog::ColType& resultType ) diff --git a/utils/funcexp/func_lcase.cpp b/utils/funcexp/func_lcase.cpp index 6c40f1f2f..073c92f40 100644 --- a/utils/funcexp/func_lcase.cpp +++ b/utils/funcexp/func_lcase.cpp @@ -20,10 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include -#include #include using namespace std; @@ -39,6 +35,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + class to_lower { public: diff --git a/utils/funcexp/func_least.cpp b/utils/funcexp/func_least.cpp index 84f7559b2..f8256ac60 100644 --- a/utils/funcexp/func_least.cpp +++ b/utils/funcexp/func_least.cpp @@ -22,10 +22,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -44,6 +40,8 @@ using namespace joblist; #include "utils_utf8.h" using namespace funcexp; +#include "collation.h" + class to_lower { public: diff --git a/utils/funcexp/func_left.cpp b/utils/funcexp/func_left.cpp index 99fd6b015..6c8bad1e2 100644 --- a/utils/funcexp/func_left.cpp +++ b/utils/funcexp/func_left.cpp @@ -20,10 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include using namespace std; @@ -38,6 +34,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_length.cpp b/utils/funcexp/func_length.cpp index c51c0be32..98e941ab1 100644 --- a/utils/funcexp/func_length.cpp +++ b/utils/funcexp/func_length.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include #include @@ -36,6 +33,8 @@ using namespace execplan; #include "rowgroup.h" +#include "collation.h" + namespace funcexp { CalpontSystemCatalog::ColType Func_length::operationType( FunctionParm& fp, CalpontSystemCatalog::ColType& resultType ) diff --git a/utils/funcexp/func_lpad.cpp b/utils/funcexp/func_lpad.cpp index fad05e360..d66fe2541 100644 --- a/utils/funcexp/func_lpad.cpp +++ b/utils/funcexp/func_lpad.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include "errorids.h" #include @@ -39,6 +36,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { const string Func_lpad::fPad = " "; diff --git a/utils/funcexp/func_ltrim.cpp b/utils/funcexp/func_ltrim.cpp index 520300bc2..5af7dd3b9 100644 --- a/utils/funcexp/func_ltrim.cpp +++ b/utils/funcexp/func_ltrim.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -38,6 +35,7 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" namespace funcexp { diff --git a/utils/funcexp/func_nullif.cpp b/utils/funcexp/func_nullif.cpp index 9b5e8c113..ca835e5bc 100644 --- a/utils/funcexp/func_nullif.cpp +++ b/utils/funcexp/func_nullif.cpp @@ -22,10 +22,10 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#undef LONGLONG_MIN -#include +//#include +//#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost +//#undef LONGLONG_MIN +//#include #include #include @@ -50,6 +50,8 @@ using namespace dataconvert; #include "utils_utf8.h" using namespace funcexp; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_replace.cpp b/utils/funcexp/func_replace.cpp index 3bc6a6aaf..0c16c9174 100644 --- a/utils/funcexp/func_replace.cpp +++ b/utils/funcexp/func_replace.cpp @@ -21,10 +21,6 @@ * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include using namespace std; @@ -38,6 +34,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_right.cpp b/utils/funcexp/func_right.cpp index b0dbfd289..cfcb3c45f 100644 --- a/utils/funcexp/func_right.cpp +++ b/utils/funcexp/func_right.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -38,6 +35,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_rpad.cpp b/utils/funcexp/func_rpad.cpp index da5155b6a..1a8841f34 100644 --- a/utils/funcexp/func_rpad.cpp +++ b/utils/funcexp/func_rpad.cpp @@ -20,10 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include "errorids.h" #include using namespace std; @@ -39,7 +35,7 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; -#define STRCOLL_ENH__ +#include "collation.h" namespace funcexp { @@ -115,10 +111,10 @@ std::string Func_rpad::getStrVal(rowgroup::Row& row, while (padLength >= plen) { - memcpy(pBuf, posP, plen); + memcpy(pBuf, posP, binPLen); padLength -= plen; - byteCount += plen; - pBuf += plen; + byteCount += binPLen; + pBuf += binPLen; } // Sometimes, in a case with multi-char pad, we need to add a partial pad if (padLength > 0) diff --git a/utils/funcexp/func_rtrim.cpp b/utils/funcexp/func_rtrim.cpp index 9cfd8b71b..77dc22424 100644 --- a/utils/funcexp/func_rtrim.cpp +++ b/utils/funcexp/func_rtrim.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -38,6 +35,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_strcmp.cpp b/utils/funcexp/func_strcmp.cpp index 2b0c6a2f1..743903f42 100644 --- a/utils/funcexp/func_strcmp.cpp +++ b/utils/funcexp/func_strcmp.cpp @@ -20,13 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include #include @@ -46,6 +39,8 @@ using namespace joblist; #include "utils_utf8.h" using namespace funcexp; +#include "collation.h" + // Because including my_sys.h in a Columnstore header causes too many conflicts struct charset_info_st; typedef const struct charset_info_st CHARSET_INFO; diff --git a/utils/funcexp/func_substr.cpp b/utils/funcexp/func_substr.cpp index 4d0a4e90d..3f8be7373 100644 --- a/utils/funcexp/func_substr.cpp +++ b/utils/funcexp/func_substr.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -38,6 +35,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + #define STRCOLL_ENH__ namespace funcexp diff --git a/utils/funcexp/func_substring_index.cpp b/utils/funcexp/func_substring_index.cpp index 2bcad60eb..970b3d28c 100644 --- a/utils/funcexp/func_substring_index.cpp +++ b/utils/funcexp/func_substring_index.cpp @@ -21,10 +21,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include using namespace std; @@ -38,6 +34,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { diff --git a/utils/funcexp/func_trim.cpp b/utils/funcexp/func_trim.cpp index 7a3ca9e88..2a522d3fb 100644 --- a/utils/funcexp/func_trim.cpp +++ b/utils/funcexp/func_trim.cpp @@ -20,9 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include using namespace std; @@ -38,6 +35,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + namespace funcexp { CalpontSystemCatalog::ColType Func_trim::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType) diff --git a/utils/funcexp/func_ucase.cpp b/utils/funcexp/func_ucase.cpp index a19594977..f8d21b8a2 100644 --- a/utils/funcexp/func_ucase.cpp +++ b/utils/funcexp/func_ucase.cpp @@ -20,10 +20,6 @@ * * ****************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include -#include #include using namespace std; @@ -39,6 +35,8 @@ using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; +#include "collation.h" + class to_upper { public: diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index 736ae67dd..5c02d0c48 100755 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -24,10 +24,6 @@ * is the primary class. */ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - #include #include #include @@ -55,6 +51,8 @@ #include "calpontsystemcatalog.h" #include "utils_utf8.h" +#include "collation.h" + //..comment out NDEBUG to enable assertions, uncomment NDEBUG to disable //#define NDEBUG diff --git a/utils/rowgroup/rowgroup.cpp b/utils/rowgroup/rowgroup.cpp index 072c97651..2bfcca9fc 100644 --- a/utils/rowgroup/rowgroup.cpp +++ b/utils/rowgroup/rowgroup.cpp @@ -26,10 +26,6 @@ // Author: Patrick LeBlanc , (C) 2008 // -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include - //#define NDEBUG #include #include @@ -47,6 +43,8 @@ using namespace execplan; #include "nullvaluemanip.h" #include "rowgroup.h" +#include "collation.h" + namespace rowgroup { diff --git a/utils/windowfunction/idborderby.cpp b/utils/windowfunction/idborderby.cpp index cbd7a2028..58440de14 100644 --- a/utils/windowfunction/idborderby.cpp +++ b/utils/windowfunction/idborderby.cpp @@ -18,9 +18,6 @@ // $Id: idborderby.cpp 3932 2013-06-25 16:08:10Z xlou $ - -#include -#include #include #include #include @@ -51,6 +48,8 @@ using namespace rowgroup; #include "joblisttypes.h" +#include "collation.h" + // See agg_arg_charsets in sql_type.h to see conversion rules for // items that have different char sets namespace ordering diff --git a/writeengine/server/we_server.cpp b/writeengine/server/we_server.cpp index 1ac633cdf..1dda4bf0a 100644 --- a/writeengine/server/we_server.cpp +++ b/writeengine/server/we_server.cpp @@ -19,9 +19,6 @@ * $Id: we_server.cpp 4700 2013-07-08 16:43:49Z bpaul $ * *******************************************************************************/ -#include -#undef set_bits // mariadb.h defines set_bits, which is incompatible with boost -#include #include #include @@ -44,7 +41,6 @@ using namespace messageqcpp; using namespace threadpool; #include "we_readthread.h" -using namespace WriteEngine; #include "liboamcpp.h" using namespace oam; @@ -56,6 +52,10 @@ using namespace oam; #include "crashtrace.h" +#include "collation.h" + +using namespace WriteEngine; + namespace { void added_a_pm(int)