Derby
  1. Derby
  2. DERBY-5005

Error when fully qualifying a field from a view in an ORDER BY clause

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1
    • Fix Version/s: 10.5.3.2, 10.6.2.4, 10.7.1.4, 10.8.1.2
    • Component/s: SQL
    • Labels:
    • Environment:
      Windows 7
    • Urgency:
      Normal
    • Issue & fix info:
      Repro attached, Workaround attached
    • Bug behavior facts:
      Deviation from standard

      Description

      I have a strange issue that can be reproduced easily with the following objects in schema "test":

      create table a (a integer);
      insert into a (a) values(1);
      create view v as select * from a;

      This works:
      select test.a.a from test.a where test.a.a <> 2 order by test.a.a asc;

      This doesn't work:
      select test.v.a from test.v where test.v.a <> 2 order by test.v.a asc;

      But this does:
      select test.v.a from test.v where test.v.a <> 2 order by v.a asc;

      This is the error I get:
      Error: 'TEST.V' is not an exposed table name in the scope in which it appears.
      SQLState: 42X10
      ErrorCode: -1

      I've tried quite a few SELECT clauses, and I think the ORDER BY clause is the only one having this issue.

      1. derby-5005b.stat
        0.5 kB
        Dag H. Wanvik
      2. derby-5005b.diff
        7 kB
        Dag H. Wanvik
      3. derby-5005.stat
        0.5 kB
        Dag H. Wanvik
      4. derby-5005.diff
        8 kB
        Dag H. Wanvik
      5. derby-5005_10_5_diff.txt
        2 kB
        Kathey Marsden
      6. 5005.sql
        0.4 kB
        Rick Hillegas

        Activity

        Gavin made changes -
        Workflow jira [ 12544650 ] Default workflow, editable Closed status [ 12801013 ]
        Lukas Eder made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Rick Hillegas made changes -
        Fix Version/s 10.8.1.2 [ 12316362 ]
        Fix Version/s 10.8.1.1 [ 12316356 ]
        Rick Hillegas made changes -
        Fix Version/s 10.8.1.1 [ 12316356 ]
        Fix Version/s 10.8.1.0 [ 12315561 ]
        Kathey Marsden made changes -
        Fix Version/s 10.5.3.2 [ 12315436 ]
        Fix Version/s 10.6.2.3 [ 12315434 ]
        Fix Version/s 10.7.1.3 [ 12315902 ]
        Kathey Marsden made changes -
        Attachment derby-5005_10_5_diff.txt [ 12474047 ]
        Dag H. Wanvik made changes -
        Affects Version/s 10.1.3.1 [ 12311953 ]
        Affects Version/s 10.1.2.1 [ 12310615 ]
        Affects Version/s 10.1.1.0 [ 10993 ]
        Affects Version/s 10.0.2.1 [ 10991 ]
        Affects Version/s 10.0.2.0 [ 10920 ]
        Dag H. Wanvik made changes -
        Affects Version/s 10.6.2.1 [ 12315343 ]
        Affects Version/s 10.6.1.0 [ 12313727 ]
        Affects Version/s 10.5.3.0 [ 12314117 ]
        Affects Version/s 10.5.2.0 [ 12314116 ]
        Affects Version/s 10.5.1.1 [ 12313771 ]
        Affects Version/s 10.4.2.0 [ 12313345 ]
        Affects Version/s 10.4.1.3 [ 12313111 ]
        Affects Version/s 10.3.3.0 [ 12313142 ]
        Affects Version/s 10.3.2.1 [ 12312876 ]
        Affects Version/s 10.3.1.4 [ 12312590 ]
        Affects Version/s 10.2.2.0 [ 12312027 ]
        Affects Version/s 10.2.1.6 [ 11187 ]
        Dag H. Wanvik made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Issue & fix info [Workaround attached, Repro attached, Patch Available] [Repro attached, Workaround attached]
        Fix Version/s 10.8.0.0 [ 12315561 ]
        Resolution Fixed [ 1 ]
        Dag H. Wanvik made changes -
        Attachment derby-5005b.diff [ 12470820 ]
        Attachment derby-5005b.stat [ 12470821 ]
        Dag H. Wanvik made changes -
        Issue & fix info [Workaround attached, Repro attached] [Patch Available, Repro attached, Workaround attached]
        Dag H. Wanvik made changes -
        Assignee Dag H. Wanvik [ dagw ]
        Dag H. Wanvik made changes -
        Attachment derby-5005.diff [ 12470642 ]
        Attachment derby-5005.stat [ 12470643 ]
        Rick Hillegas made changes -
        Issue & fix info [Repro attached, Workaround attached]
        Rick Hillegas made changes -
        Attachment 5005.sql [ 12470452 ]
        Lukas Eder made changes -
        Field Original Value New Value
        Description I have a strange issue that can be reproduced easily with the following objects in schema "test":

        create table a (a integer);
        insert into a (a) values(1);
        create view v as select * from a;

        This works:
        select test.a.a from test.a where test.a.a <> 2 order by test.a.a asc;

        This doesn't work:
        select test.v.a from test.v where test.v.a <> 2 order by test.v.a asc;

        But this does:
        select test.v.a from test.v where test.v.a <> 2 order by v.a asc;

        This is the error I get:
        Error: 'TEST.V' is not an exposed table name in the scope in which it appears.
        SQLState: 42X10
        ErrorCode: -1

        I've tried quite a few SELECT caluses, and I think the ORDER BY clause is the only one having this issue.
        I have a strange issue that can be reproduced easily with the following objects in schema "test":

        create table a (a integer);
        insert into a (a) values(1);
        create view v as select * from a;

        This works:
        select test.a.a from test.a where test.a.a <> 2 order by test.a.a asc;

        This doesn't work:
        select test.v.a from test.v where test.v.a <> 2 order by test.v.a asc;

        But this does:
        select test.v.a from test.v where test.v.a <> 2 order by v.a asc;

        This is the error I get:
        Error: 'TEST.V' is not an exposed table name in the scope in which it appears.
        SQLState: 42X10
        ErrorCode: -1

        I've tried quite a few SELECT clauses, and I think the ORDER BY clause is the only one having this issue.
        Lukas Eder created issue -

          People

          • Assignee:
            Dag H. Wanvik
            Reporter:
            Lukas Eder
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development