cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 623 forks source link

ZoneMap bug when using cached compiled query #1362

Open Zeninma opened 6 years ago

Zeninma commented 6 years ago

When a cached compiled query is reused for the second time, ZoneMapManager::ShouldScanTileGroup always returns false and causes error Conditional jump or move depends on uninitialised value(s) in valgrind . This is because the argument parsed_predicates is only populated when the query is compiled for the first time but needed at runtime whenever the compiled query is executed. However, when the compiled query is executed for the first time, RuntimeFunctions::FillPredicateArray clears the its plan's parsed_predicate_. Therefore, the parsed_predicates argument for ZoneMapManager::ShouldScanTileGroup is always incorrect when the compiled query is reused. We solved this problem in our PR(#1339) by avoid using predicate_array and calling RuntimeFunctions:: FillPredicateArray.