[ http://issues.apache.org/jira/browse/DERBY-13?page=comments#action_57179 
]
     
Shreyas Kaushik commented on DERBY-13:
--------------------------------------

I am proposing a fix for this issue. I am attaching the diffs of all the files 
that need to have changes.

As per the discussions we have had on this issue the problem was with comparing 
exposed names. I have changed the comparision of all exposed names to the 
TableName objects. 

As Sateesh had suggested in one of his earlier mails on this issue,  

public ResultColumnList getResultColumnsForList(String 
allTableName,ResultColumnList inputRcl,Name tableName)

 method in the FromTable.java the "allTableName" needs to be a TableName object 
instead of a String object. I have made those changes as well for the 
comparision to happen between TableName objects.

  For the above change to happen we need to get a handle to the TableName 
object that is stored in the 
java/engine/org/apache/derby/impl/sql/compile/AllResultColumn. As of now it 
does not have a method to actually get a handle to the TableName object stored 
in this. So I added a new method that returns a handle to the TableName object 
stored internally.

I also ran the tests of derbylang and am attaching the diffs of them as well. 
Some of the tests fail there and I don't know the exact reason for the 
failures.( I think they are not failures )

> Quoted names with embedded period mishandled in from list
> ---------------------------------------------------------
>
>          Key: DERBY-13
>          URL: http://issues.apache.org/jira/browse/DERBY-13
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Ramandeep Kaur
>     Priority: Minor
>  Attachments: Derby-13.diff, Derby-13.patch, derbylang_report.txt
>
> Opening this bug on behalf of Satheesh Bandaram
> ---------------------------------------------------------
> The compiler mishandles quoted names with embedded periods when 
> checking uniqueness of table names in the from list of a 
> SELECT. Consider the following SQL:
>   create table "S1.T1" (id int not null primary key, d1 int);
>   create schema s1;
>   create table s1.t1 (id int not null primary key, d2 int);
>   select * from s1.t1, "S1.T1" where s1.t1.id = "S1.T1".id;
> Derby throws an error on the final SELECT statement:
> "ERROR 42X09: The table or alias name 'S1.T1' is used more than 
> once in the FROM list". However s1.t1 and "S1.T1" are different 
> tables.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to