[teiid-issues] [JBoss JIRA] Commented: (TEIID-1705) Encountered NPE in SQLStringVisitor for TIMESTAMPADD and TIMESTAMPDIFF

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Thu Aug 11 10:52:02 EDT 2011


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

Steven Hawkins commented on TEIID-1705:
---------------------------------------

If the expression builder will ask for the string form of invalid expressions, there are probably several other places that would need changed as well.  

Perhaps the fix should be to the expression builder so that it knows what the valid keywords (SQL_TSI_FRAC_SECOND, etc.) are for the first argument.  If that argument is missing/incorrect the function will fail to parse anyway.

> Encountered NPE in SQLStringVisitor for TIMESTAMPADD and TIMESTAMPDIFF
> ----------------------------------------------------------------------
>
>                 Key: TEIID-1705
>                 URL: https://issues.jboss.org/browse/TEIID-1705
>             Project: Teiid
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: 7.4
>            Reporter: Mark Drilling
>            Assignee: Steven Hawkins
>         Attachments: SQLStringVisitor-Patch.txt
>
>
> I was using expression builder in Designer when I encountered this NPE. 
> java.lang.NullPointerException
> 	at org.teiid.query.sql.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:1280)
> 	at org.teiid.query.sql.symbol.Function.acceptVisitor(Function.java:182)
> 	at org.teiid.query.sql.visitor.SQLStringVisitor.getSQLString(SQLStringVisitor.java:164)
> 	at com.metamatrix.query.internal.ui.builder.util.LanguageObjectLabelProvider.getText(LanguageObjectLabelProvider.java:129)
> I think the visit method for FUNCTION in SQLStringVisitor just needs to do a null check on the first arg.  I'm attaching a code patch. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the teiid-issues mailing list