1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Merge branch 'develop-1.1' into develop-1.2-merge-up-20190619

This commit is contained in:
Andrew Hutchings
2019-06-19 18:34:43 +01:00
6 changed files with 40 additions and 18 deletions

View File

@ -548,6 +548,10 @@ public:
return fDerivedTbAlias;
}
void derivedTbView(const std::string derivedTbView) { fDerivedTbView = derivedTbView; }
const std::string derivedTbView() const { return fDerivedTbView; }
void limitStart(const uint64_t limitStart)
{
fLimitStart = limitStart;
@ -861,6 +865,7 @@ private:
// for subselect
uint64_t fSubType;
std::string fDerivedTbAlias;
std::string fDerivedTbView;
// for limit
uint64_t fLimitStart;

View File

@ -862,6 +862,12 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
case CalpontSystemCatalog::VARCHAR:
{
size_t length;
if (ci.utf8)
length = (ci.columnTypes[colpos].colWidth * 3);
else
length = ci.columnTypes[colpos].colWidth;
if (nullVal && (ci.columnTypes[colpos].constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT))
{
fprintf(ci.filePtr, "%c", ci.delimiter);
@ -905,7 +911,7 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
dataLength = *(uint16_t*) buf;
buf = buf + 2 ;
}
length = dataLength;
escape.assign((char*)buf, dataLength);
boost::replace_all(escape, "\\", "\\\\");
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
@ -922,9 +928,7 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
dataLength = *(uint16_t*) buf;
buf = buf + 2 ;
}
if ( dataLength > ci.columnTypes[colpos].colWidth)
dataLength = ci.columnTypes[colpos].colWidth;
length = dataLength;
escape.assign((char*)buf, dataLength);
boost::replace_all(escape, "\\", "\\\\");
@ -932,12 +936,7 @@ int ha_calpont_impl_write_batch_row_(uchar* buf, TABLE* table, cal_impl_if::cal_
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
}
}
//buf += ci.columnTypes[colpos].colWidth;
if (ci.utf8)
buf += (ci.columnTypes[colpos].colWidth * 3);
else
buf += ci.columnTypes[colpos].colWidth;
buf += length;
break;
}

View File

@ -2183,7 +2183,14 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
sc->colPosition(j);
string tableAlias(csep->derivedTbAlias());
sc->tableAlias(lower(tableAlias));
sc->viewName(lower(viewName));
if (!viewName.empty())
{
sc->viewName(viewName);
}
else
{
sc->viewName(csep->derivedTbView());
}
sc->resultType(cols[j]->resultType());
sc->hasAggregate(cols[j]->hasAggregate());

View File

@ -649,7 +649,11 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
// bug 3485, reserve enough space for the longest float value
// -3.402823466E+38 to -1.175494351E-38, 0, and
// 1.175494351E-38 to 3.402823466E+38.
if (!f2->dec)
{
(*f)->field_length = 40;
f2->dec = row.getScale(s);
}
//float float_val = *(float*)(&value);
//f2->store(float_val);
@ -679,7 +683,11 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
// bug 3483, reserve enough space for the longest double value
// -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
// 2.2250738585072014E-308 to 1.7976931348623157E+308.
if (!f2->dec)
{
(*f)->field_length = 310;
f2->dec = row.getScale(s);
}
//double double_val = *(double*)(&value);
//f2->store(double_val);

View File

@ -338,6 +338,7 @@ SCSEP FromSubQuery::transform()
gwi.subQuery = this;
gwi.viewName = fGwip.viewName;
csep->derivedTbAlias(fAlias); // always lower case
csep->derivedTbView(fGwip.viewName.alias);
if (getSelectPlan(gwi, *fFromSub, csep) != 0)
{

View File

@ -569,14 +569,16 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
}
// Swap byte order before comparing character string
int64_t binChar = static_cast<int64_t>( uint64ToStr(
*(reinterpret_cast<uint64_t*>(charTmpBuf)) ) );
// Compare must be unsigned
uint64_t compChar = uint64ToStr( *(reinterpret_cast<uint64_t*>(charTmpBuf)) );
int64_t binChar = static_cast<int64_t>( compChar );
// Update min/max range
if (binChar < bufStats.minBufferVal)
uint64_t minVal = static_cast<uint64_t>( bufStats.minBufferVal );
uint64_t maxVal = static_cast<uint64_t>( bufStats.maxBufferVal );
if (compChar < minVal)
bufStats.minBufferVal = binChar;
if (binChar > bufStats.maxBufferVal)
if (compChar > maxVal)
bufStats.maxBufferVal = binChar;
pVal = charTmpBuf;