title: cannot create temporary table from select union in a read only database
body: <p>I'm trying to create a temporary table in a read only replica MYSQL 5.6.44 database:</p>
  
  <pre><code>create temporary table tmp_username
  select username from sync_event where date(last_modified) = '2020-06-15' 
  union
  select username from sync_outcome where date(last_modified) = '2020-06-15';
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>The MySQL server is running with the --read-only option so it cannot execute this statement
  </code></pre>
  
  <p>However, without the union it works ok:</p>
  
  <pre><code>create temporary table tmp_username
  select username from sync_event where date(last_modified) = '2020-06-15'
  </code></pre>
  
  <p>Is this a known limitation of MySql or am I doing something wrong? I can't find any reference to it in the documentation. Thanks.</p>