title: Illegal mix of collations for operation 'concat' while using union all
body: <p>First of all,English is not my mother language,if I made some mistakes,please forgive me.
  This problem occurs when I try to push my data from mysql5.7 to Redis,it is about MySQL operation <strong>concat</strong>.</p>
  
  <p>Without the <strong>UNION ALL</strong>,and I split it into 2 SQLs,it works.But once I run it with <strong>UNION ALL</strong>', the error occurs.</p>
  
  <p><strong>[Err] 1271 - Illegal mix of collations for operation concat</strong></p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT CONCAT( 
      "*4\r\n",
      '$',LENGTH(redis_cmd),'\r\n',redis_cmd,'\r\n',
      '$',LENGTH(redis_key),'\r\n',redis_key,'\r\n',
      '$',LENGTH(redis_score),'\r\n',redis_score,'\r\n',
      '$',LENGTH(redis_val),'\r\n',redis_val,'\r'
  ) 
  FROM (
  SELECT
      'ZADD' AS redis_cmd,
      'GS_TM' AS redis_key,
      s1.QSH AS redis_score,
      CONCAT(s1.GS,':',s1.QSH,':0') AS redis_val
  FROM
      gstmfw s1
  UNION ALL
  SELECT
      'ZADD' AS redis_cmd,
      'GS_TM' AS redis_key,
      s2.ZZH AS redis_score,
      CONCAT(s2.GS,':',s2.ZZH,':1') AS redis_val
  FROM
      gstmfw s2
  ) AS gstmfw;
  </code></pre>
  
  <p>I want to do the whole job in one sql,but not a solution.
  In the end,thanks for reading and helping me.</p>