Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6378

OFFSET/FETCH NEXT ignored when query is enclosed in parentheses

    XMLWordPrintableJSON

Details

    • Repro attached
    • Wrong query result

    Description

      ij version 10.10
      ij> connect 'jdbc:derby:memory:db;create=true';
      ij> create table t(x int);
      0 rows inserted/updated/deleted
      ij> insert into t values 1,2,3;
      3 rows inserted/updated/deleted
      ij> select * from t offset 1 row fetch first 1 row only;
      X
      -----------
      2

      1 row selected
      ij> (select * from t offset 1 row fetch first 1 row only);
      X
      -----------
      1
      2
      3

      3 rows selected

      I would have expected that both of the queries had returned a single row.

      Attachments

        1. derby-6378-4.status
          1 kB
          Dag H. Wanvik
        2. derby-6378-4.diff
          82 kB
          Dag H. Wanvik
        3. derby-6378-3.status
          1 kB
          Dag H. Wanvik
        4. derby-6378-3.diff
          80 kB
          Dag H. Wanvik
        5. derby-6378-2.status
          1 kB
          Dag H. Wanvik
        6. derby-6378-2.diff
          79 kB
          Dag H. Wanvik
        7. derby-6378-1.diff
          2 kB
          Dag H. Wanvik
        8. DERBY-3678_bp1010fail.diff
          74 kB
          Myrna van Lunteren

        Activity

          People

            dagw Dag H. Wanvik
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: