db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satheesh Bandaram (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-13) Quoted names with embedded period mishandled in from list
Date Thu, 02 Dec 2004 02:20:21 GMT
     [ http://nagoya.apache.org/jira/browse/DERBY-13?page=comments#action_56078 ]
Satheesh Bandaram commented on DERBY-13:

I believe the proposed patch is incorrect. The patch would incorrectly accept statements like

select * from t1 a, t2 a where a.i = 5

The current checking for duplicate exposed names is correct. I think the problem here is caused
because Derby currently stores both S1.T1 and "S1.T1" tables as having the same exposed name,
S1.T1. At the compile time, we are not able tell if it was originally S1.T1 or "S1.T1"

One solution might be to store "delimited identifiers" along with their quotes... In this
case, one table would have the exposed name S1.T1 and the other "S1.T1". But this might have
impact on some other parts of the code.

Note that following queries are currently accepted, when both should fail:
ij> select s1.t1.* from "S1.T1";
ID         |D1

0 rows selected
ij>  select "S1.T1".* from s1.t1;
ID         |D2

0 rows selected

> Quoted names with embedded period mishandled in from list
> ---------------------------------------------------------
>          Key: DERBY-13
>          URL: http://nagoya.apache.org/jira/browse/DERBY-13
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions:
>     Reporter: Ramandeep Kaur
>     Priority: Minor
>  Attachments: Derby-13.patch
> 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:
If you want more information on JIRA, or have a bug to report see:

View raw message