1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

C++20 fixes

This commit is contained in:
Leonid Fedorov
2022-02-01 15:54:05 +00:00
parent 0ee5203262
commit 65252df4f6
36 changed files with 22433 additions and 310 deletions

View File

@ -22,12 +22,12 @@
#include <unistd.h>
#include <typeinfo>
#include <regex>
#include <string>
#include <vector>
using namespace std;
#include <boost/shared_ptr.hpp>
#include <boost/regex.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include "altertableprocessor.h"
@ -2083,14 +2083,14 @@ void AlterTableProcessor::tableComment(uint32_t sessionID, execplan::CalpontSyst
CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
boost::algorithm::to_upper(ataTableComment.fTableComment);
boost::regex compat("[[:space:]]*AUTOINCREMENT[[:space:]]*=[[:space:]]*", boost::regex_constants::extended);
boost::match_results<std::string::const_iterator> what;
std::regex compat("[[:space:]]*AUTOINCREMENT[[:space:]]*=[[:space:]]*", std::regex_constants::extended);
std::match_results<std::string::const_iterator> what;
std::string::const_iterator start, end;
start = ataTableComment.fTableComment.begin();
end = ataTableComment.fTableComment.end();
boost::match_flag_type flags = boost::match_default;
std::regex_constants::match_flag_type flags = std::regex_constants::match_default;
if (boost::regex_search(start, end, what, compat, flags) && what[0].matched)
if (std::regex_search(start, end, what, compat, flags) && what[0].matched)
{
std::string params(&(*(what[0].second)));
char* ep = NULL;

View File

@ -36,7 +36,6 @@
#endif
#include <cstring>
#include <cmath>
#include <boost/regex.hpp>
#include "expressionparser.h"
#include "returnedcolumn.h"

View File

@ -63,7 +63,7 @@ typedef datatypes::Decimal IDB_Decimal;
#ifdef POSIX_REGEX
typedef regex_t IDB_Regex;
#else
typedef boost::regex IDB_Regex;
typedef std::regex IDB_Regex;
#endif
typedef IDB_Regex CNX_Regex;

View File

@ -479,7 +479,7 @@ class JobStep
bool fDelivery;
bool fOnClauseFilter;
volatile bool fDie;
volatile uint32_t fWaitToRunStepCnt;
uint32_t fWaitToRunStepCnt;
std::string fExtendedInfo;
std::string fMiniInfo;

View File

@ -1398,8 +1398,8 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
SP_LBIDList lbidList;
uint64_t ridsRequested;
uint64_t totalMsgs;
volatile uint64_t msgsSent;
volatile uint64_t msgsRecvd;
uint64_t msgsSent;
uint64_t msgsRecvd;
volatile bool finishedSending;
bool firstRead;
bool sendWaiting;

View File

@ -29,9 +29,6 @@
#include <sys/time.h>
using namespace std;
#include <boost/regex.hpp>
using namespace boost;
#include "resourcemanager.h"
#include "jl_logger.h"

View File

@ -18,38 +18,42 @@
/*
* $Id$
*/
#include <regex>
#include <string>
#include <boost/algorithm/string.hpp>
#include <utils/loggingcpp/idberrorinfo.h>
bool parseAutoincrementTableComment(std::string comment, uint64_t& startValue, std::string& columnName)
{
algorithm::to_upper(comment);
regex compat("[[:space:]]*AUTOINCREMENT[[:space:]]*=[[:space:]]*", regex_constants::extended);
boost::algorithm::to_upper(comment);
std::regex compat("[[:space:]]*AUTOINCREMENT[[:space:]]*=[[:space:]]*", std::regex_constants::extended);
bool autoincrement = false;
columnName = "";
boost::match_results<std::string::const_iterator> what;
std::match_results<std::string::const_iterator> what;
std::string::const_iterator start, end;
start = comment.begin();
end = comment.end();
boost::match_flag_type flags = boost::match_default;
std::regex_constants::match_flag_type flags = std::regex_constants::match_default;
if (boost::regex_search(start, end, what, compat, flags))
if (std::regex_search(start, end, what, compat, flags))
{
if (what[0].matched)
{
// string params (what[0].first, what[0].second);
string params(&(*(what[0].second)));
std::string params(&(*(what[0].second)));
unsigned i = params.find_first_of(",");
if (i <= params.length())
{
// check whether there is more autoincrement column
string restComment = params.substr(i + 1, params.length());
std::string restComment = params.substr(i + 1, params.length());
start = restComment.begin();
end = restComment.end();
if (boost::regex_search(start, end, what, compat, flags))
if (std::regex_search(start, end, what, compat, flags))
{
if (what[0].matched)
throw runtime_error(IDBErrorInfo::instance()->errorMsg(ERR_INVALID_NUMBER_AUTOINCREMENT));
throw runtime_error(logging::IDBErrorInfo::instance()->errorMsg(ERR_INVALID_NUMBER_AUTOINCREMENT));
}
columnName = params.substr(0, i);
@ -112,25 +116,25 @@ bool parseAutoincrementTableComment(std::string comment, uint64_t& startValue, s
bool parseAutoincrementColumnComment(std::string comment, uint64_t& startValue)
{
algorithm::to_upper(comment);
regex compat("[[:space:]]*AUTOINCREMENT[[:space:]]*", regex_constants::extended);
boost::algorithm::to_upper(comment);
std::regex compat("[[:space:]]*AUTOINCREMENT[[:space:]]*", std::regex_constants::extended);
bool autoincrement = false;
boost::match_results<std::string::const_iterator> what;
std::match_results<std::string::const_iterator> what;
std::string::const_iterator start, end;
start = comment.begin();
end = comment.end();
boost::match_flag_type flags = boost::match_default;
std::regex_constants::match_flag_type flags = std::regex_constants::match_default;
if (boost::regex_search(start, end, what, compat, flags))
if (std::regex_search(start, end, what, compat, flags))
{
if (what[0].matched)
{
string params(&(*(what[0].second)));
std::string params(&(*(what[0].second)));
unsigned i = params.find_first_of(",");
if (i <= params.length())
{
string startVal = params.substr(i + 1, params.length());
std::string startVal = params.substr(i + 1, params.length());
// get rid of possible empty space
i = startVal.find_first_not_of(" ");
@ -160,7 +164,7 @@ bool parseAutoincrementColumnComment(std::string comment, uint64_t& startValue)
// (no digits) || (more chars) || (other errors & value = 0)
if ((ep == str) || (*ep != '\0') || (errno != 0))
{
throw runtime_error(IDBErrorInfo::instance()->errorMsg(ERR_INVALID_START_VALUE));
throw runtime_error(logging::IDBErrorInfo::instance()->errorMsg(ERR_INVALID_START_VALUE));
}
}
}

View File

@ -25,27 +25,19 @@
#include <string>
#include <iostream>
#include <stack>
#ifdef _MSC_VER
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif
#include <fstream>
#include <sstream>
#include <cerrno>
#include <cstring>
#ifdef _MSC_VER
#include <unordered_set>
#else
#include <regex>
#include <tr1/unordered_set>
#endif
#include <utility>
#include <cassert>
using namespace std;
#include <boost/shared_ptr.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/regex.hpp>
#include <boost/tokenizer.hpp>
using namespace boost;
@ -142,16 +134,16 @@ CalpontSystemCatalog::ColDataType convertDataType(const ddlpackage::ColumnType&
int parseCompressionComment(std::string comment)
{
algorithm::to_upper(comment);
regex compat("[[:space:]]*COMPRESSION[[:space:]]*=[[:space:]]*", regex_constants::extended);
boost::algorithm::to_upper(comment);
std::regex compat("[[:space:]]*COMPRESSION[[:space:]]*=[[:space:]]*", std::regex_constants::extended);
int compressiontype = 0;
boost::match_results<std::string::const_iterator> what;
std::match_results<std::string::const_iterator> what;
std::string::const_iterator start, end;
start = comment.begin();
end = comment.end();
boost::match_flag_type flags = boost::match_default;
std::regex_constants::match_flag_type flags = std::regex_constants::match_default;
if (boost::regex_search(start, end, what, compat, flags))
if (std::regex_search(start, end, what, compat, flags))
{
// Find the pattern, now get the compression type
string compType(&(*(what[0].second)));
@ -1389,10 +1381,10 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
if (comment.length() > 0)
{
//@Bug 3782 This is for synchronization after calonlinealter to use
algorithm::to_upper(comment);
regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", regex_constants::extended);
boost::algorithm::to_upper(comment);
std::regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", std::regex_constants::extended);
if (regex_search(comment, pat))
if (std::regex_search(comment, pat))
{
return 0;
}
@ -2358,14 +2350,14 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
bool schemaSyncOnly = false;
bool isCreate = true;
regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", regex_constants::extended);
std::regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", std::regex_constants::extended);
if (regex_search(tablecomment, pat))
if (std::regex_search(tablecomment, pat))
{
schemaSyncOnly = true;
pat = createpatstr;
if (!regex_search(stmt, pat))
if (!std::regex_search(stmt, pat))
{
isCreate = false;
}
@ -2395,7 +2387,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
pat = alterpatstr;
if (regex_search(stmt, pat))
if (std::regex_search(stmt, pat))
{
ci.isAlter = true;
ci.alterTableState = cal_connection_info::ALTER_FIRST_RENAME;

View File

@ -45,7 +45,6 @@ using namespace std;
#include <boost/scoped_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/regex.hpp>
#include <boost/thread.hpp>
#include "errorids.h"

View File

@ -54,7 +54,6 @@ using namespace std;
#include <boost/shared_ptr.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/regex.hpp>
#include <boost/thread.hpp>
#include "mcs_basic_types.h"