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

SQLSTATE 42X10 occurs when qualifying a column with a synonym in ORDER BY clause

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.3.1, 10.2.1.6, 10.2.2.0, 10.3.1.4
    • 10.1.3.2, 10.2.2.0, 10.3.1.4
    • SQL
    • None
    • Any
    • Patch Available

    Description

      SQLSTATE 42X10 occurs when qualifying a column with a synonym in ORDER BY clause, where the synonym was declared in a different schema:

      ij version 10.3
      ij> connect 'jdbc:derby:wombat;create=true';
      ij> create schema test1;
      0 rows inserted/updated/deleted
      ij> create schema test2;
      0 rows inserted/updated/deleted
      ij> create table test1.testtable(id bigint not null);
      0 rows inserted/updated/deleted
      ij> create synonym test2.testtable for test1.testtable;
      0 rows inserted/updated/deleted
      ij> set schema test1;
      0 rows inserted/updated/deleted
      ij> select testtable.id from testtable;
      ID
      --------------------

      0 rows selected
      ij> set schema test2;
      0 rows inserted/updated/deleted
      ij> select testtable.id from testtable;
      ID
      --------------------

      0 rows selected
      ij> select testtable.id from testtable order by testtable.id;
      ERROR 42X10: 'TESTTABLE' is not an exposed table name in the scope in which it appears.
      ij>

      Attachments

        1. derby1894-trunk-diff01.txt
          12 kB
          Yip Ng
        2. derby1894-trunk-stat01.txt
          0.3 kB
          Yip Ng
        3. derby1894-trunk-diff02.txt
          12 kB
          Yip Ng
        4. derby1894-trunk-stat02.txt
          0.3 kB
          Yip Ng

        Activity

          People

            yipng Yip Ng
            yipng Yip Ng
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: