title: MySQL 8.0.23 (RDS) hangs on simple query from Spring Boot, but returns immediately when executed in Navicat
body: <p>I have a rather simple MySQL query which I used to run against MySQL 5.6 on Amazon RDS (No Aurora) from within a Spring Boot application. I recently upgraded</p>
  <ul>
  <li>the database to MySQL 8.0.23 (still no Aurora)</li>
  <li>the Spring Boot application (2.6.x).</li>
  <li>MySQL connector to 8.0.27</li>
  </ul>
  <p>'Everything' works fine, except this one query (Dutch words, but I want the query literally):</p>
  <pre><code>select o.* from opdracht o where o.herinneringVerzonden = false and o.status = 'Bevestigd' and date(o.datum_reiniging) = date('2022-01-19 00:00:00') order by o.id asc limit 1;
  </code></pre>
  <p>I have several hundreds of different queries, but only this one 'hangs' with 0 execution time in the state 'executing'. RDS monitoring shows a 100% cpu usage at the time the query starts (and for hours). I have to kill the query manually to 'solve' this.</p>
  <p>The corresponding Spring Boot Java code:</p>
  <pre><code>        List&lt;Opdracht&gt; resultList = entityManager.createNativeQuery(&quot;select o.* from opdracht o where o.herinneringVerzonden = false &quot; +
                  &quot;and o.status = :o_state and date(o.datum_reiniging) = date(:r_date) order by o.id asc&quot;, Opdracht.class)
              .setParameter(&quot;o_state&quot;, &quot;Bevestigd&quot;)
              .setParameter(&quot;r_date&quot;, Datum.addBusinessDays(2), TemporalType.DATE)
              .setMaxResults(1)
              .getResultList();
          return resultList.isEmpty() ? null : resultList.get(0);
  </code></pre>
  <p>However, when I execute this query from my SQL client Navicat, I get an immediate response (0.028s). What's happening?</p>
  <p><strong>EDIT</strong>: I stripped the query down, excluding all criteria. Which went well. When adding back the criteria one by one, it went wrong when the date comes in.</p>