Resolved in release 1.12.0 (2017-03-24).
Julian Hyde, I reviewed the code and checked the test case, thinking that we were hitting the code. Also I run the testsuite. But I did not run test case w/o changes before pushing it. Sorry about that.
Ashutosh Chauhan, Jesus Camacho Rodriguez, The test case does not exercise the new code. It does not even call the gatherConstraints method.
Thanks for reviewing, Jesus Camacho Rodriguez. I force-pushed a minor change to the commit message, because we don't append names of contributors who are committers (whether or not they commit their own patch). (Yeah, I know, pedantic.)
New commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/010f7abb
The same issue may exist for scale. I'll try to extend Ashutosh Chauhan's test case and see whether there's a problem.
Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/bb80d98. Thanks Ashutosh Chauhan!
Fixed test failures.
Need a test case, and it causes 6 failures.