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

Ulrich Kramer commented on CALCITE-6933:
----------------------------------------

Quoting lower case table names in {{JdbcAdapterTest}} let the tests fail. 
Adding double quotes around {{emp}} in the test below leads to the error 
message 

{noformat}
Error while executing SQL "select * from SCOTT."emp"
": From line 1, column 15 to line 1, column 25: Object 'emp' not found within 
'SCOTT'; did you mean 'EMP'?
{noformat}

{code:java}
  @Test void testCustomJdbc() {
    CalciteAssert.model(JdbcTest.FOODMART_SCOTT_CUSTOM_MODEL)
        .query("select * from SCOTT.emp\n")
        .enable(CalciteAssert.DB == CalciteAssert.DatabaseInstance.HSQLDB)
        .planHasSql("SELECT *\nFROM \"SCOTT\".\"EMP\"")
        .returnsCount(14);
  }
{code}


> 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