Closed zhenglin-charlie-li closed 1 year ago
In the function AggregationAlgorithm::Aggregate
in aggregation_algorithm.cpp, it doesn't check validity of mit
before PutAggregatedValue
.
void AggregationAlgorithm::Aggregate(bool just_distinct, int64_t &limit, int64_t &offset, ResultSender *sender) {
MEASURE_FET("TempTable::Aggregate(...)");
thd_proc_info(m_conn->Thd(), "aggregation");
......
{
for (int gr_a = gbw.NumOfGroupingAttrs(); gr_a < gbw.NumOfAttrs(); gr_a++) {
TempTable::Attr &cur_a = *(t->GetAttrP(gr_a));
if (cur_a.term.vc && dynamic_cast<Tianmu::vcolumn::ExpressionColumn *>(cur_a.term.vc)) {
bool value_successfully_aggregated = gbw.PutAggregatedValue(gr_a, 0, mit, mit.Factor());
if (!value_successfully_aggregated) {
gbw.DistinctlyOmitted(gr_a, 0);
}
}
}
}
}
......
}
Have you read the Contributing Guidelines on issues?
Please confirm if bug report does NOT exists already ?
Describe the problem
SQLancer found that the query below result is not correct on docker v1.0.4, though correct result on docker v1.0.3
Expected behavior
both two select return
NULL
How To Reproduce
Environment
docker v1.0.4
Are you interested in submitting a PR to solve the problem?