title: Lost connection to MySQL server during query just on MacOS
body: <p>I have an SQL query with 2 subqueries. whenever I run it on MySQL Workbench on macOS, it gives "Error Code: 2013. Lost connection to MySQL server during query". However, when it runs on Workbench on Windows, it runs normally without any errors. 
  I tried to increase the connection timeout, but still no success! 
  Any clue on how to solve this issue? 
  I appreciate your support and cooperation.</p>
  
  <p><strong>here is a query that gives an error:</strong></p>
  
  <pre><code>with t1 as(
  
  SELECT s.name rep_name, r.name region_name, sum(o.total_amt_usd) as total_amt
  
  FROM sales_reps s
  
  JOIN accounts a
  
  ON a.sales_rep_id = s.id
  
  JOIN orders o
  
  ON o.account_id = a.id
  
  JOIN region r
  
  ON r.id = s.region_id
  
  group by 1,2),
  
  t2 as(
  
  select region_name, max(total_amt) as total_amt
  
  from t1
  
  group by 1)
  
  select t1.rep_name, t1.region_name, t1.total_amt
  
  from t1
  
  join t2
  
  ON t1.region_name = t2.region_name AND t1.total_amt = t2.total_amt;
  </code></pre>