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

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



    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s:,,,,,,,,,,,,,,,,,
    • Fix Version/s:,,,
    • Component/s: SQL
    • Labels:
    • Environment:
      Windows 7
    • Urgency:
    • Issue & fix info:
      Repro attached, Workaround attached
    • Bug behavior facts:
      Deviation from standard


      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
          Katherine Marsden
        6. 5005.sql
          0.4 kB
          Richard N. Hillegas



            • Assignee:
              dagw Dag H. Wanvik
              lukas.eder Lukas Eder
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: