an appropriate group_by_expression is required for MySQL-5.0.
git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25755 20353a03-c40f-0410-a6d1-a30d3c3de9de
Showing
-
Owner
Doesn't this completely defeats the point of
count(DISTOINCT catalog.reference)
?If we are already groupped by reference, then what is the expected outcome of this
DISTINCT
? All values are 1 ?Do you remember the purpose of this test ? (where would such feature be used ?)
-
Owner
The test itself was added in ab0f9b4e so removing DISTINCT will make this test completely meaningless.
Having GROUP BY or not here has different meaning as below, but I don't remember which was my intention to test here...
(With GROUP BY, having DISTINCT or not in COUNT has no difference, this is true as you wrote).
MariaDB [erp5_test_0]> select distinct reference from catalog; +----------------------+ | reference | +----------------------+ | NULL | | BarcodeUtils | | BaseMigration | | GeographicalArea | | GeographicalPoint | | Login | | PersonLoginMigration | +----------------------+ 7 rows in set (0.00 sec) MariaDB [erp5_test_0]> select count(distinct reference) from catalog ; +---------------------------+ | count(distinct reference) | +---------------------------+ | 6 | +---------------------------+ 1 row in set (0.00 sec) MariaDB [erp5_test_0]> select count(distinct(reference)) from catalog group by reference; +----------------------------+ | count(distinct(reference)) | +----------------------------+ | 0 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | +----------------------------+ 7 rows in set (0.01 sec) MariaDB [erp5_test_0]> select count(reference) from catalog group by reference; +------------------+ | count(reference) | +------------------+ | 0 | | 1 | | 1 | | 1 | | 1 | | 1 | | 1 | +------------------+ 7 rows in set (0.00 sec)
Please register or sign in to comment