1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Merge branch 'develop-1.0' into 1.0-merge-up

This commit is contained in:
Andrew Hutchings
2017-11-30 15:09:11 +00:00
10 changed files with 45 additions and 9 deletions

View File

@ -112,7 +112,7 @@ ParseTree* replaceRefCol(ParseTree*& n, CalpontSelectExecutionPlan::ReturnedColu
else if (rc) else if (rc)
{ {
SimpleColumn* sc = dynamic_cast<SimpleColumn*>(rc); SimpleColumn* sc = dynamic_cast<SimpleColumn*>(rc);
if (sc) if (sc && (sc->colPosition() > -1))
{ {
ReturnedColumn* tmp = derivedColList[sc->colPosition()]->clone(); ReturnedColumn* tmp = derivedColList[sc->colPosition()]->clone();
delete sc; delete sc;

View File

@ -38,6 +38,7 @@
#include <cerrno> #include <cerrno>
#include <cstring> #include <cstring>
#include <time.h> #include <time.h>
//#define NDEBUG
#include <cassert> #include <cassert>
#include <vector> #include <vector>
#include <map> #include <map>
@ -2289,6 +2290,8 @@ CalpontSystemCatalog::ColType colType_MysqlToIDB (const Item* item)
{ {
if (ct.colWidth < 20) if (ct.colWidth < 20)
ct.colWidth = 20; // for infinidb date length ct.colWidth = 20; // for infinidb date length
if (ct.colWidth > 65535)
ct.colWidth = 65535;
} }
// @bug5083. MySQL gives string type for date/datetime column. // @bug5083. MySQL gives string type for date/datetime column.
// need to adjust here. // need to adjust here.

View File

@ -2811,8 +2811,6 @@ namespace oam
// Get Server Type Install ID // Get Server Type Install ID
serverTypeInstall = atoi(sysConfig->getConfig("Installation", "ServerTypeInstall").c_str()); serverTypeInstall = atoi(sysConfig->getConfig("Installation", "ServerTypeInstall").c_str());
sysConfig;
} }
catch (...) {} catch (...) {}

View File

@ -1488,7 +1488,7 @@ namespace oam
* @param DeviceNetworkConfig the Modules added * @param DeviceNetworkConfig the Modules added
* @param password Host Root Password * @param password Host Root Password
*/ */
EXPORT void addModule(DeviceNetworkList devicenetworklist, const std::string password, const std::string mysqlpw); EXPORT void addModule(DeviceNetworkList devicenetworklist, const std::string password);
/** @brief remove Module /** @brief remove Module
* *

View File

@ -502,6 +502,8 @@ static void startMgrProcessThread()
ModuleTypeConfig PMSmoduletypeconfig; ModuleTypeConfig PMSmoduletypeconfig;
ALARMManager aManager; ALARMManager aManager;
int waitTime = 90;
int waitTime = 180; int waitTime = 180;
log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG); log.writeLog(__LINE__, "startMgrProcessThread launched", LOG_TYPE_DEBUG);

View File

@ -500,6 +500,11 @@ public:
int changeMyCnf(std::string type); int changeMyCnf(std::string type);
/**
*@brief run MariaDB Command Line script
*/
int runMariaDBCommandLine(std::string command);
/** /**
*@brief run MariaDB Command Line script *@brief run MariaDB Command Line script
*/ */

View File

@ -195,6 +195,29 @@ std::string wstring_to_utf8 (const std::wstring& str)
return std::string(outbuf, strmblen); return std::string(outbuf, strmblen);
} }
inline
uint8_t utf8_truncate_point(const char* input, size_t length)
{
// Find the beginning of a multibyte char to truncate at and return the
// number of bytes to truncate
if (length < 3)
{
return 0;
}
const unsigned char *b = (const unsigned char*)(input) + length - 3;
if (b[2] & 0x80)
{
// First byte in a new multi-byte sequence
if (b[2] & 0x40) return 1;
// 3 byte sequence
else if ((b[1] & 0xe0) == 0xe0) return 2;
// 4 byte sequence
else if ((b[0] & 0xf0) == 0xf0) return 3;
}
return 0;
}
} //namespace utf8 } //namespace utf8
} //namespace funcexp } //namespace funcexp

View File

@ -41,6 +41,8 @@
#include "joblisttypes.h" #include "joblisttypes.h"
#include "utils_utf8.h"
using namespace std; using namespace std;
using namespace boost; using namespace boost;
using namespace execplan; using namespace execplan;
@ -513,7 +515,8 @@ void BulkLoadBuffer::convert(char *field, int fieldLength,
// on disk (e.g. 5 for a varchar(5) instead of 8). // on disk (e.g. 5 for a varchar(5) instead of 8).
if (fieldLength > column.definedWidth) if (fieldLength > column.definedWidth)
{ {
memcpy( charTmpBuf, field, column.definedWidth ); uint8_t truncate_point = funcexp::utf8::utf8_truncate_point(field, column.definedWidth);
memcpy( charTmpBuf, field, column.definedWidth - truncate_point );
bufStats.satCount++; bufStats.satCount++;
} }
else else

View File

@ -47,6 +47,7 @@ using namespace BRM;
#include "IDBPolicy.h" #include "IDBPolicy.h"
#include "cacheutils.h" #include "cacheutils.h"
using namespace idbdatafile; using namespace idbdatafile;
#include "utils_utf8.h"
namespace namespace
{ {
@ -823,7 +824,8 @@ int Dctnry::insertDctnry(const char* buf,
// @Bug 2565: Truncate any strings longer than schema's column width // @Bug 2565: Truncate any strings longer than schema's column width
if (curSig.size > m_colWidth) if (curSig.size > m_colWidth)
{ {
curSig.size = m_colWidth; uint8_t truncate_point = funcexp::utf8::utf8_truncate_point((const char*)curSig.signature, m_colWidth);
curSig.size = m_colWidth - truncate_point;
++truncCount; ++truncCount;
} }