[ 
https://issues.apache.org/jira/browse/CALCITE-6933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939942#comment-17939942
 ] 

Mihai Budiu commented on CALCITE-6933:
--------------------------------------

I don't know if this is related to JDBC. I am not using JDBC in my setup.

At least in Oracle quoted identifiers are always case sensitive:
https://docs.oracle.com/cd/A97385_01/server.920/a96540/sql_elements9a.htm

Calcite seems to be different, if I understand right: both quoted and unquoted 
identifiers are converted to a canonical form, based on the settings 
UNQUOTED_CASING and QUOTED_CASING, and name lookup case sensitivity is always 
controlled by the CASE_SENSITIVE setting.

So it does not seem to be possible to do use a different case sensitivity 
depending on the quoting.

Moreover, the code that does name lookup uses String and not SqlIdentifier, and 
the strings to not preserve quoting information. So it does not look easy to 
fix this behavior.

> Lookup of quoted identifier produces an incorrect result
> --------------------------------------------------------
>
>                 Key: CALCITE-6933
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6933
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.39.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>
> Consider the following example:
> {code:sql}
> CREATE TABLE "T" (COL1 INT NOT NULL);
> CREATE TABLE "t" (COL1 INT NOT NULL, COL2 DOUBLE NOT NULL);
> CREATE VIEW V AS SELECT COL1, rlike(COL2, 'asf') FROM "t";
> {code}
> There are two tables with the same name, but different casing. I believe that 
> the lookup in the schema should use case-sensitive lookup when the looked-up 
> identifier is quoted. (This example used to work, but fails after we have 
> merged the fix to https://issues.apache.org/jira/browse/CALCITE-6728).
> I am assuming this is a bug, but perhaps my understanding is wrong.
> Today the IdentifierNamespace.resolveImpl uses a nameMatcher whose case 
> sensitivity is fixed by the configuration, but I think it should take into 
> consideration the quoting as well.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to