title: Bug - How can SELECT GROUP_CONCAT return more than 1 row in subquery?
body: <p>I have a question and I can't seem to have found an answer yet ( tough I have solved the real problem ).</p>
  
  <p>I have a rather big query that worked fine for .. 3-4 months, then after some changes were made by adding items and working within the application a subquery with group_concat returned more than 1 row and I touth the point of group_concat is to concat all items in 1 line ?!</p>
  
  <p>The simplified query is like this :</p>
  
  <pre><code>(SELECT * FROM (SELECT id,
               (other_selects),
      (SELECT GROUP_CONCAT(' ',IF(user_nume IS NOT NULL, (
                      SELECT CONCAT(user_nume,' ',user_prenume)
                      FROM table
                      WHERE u2.user_id = cal_id_user
                      AND i1.cai_id = cal_id_imobil
                      ), (
                          SELECT user_company
                          FROM table
                          WHERE u2.user_id = cal_id_user
                          AND i1.cai_id = cal_id_imobil
                          ) ))
      FROM table2 u2) as locatari,
      ( other selects )   
      .........................
      FROM table3 i1
      ...... JOINS ............
  GROUP BY cai_id
  ORDER BY cai_id DESC)t" ;)
  </code></pre>
  
  <p>This subqery is returning to me more than 1 rows and I don't understand how.</p>
  
  <p>I have to mention I removed table name and there is no problem on JOINS or other sintax errors.</p>
  
  <p>The solution for this problem was to add a </p>
  
  <pre><code>GROUP BY cal_id_user
  </code></pre>
  
  <p>in both SELECTS inside the IF condition.</p>
  
  <p>Can someone please explain to me how this problem is possible ? I have found no exact answers for this kind of problem unfortunately.</p>
  
  <p>Thank you for your time.</p>