title: order by executed twice with fetch first rows only clause
body: <p>I am trying to retrieve the first row of a query like this: </p>
  
  <pre><code>    select tbl.a
        from tbl
       where tbl.code = 5
    order by util_test.getPrio(tbl.id)
       fetch first 1 rows only;
  </code></pre>
  
  <p>util_test.getPrio() returns an integer I'm using to order the outcome. 
  Because I'm only interested in the best result I'm fetching the first row only.</p>
  
  <p>The query (without 'fetch first') returns only one row, however, util_test.getPrio() contains a dbms_output and if I add 'fetch first 1 rows only' I see the same output 2 times. If I don't, I see the output only one time, like expected.</p>
  
  <p>I'm not really interested in a solution (and I know it's bad from a performance point of view),
  I'm just wondering why? </p>