title: Strange behaviour of MariaDB when using LIMIT in combination with UNION
body: <pre><code>SELECT `foo` 
  FROM `table`
  WHERE `bar` = 'def'
  LIMIT 1500;
  </code></pre>
  
  <p>... returns 1500 rows for the condition (def).</p>
  
  <pre><code>(SELECT `foo` 
  FROM `table`
  WHERE `bar` = 'abc'
  LIMIT 1000)
  UNION
  (SELECT `foo` 
  FROM `table`
  WHERE `bar` = 'def'
  LIMIT 1500)
  </code></pre>
  
  <p>... returns 2498 rows, 1498 for the second condition (def).</p>
  
  <p>So as you can see by the output of the first query, there definitely are enough records for condition "def" to return 1500 rows. Nevertheless, there are too few records returned for that condition when used in combination with UNION.</p>
  
  <p>Does anyone have a pointer for me to track down this behaviour?</p>