Anonymous | Login | Signup for a new account | 2023-05-30 20:15 CDT | ![]() |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Viewing Issue Simple Details [ Jump to Notes ] [ Wiki ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||
ID | Category | Type | Reproducibility | Date Submitted | Last Update | ||
0000938 | [In-Portal CMS] Database | bug report | always | 2010-11-30 12:10 | 2011-03-30 09:53 | ||
Reporter | BaSSiST | View Status | public | Project Name | In-Portal CMS | ||
Assigned To | alex | Developer | |||||
Priority | normal | Resolution | fixed | Fixed in Version | 5.1.2-B1 | ||
Status | closed | Product Version | 5.1.1 | Target Version | 5.1.2 | ||
Time Estimate | No estimate | ||||||
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. |
||||||
Additional Information | Patch also, checks for ANY number of whitespaces between SELECT and DISTINCT, instead of one space. | ||||||
Tags | No tags attached. | ||||||
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 | ||||||
Attached Files |
![]() |
||||||
|
![]() |
|
![]() |
|
![]() alex (manager) 2011-01-05 06:05 |
ok |
![]() alex (manager) 2011-01-05 06:05 |
Fix committed to 5.1.x branch. Commit Message: Fixes 0000938: Generation of COUNT SQL Fails with DISTINCT in sub-query Commit on behalf of Sergey |
![]() Dmitry (manager) 2011-03-30 09:53 |
Closing, since 5.1.2 release has been released. |
![]() |
|||
In-Portal CMS: 5.1.x r14119 Timestamp: 2011-01-05 06:05:38 Author: alex [ Details ] [ Diff ] |
Fixes 0000938: Generation of COUNT SQL Fails with DISTINCT in sub-query Commit on behalf of Sergey |
||
mod - /in-portal/branches/5.1.x/core/kernel/db/dblist.php | [ Diff ] [ File ] | ||
![]() |
|||
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 |
Main | My View | View Issues | Change Log | Roadmap | Docs | Wiki | Repositories |
Web Development by Intechnic![]() In-Portal Open Source CMS |