In-Portal Issue Tracker - In-Portal CMS
|
Viewing Issue Advanced Details |
|
ID:
|
Category:
|
Type:
|
Reproducibility:
|
Date Submitted:
|
Last Update:
|
938 |
[In-Portal CMS] Database |
bug report |
always |
2010-11-30 12:10 |
2011-03-30 09:53 |
|
Reporter:
|
BaSSiST |
Platform:
|
|
|
Assigned To:
|
alex |
OS:
|
|
|
Priority:
|
normal |
OS Version:
|
|
|
Status:
|
closed |
Product Version:
|
5.1.1 |
|
Product Build:
|
|
Resolution:
|
fixed |
|
|
ETA:
|
none |
Fixed in Version:
|
5.1.2-B1 |
|
Reference:
|
http://groups.google.com/group/in-portal-bugs/browse_thread/thread/4635504373ca3d86 |
Change Log Message:
|
Fixes Count SQLs with DISTINCT in sub-query |
Estimate Points:
|
0 |
|
Summary:
|
0000938: Generation of COUNT SQL Fails with DISTINCT in sub-query |
Description:
|
There is a bug in kDBList::getCountSQL method, which generates SQL for counting list totals.
It checks if there's DISTINCT in SQL and, if it's there, tries to replace it for COUNT(DISTINCT...) construction instead of simple COUNT(*).
Problem is that it checks for distinct in ANY place of query, but replaces it in beginning, so, if there's DISTINCT in subquery, it won't replace anything. So, count SQL will be equal to list SQL, and you will get first record's first field's value (according to kDBConnection::GetOne logic) as record count. |
Steps To Reproduce:
|
|
Additional Information:
|
Patch also, checks for ANY number of whitespaces between SELECT and DISTINCT, instead of one space. |
Relationships | |
Attached Files:
|
count+sql+with+distinct.patch (622) 2010-11-30 12:10 http://tracker.in-portal.org/file_download.php?file_id=862&type=bug |
|
Issue History |
Date Modified |
Username |
Field |
Change |
2011-03-30 09:53 |
Dmitry |
Note Added: 0003358 |
|
2011-03-30 09:53 |
Dmitry |
Status |
resolved => closed |
2011-01-05 06:05 |
alex |
Note Added: 0003161 |
|
2011-01-05 06:05 |
alex |
Status |
reviewed and tested => resolved |
2011-01-05 06:05 |
alex |
Fixed in Version |
=> 5.1.2-B1 |
2011-01-05 06:05 |
alex |
Resolution |
open => fixed |
2011-01-05 06:05 |
alex |
Assigned To |
!COMMUNITY => alex |
2011-01-05 06:05 |
alex |
Changeset attached |
5.1.x r14119 |
2011-01-05 06:05 |
alex |
Note Added: 0003160 |
|
2011-01-05 06:05 |
alex |
Status |
needs testing => reviewed and tested |
2010-11-30 14:01 |
alex |
Developer |
Dmitry => BaSSiST |
2010-11-30 12:11 |
Dmitry |
Assigned To |
=> !COMMUNITY |
2010-11-30 12:11 |
Dmitry |
Developer |
BaSSiST => Dmitry |
2010-11-30 12:11 |
Dmitry |
Status |
active => needs testing |
2010-11-30 12:11 |
Dmitry |
Reporter |
Dmitry => BaSSiST |
2010-11-30 12:11 |
Dmitry |
Developer |
=> BaSSiST |
2010-11-30 12:10 |
Dmitry |
New Issue |
|
2010-11-30 12:10 |
Dmitry |
File Added: count+sql+with+distinct.patch |
|
2010-11-30 12:10 |
Dmitry |
Reference |
=> http://groups.google.com/group/in-portal-bugs/browse_thread/thread/4635504373ca3d86 |
2010-11-30 12:10 |
Dmitry |
Change Log Message |
=> Fixes Count SQLs with DISTINCT in sub-query |