You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-18 13:54:11 +03:00
Merge pull request #190 from mariadb-corporation/MCOL-730-1.0
MCOL-730 Fix decimals in cross engine join
This commit is contained in:
@@ -247,7 +247,7 @@ void CrossEngineStep::makeMappings()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CrossEngineStep::setField(int i, const char* value, Row& row)
|
void CrossEngineStep::setField(int i, const char* value, drizzle_column_st* field, Row& row)
|
||||||
{
|
{
|
||||||
CalpontSystemCatalog::ColDataType colType = row.getColType(i);
|
CalpontSystemCatalog::ColDataType colType = row.getColType(i);
|
||||||
|
|
||||||
@@ -263,9 +263,17 @@ void CrossEngineStep::setField(int i, const char* value, Row& row)
|
|||||||
{
|
{
|
||||||
CalpontSystemCatalog::ColType ct;
|
CalpontSystemCatalog::ColType ct;
|
||||||
ct.colDataType = colType;
|
ct.colDataType = colType;
|
||||||
ct.colWidth = row.getColumnWidth(i);
|
ct.colWidth = row.getColumnWidth(i);
|
||||||
ct.scale = row.getScale(i);
|
if (colType == CalpontSystemCatalog::DECIMAL)
|
||||||
ct.precision = row.getPrecision(i);
|
{
|
||||||
|
ct.scale = field->decimals;
|
||||||
|
ct.precision = field->size;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ct.scale = row.getScale(i);
|
||||||
|
ct.precision = row.getPrecision(i);
|
||||||
|
}
|
||||||
row.setIntField(convertValueNum(value, ct, row.getSignedNullValue(i)), i);
|
row.setIntField(convertValueNum(value, ct, row.getSignedNullValue(i)), i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -500,7 +508,7 @@ void CrossEngineStep::execute()
|
|||||||
while ((rowIn = drizzle->nextRow()) && !cancelled())
|
while ((rowIn = drizzle->nextRow()) && !cancelled())
|
||||||
{
|
{
|
||||||
for(int i = 0; i < num_fields; i++)
|
for(int i = 0; i < num_fields; i++)
|
||||||
setField(i, rowIn[i], fRowDelivered);
|
setField(i, rowIn[i], drizzle->getField(i), fRowDelivered);
|
||||||
|
|
||||||
addRow(rgDataDelivered);
|
addRow(rgDataDelivered);
|
||||||
}
|
}
|
||||||
@@ -520,7 +528,7 @@ void CrossEngineStep::execute()
|
|||||||
for(int i = 0; i < num_fields; i++)
|
for(int i = 0; i < num_fields; i++)
|
||||||
{
|
{
|
||||||
if (fFe1Column[i] != -1)
|
if (fFe1Column[i] != -1)
|
||||||
setField(fFe1Column[i], rowIn[i], rowFe1);
|
setField(fFe1Column[i], rowIn[i], drizzle->getField(i), rowFe1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fFeFilters && fFeInstance->evaluate(rowFe1, fFeFilters.get()) == false)
|
if (fFeFilters && fFeInstance->evaluate(rowFe1, fFeFilters.get()) == false)
|
||||||
@@ -534,7 +542,7 @@ void CrossEngineStep::execute()
|
|||||||
for(int i = 0; i < num_fields; i++)
|
for(int i = 0; i < num_fields; i++)
|
||||||
{
|
{
|
||||||
if (fFe1Column[i] == -1)
|
if (fFe1Column[i] == -1)
|
||||||
setField(i, rowIn[i], fRowDelivered);
|
setField(i, rowIn[i], drizzle->getField(i), fRowDelivered);
|
||||||
}
|
}
|
||||||
|
|
||||||
addRow(rgDataDelivered);
|
addRow(rgDataDelivered);
|
||||||
@@ -552,7 +560,7 @@ void CrossEngineStep::execute()
|
|||||||
while ((rowIn = drizzle->nextRow()) && !cancelled())
|
while ((rowIn = drizzle->nextRow()) && !cancelled())
|
||||||
{
|
{
|
||||||
for(int i = 0; i < num_fields; i++)
|
for(int i = 0; i < num_fields; i++)
|
||||||
setField(i, rowIn[i], rowFe3);
|
setField(i, rowIn[i], drizzle->getField(i), rowFe3);
|
||||||
|
|
||||||
fFeInstance->evaluate(rowFe3, fFeSelects);
|
fFeInstance->evaluate(rowFe3, fFeSelects);
|
||||||
fFeInstance->evaluate(rowFe3, fFeSelects);
|
fFeInstance->evaluate(rowFe3, fFeSelects);
|
||||||
@@ -583,7 +591,7 @@ void CrossEngineStep::execute()
|
|||||||
for(int i = 0; i < num_fields; i++)
|
for(int i = 0; i < num_fields; i++)
|
||||||
{
|
{
|
||||||
if (fFe1Column[i] != -1)
|
if (fFe1Column[i] != -1)
|
||||||
setField(fFe1Column[i], rowIn[i], rowFe1);
|
setField(fFe1Column[i], rowIn[i], drizzle->getField(i), rowFe1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fFeFilters && fFeInstance->evaluate(rowFe1, fFeFilters.get()) == false)
|
if (fFeFilters && fFeInstance->evaluate(rowFe1, fFeFilters.get()) == false)
|
||||||
@@ -597,7 +605,7 @@ void CrossEngineStep::execute()
|
|||||||
for(int i = 0; i < num_fields; i++)
|
for(int i = 0; i < num_fields; i++)
|
||||||
{
|
{
|
||||||
if (fFe1Column[i] == -1)
|
if (fFe1Column[i] == -1)
|
||||||
setField(i, rowIn[i], rowFe3);
|
setField(i, rowIn[i], drizzle->getField(i), rowFe3);
|
||||||
}
|
}
|
||||||
|
|
||||||
fFeInstance->evaluate(rowFe3, fFeSelects);
|
fFeInstance->evaluate(rowFe3, fFeSelects);
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public:
|
|||||||
int getRowCount() { return drizzle_result_row_count(fDrzrp); }
|
int getRowCount() { return drizzle_result_row_count(fDrzrp); }
|
||||||
char** nextRow() { return drizzle_row_next(fDrzrp); }
|
char** nextRow() { return drizzle_row_next(fDrzrp); }
|
||||||
const string& getError() { return fErrStr; }
|
const string& getError() { return fErrStr; }
|
||||||
|
drizzle_column_st* getField(int field) { return drizzle_column_index(fDrzrp, field); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
drizzle_st* fDrzp;
|
drizzle_st* fDrzp;
|
||||||
@@ -149,7 +150,7 @@ protected:
|
|||||||
virtual void makeMappings();
|
virtual void makeMappings();
|
||||||
virtual void addFilterStr(const std::vector<const execplan::Filter*>&, const std::string&);
|
virtual void addFilterStr(const std::vector<const execplan::Filter*>&, const std::string&);
|
||||||
virtual std::string makeQuery();
|
virtual std::string makeQuery();
|
||||||
virtual void setField(int, const char*, rowgroup::Row&);
|
virtual void setField(int, const char*, drizzle_column_st*, rowgroup::Row&);
|
||||||
inline void addRow(rowgroup::RGData &);
|
inline void addRow(rowgroup::RGData &);
|
||||||
//inline void addRow(boost::shared_array<uint8_t>&);
|
//inline void addRow(boost::shared_array<uint8_t>&);
|
||||||
virtual int64_t convertValueNum(
|
virtual int64_t convertValueNum(
|
||||||
|
|||||||
Reference in New Issue
Block a user