title: mysql GROUP BY clause validation
body: <p>Suppose I have a table with the following content:</p>
  
  <pre><code>mysql&gt; select * from test;
  +----+------+
  | id | val  |
  +----+------+
  |  1 |    1 |
  |  2 |    1 |
  |  3 |    1 |
  |  4 |    1 |
  |  5 |    2 |
  |  6 |    2 |
  |  7 |    2 |
  |  8 |    2 |
  +----+------+
  8 rows in set (0.00 sec)
  
  mysql&gt; 
  </code></pre>
  
  <p>Now I run erroneous SQL query with <code>group by</code> clause and without any aggregation on <code>id</code> column and get wrong results:</p>
  
  <pre><code>mysql&gt; select id, val from test group by val;
  +----+------+
  | id | val  |
  +----+------+
  |  1 |    1 |
  |  5 |    2 |
  +----+------+
  2 rows in set (0.00 sec)
  
  mysql&gt; 
  </code></pre>
  
  <p>Can mysql client or probably some other tool validate this query and issue error or warning on using <code>group by</code> without aggregation?</p>