[teiid-issues] [JBoss JIRA] (TEIID-2993) Adding source table with quoted name results in wrong generated SQL statement

Steven Hawkins (JIRA) issues at jboss.org
Fri Jun 6 15:00:16 EDT 2014


    [ https://issues.jboss.org/browse/TEIID-2993?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12974302#comment-12974302 ] 

Steven Hawkins commented on TEIID-2993:
---------------------------------------

> 1) Should Table names be allowed in Designer that include the '.' delimiter (i.e. no d-quotes needed) and remove the validation? >>> (thinking YES??)

Should table names that include '.' be allowed - yes.
And remove the validation - I'm not sure what you mean about this part.

> 2) If not, then should the JDBC importer remove the "Full Qualified Names" option or create the FQN with '_' instead of '.' delimiter? >>> (thinking NO??)

You can of course independently add an import option to "create simple name" that would rewrite any name as a valid unquoted ansi sql identifier, but that is not required here.

>  is then VALID as long as the NIS is correct

Yes and that is why import always sets the name in source to an appropriately quoted (since the reserved words and the quoting scheme can very by source) value.

> Adding source table with quoted name results in wrong generated SQL statement
> -----------------------------------------------------------------------------
>
>                 Key: TEIID-2993
>                 URL: https://issues.jboss.org/browse/TEIID-2993
>             Project: Teiid
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: 6.0.0
>            Reporter: Paul Richardson
>            Assignee: Steven Hawkins
>
> Cloned from TEIIDDES-2152:
> 1) Created source model with simple table named "My.Quoted.Table" (including quotes
> 2) Created simple virtual table and pasted:  SELECT	* FROM "My.Quoted.Table"
> 3) Parser returned a command resulting in the SQL: SELECT * FROM My.Quoted."Table"
> Parser should be able to handle quoted names properly. In this case the SQL should have been valid as is.
> Confirmed that this does go right back to the Teiid parser. To confirm, the following test was included in
> src/test/java/org/teiid/query/parser/TestParser.java
> {code}
> @Test
> public void testQuotedSQLString() {
>     String sql = "SELECT * FROM \"My.Quoted.Table\""; //$NON-NLS-1$
>     String expected = "SELECT * FROM \"MY.QUOTED.TABLE\""; //$NON-NLS-1$
>     helpTest(sql, expected, null);
> }
> {code}
> Test fails with a comparison error with the parser returning the SQL in item 3 above.



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the teiid-issues mailing list