1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Merge branch 'develop-1.2' into MCOL-1559

This commit is contained in:
David Hall
2019-07-23 10:21:23 -05:00
4 changed files with 10 additions and 30 deletions

View File

@@ -399,7 +399,6 @@ void checkHavingClause(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
void preProcessFunctionOnAggregation(const vector<SimpleColumn*>& scs, void preProcessFunctionOnAggregation(const vector<SimpleColumn*>& scs,
const vector<AggregateColumn*>& aggs, const vector<AggregateColumn*>& aggs,
const vector<WindowFunctionColumn*>& wcs,
JobInfo& jobInfo) JobInfo& jobInfo)
{ {
// append the simple columns if not already projected // append the simple columns if not already projected
@@ -433,10 +432,6 @@ void preProcessFunctionOnAggregation(const vector<SimpleColumn*>& scs,
for (vector<AggregateColumn*>::const_iterator i = aggs.begin(); i != aggs.end(); i++) for (vector<AggregateColumn*>::const_iterator i = aggs.begin(); i != aggs.end(); i++)
{ {
addAggregateColumn(*i, -1, jobInfo.projectionCols, jobInfo); addAggregateColumn(*i, -1, jobInfo.projectionCols, jobInfo);
if (wcs.size() > 0)
{
jobInfo.nonConstDelCols.push_back(SRCP((*i)->clone()));
}
} }
} }
@@ -488,12 +483,12 @@ void checkReturnedColumns(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
if (ac != NULL && ac->aggColumnList().size() > 0) if (ac != NULL && ac->aggColumnList().size() > 0)
{ {
jobInfo.nonConstCols[i]->outputIndex(i); jobInfo.nonConstCols[i]->outputIndex(i);
preProcessFunctionOnAggregation(ac->simpleColumnList(), ac->aggColumnList(), ac->windowfunctionColumnList(), jobInfo); preProcessFunctionOnAggregation(ac->simpleColumnList(), ac->aggColumnList(), jobInfo);
} }
else if (fc != NULL && fc->aggColumnList().size() > 0) else if (fc != NULL && fc->aggColumnList().size() > 0)
{ {
jobInfo.nonConstCols[i]->outputIndex(i); jobInfo.nonConstCols[i]->outputIndex(i);
preProcessFunctionOnAggregation(fc->simpleColumnList(), fc->aggColumnList(), fc->windowfunctionColumnList(), jobInfo); preProcessFunctionOnAggregation(fc->simpleColumnList(), fc->aggColumnList(), jobInfo);
} }
} }
} }

View File

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

View File

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

View File

@@ -1772,7 +1772,8 @@ inline void copyRow(const Row& in, Row* out, uint32_t colCount)
{ {
if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::VARBINARY || if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::VARBINARY ||
in.getColTypes()[i] == execplan::CalpontSystemCatalog::BLOB || in.getColTypes()[i] == execplan::CalpontSystemCatalog::BLOB ||
in.getColTypes()[i] == execplan::CalpontSystemCatalog::TEXT)) in.getColTypes()[i] == execplan::CalpontSystemCatalog::TEXT ||
in.getColTypes()[i] == execplan::CalpontSystemCatalog::CLOB))
out->setVarBinaryField(in.getVarBinaryStringField(i), i); out->setVarBinaryField(in.getVarBinaryStringField(i), i);
else if (UNLIKELY(in.isLongString(i))) else if (UNLIKELY(in.isLongString(i)))
//out->setStringField(in.getStringField(i), i); //out->setStringField(in.getStringField(i), i);