Derby
  1. Derby
  2. DERBY-3296

Importing to table in default schema fails when another table with the same name exists in a different schema

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.4.1.3
    • Fix Version/s: 10.5.2.0, 10.6.1.0
    • Component/s: Tools
    • Labels:
      None
    • Environment:
    • Bug behavior facts:
      Regression Test Failure

      Description

      I discovered this problem while trying to get suites.All to run on the phoneME advanced platform, but it is easy to reproduce also with Java SE.

      The problem is that importing a table fails if there exists a table with the same name in a different schema. The error is:

      ERROR 42X04: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'COLUMN2' is not a column in the target table.

      If the table in the other schema is removed, the import command succeeds. If the import command is executed with an explicit schema name, instead of relying on "null" to give the default schema, the command also succeeds.

      I believe this is a bug.

      The following sequence of commands reproduces the problem:

      ij version 10.4
      ij> connect 'jdbc:derby:MyDbTest;create=true';
      ij> create table t1 (a int);
      0 rows inserted/updated/deleted
      ij> insert into t1 values 1,2,3;
      3 rows inserted/updated/deleted
      ij> call SYSCS_UTIL.SYSCS_EXPORT_TABLE(null, 'T1', 't1.txt', null, null, null);
      0 rows inserted/updated/deleted
      ij> create schema iep;
      0 rows inserted/updated/deleted
      ij> create table iep.t1 (b int);
      0 rows inserted/updated/deleted
      ij> call SYSCS_UTIL.SYSCS_IMPORT_TABLE(null, 'T1', 't1.txt', null, null, null, 0);
      ERROR 38000: The exception 'java.sql.SQLException: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'COLUMN2' is not a column in the target table.' was thrown while evaluating an expression.
      ERROR 42X04: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'COLUMN2' is not a column in the target table.

      1. d3296.diff
        2 kB
        Knut Anders Hatlen
      2. d3296-2.diff
        2 kB
        Knut Anders Hatlen

        Issue Links

          Activity

          Vemund Østgaard created issue -
          Knut Anders Hatlen made changes -
          Field Original Value New Value
          Attachment d3296.diff [ 12408908 ]
          Knut Anders Hatlen made changes -
          Assignee Knut Anders Hatlen [ knutanders ]
          Knut Anders Hatlen made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Knut Anders Hatlen made changes -
          Derby Info [Patch Available]
          Knut Anders Hatlen made changes -
          Attachment d3296-2.diff [ 12408934 ]
          Knut Anders Hatlen made changes -
          Fix Version/s 10.6.0.0 [ 12313727 ]
          Derby Info [Patch Available]
          Knut Anders Hatlen made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 10.5.1.2 [ 12313870 ]
          Resolution Fixed [ 1 ]
          Ole Solberg made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Bug behavior facts [Regression Test Failure]
          Kathey Marsden made changes -
          Fix Version/s 10.5.2.0 [ 12314116 ]
          Fix Version/s 10.5.1.2 [ 12313870 ]
          Ranjit Aneesh made changes -
          Link This issue is related to DERBY-5337 [ DERBY-5337 ]
          Gavin made changes -
          Workflow jira [ 12420083 ] Default workflow, editable Closed status [ 12796670 ]

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Vemund Østgaard
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development