title: mysql union wrong columns in result
body: <p>I am getting wrong column names when using union.</p>
  
  <p>Here is what i do, i have two very big tables with same structure and different records, so here it is.</p>
  
  <pre><code>mysql&gt; select * from e18 where `15` like '%car%' limit 1;
  +------+------+----+------+------+------+------+------+------+------+------+------+------+------+------+-------------+------+------+------+------+------+------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+-----------+
  | id   | 1    | 2  | 3    | 4    | 5    | 6    | 7    | 8    | 9    | 10   | 11   | 12   | 13   | 14   | 15          | 16   | 17   | 18   | 19   | 20   | 21   | 22     | 23   | 24   | 25   | 26   | 27   | 28   | 29   | 30   | 31   | 32   | 33   | 34   | 35   | 36   | 37   | 38        |
  +------+------+----+------+------+------+------+------+------+------+------+------+------+------+------+-------------+------+------+------+------+------+------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+-----------+
  | 2730 | 2730 | 18 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | cars: stuff | NULL | NULL | NULL | NULL | NULL | NULL |  5  1  | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | yy        |
  +------+------+----+------+------+------+------+------+------+------+------+------+------+------+------+-------------+------+------+------+------+------+------+------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+-----------+
  1 row in set
  
  mysql&gt; (select * from e8 where `15` like '%car%') union
  (select * from e10 where `15` like '%car%') union
  (select * from e18 where `15` like '%car%') limit 1;");
  +------+------+----+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------+------+------+------+------+------+------+------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+-----------+
  | id   | 1    | 2  | 3    | 4    | 5    | 6    | 7    | 8    | 9    | 10   | 11   | 12   | 13   | 14   | 16   | 17          | 18   | 19   | 20   | 21   | 22   | 23   | 24   | 25     | 26   | 27   | 28   | 29   | 30   | 31   | 32   | 33   | 34   | 35   | 36   | 37   | 38   | 15        |
  +------+------+----+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------+------+------+------+------+------+------+------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+-----------+
  | 2730 | 2730 | 18 | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | cars: stuff | NULL | NULL | NULL | NULL | NULL | NULL | NULL |  5  1  | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | yy        |
  +------+------+----+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------+------+------+------+------+------+------+------+--------+------+------+------+------+------+------+------+------+------+------+------+------+------+-----------+
  1 row in set
  </code></pre>
  
  <p>Union all and union return same result in this case.</p>
  
  <p>There is only one row with word part "car" in it and it is in table e18.</p>
  
  <p><strong>For some reason, column names in result that i get from using usion are messed up, looks like i am missing something, any ideas what it is ?</strong></p>
  
  <p>Thanks in advance.</p>