forcedotcom / phoenix

BSD 3-Clause "New" or "Revised" License
558 stars 227 forks source link

Count(distinct c1) returns wrong results when an index-table plan is applied. #683

Open maryannxue opened 10 years ago

maryannxue commented 10 years ago

For example, we have t1 (id, name, addr) and its index table d1 (name).

if we do "select count(distinct name) from t1" while use-index is disabled, we get the correct result. if we do the same query while index is enabled, we get a wrong result, which equals to "count(name)".

jtaylor-sfdc commented 10 years ago

Good find. Please create a standalone unit test.