calcite
calcite copied to clipboard
[CALCITE-5260] Pop the last RelNode added into the bindings list when failing to apply a rule
When fail to match a subtree, HepPlanner should pop the last RelNode added into the bindings list, where the nodes left are 'real' matched when applying a rule.
Otherwise, using some temporary and unnecessary nodes to construct a HepRuleCall will cause an assertion error.
@wangyeweikuer Thanks for your contribution, could you add some tests which will fail without your fix? This will make us easier to understand the PR.