Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-859

OraclePlatform: rownum should not be used directly in WHERE clausule

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: Platforms
    • Security Level: All
    • Labels:
      None
    • Environment:
      Oracle, All OSes.

      Description

      At 90% of cases when we use ROWNUM in WHERE clause it will work correctly, but sometimes not. I noticed that that is why Doctrine sometimes works incorrect.
      Source:
      http://www.oracle.com/technetwork/issue-archive/2006/06-sep/o56asktom-086197.html

      Quote:
      "That is why a query in the following form is almost certainly an error:

      select *
      from emp
      where ROWNUM <= 5
      order by sal desc;
      "

      I prepared modified OraclePlatform.php with solution (attachment) - rownum is being compared after all operations.

      1. OraclePlatform_bugfix.php
        24 kB
        Mariusz Jaskółka
      2. OraclePlatform.php
        23 kB
        Mariusz Jaskółka

        Activity

        Hide
        Steve Müller added a comment -

        Mariusz Jaskółka can you please provide an example where the current implementation fails? We have functional tests LIMIT queries in DBAL but they run fine on Oracle. I need more information to be able to reproduce this problem.

        Show
        Steve Müller added a comment - Mariusz Jaskółka can you please provide an example where the current implementation fails? We have functional tests LIMIT queries in DBAL but they run fine on Oracle. I need more information to be able to reproduce this problem.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Mariusz Jaskółka
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: