|
Consider this query that must fail b/c i2 is in projection.
MariaDB [test]> select * from ( select count(1), i, i2 from cs1 group by i order by i2 ) a;
|
+----------+------+------+
|
| count(1) | i | i2 |
|
+----------+------+------+
|
| 1 | 1 | 36 |
|
| 1 | 100 | 5 |
|
| 1 | 26 | 1 |
|
| 1 | 25 | 103 |
|
| 1 | 1 | 41 |
|
| 1 | 2 | 42 |
|
+----------+------+------+
|
6 rows in set (0.028 sec)
|
Despite the fact that MDB allows to sort over non-aggregated column CS doesn't support this functionality so here is the expected behavior.
MariaDB [test]> select * from ( select count(1), i, i2 from cs1 group by i order by i2 )a ;
|
ERROR 1815 (HY000): Internal error: IDB-2021: 'i2' is not in GROUP BY clause. All non-aggregate columns in the SELECT and ORDER BY clause must be included in the GROUP BY clause.
|
|