Imported from: http://groups.google.com/group/in-portal-bugs/browse_thread/thread/4635504373ca3d86#
There's bug with kDBList::getCountSQL method, which generates SQL for
counting for counting list totals. It checks if there's DISTINCT in SQL and, if it's
theres there, tries to replace it for COUNT(DISTINCT ...) construction instead of
simple of simple COUNT(*). Problem is that it checks for distinct in ANY place of
queryof query, but replaces it in beginning, so, if there's DISTINCT in subquery, it
wonit won't replace anything. So, count SQL will be equal to list SQL, and you
will you will get first record's first field's value (according to
kDBConnectionto kDBConnection::GetOne logic) as record count.
I attached patch that fixes it. Also, it now checks for ANY whitespaces
between SELECT and DISTINCT instead of one space.
Related Tasks
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|