Bug #44090 ONLY_FULL_GROUP_BY sql_mode allows mixing of group columns with wild cards
Submitted: 4 Apr 2009 18:44 Modified: 24 May 2012 13:44
Reporter: Gleb Shchepa Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.0, 5.1, 6.0 bzr OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[4 Apr 2009 18:44] Gleb Shchepa
Description:
The server ignores @@sql_mode=ONLY_FULL_GROUP_BY if a query contains wild cards.

How to repeat:
Server version: 5.0.80-debug Source distribution
mysql> CREATE TABLE t1 (c1 INT, c2 INT);
mysql> SET @@sql_mode='ONLY_FULL_GROUP_BY';

# the following query should fail with an error, but it doesn't:

mysql> SELECT t1.*, SUM(c2) FROM t1;
+------+------+---------+
| c1   | c2   | SUM(c2) |
+------+------+---------+
| NULL | NULL |    NULL | 
+------+------+---------+
1 row in set (0.00 sec)

# the query without wild cards fails as expected:

mysql> SELECT c1, SUM(c2) FROM t1;
ERROR 1140 (42000): Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
[4 Apr 2009 19:23] Sveta Smirnova
Thank you for the report.

Verified as described.

Bug was introduced in version 5.1.24
[24 May 2012 13:44] Guilhem Bichot
Testcase passes in 5.6. Fixed in 5.6 or earlier.