[teiid-issues] [JBoss JIRA] (TEIID-5739) Procedure does not get executed (without error) when comment and variable declaration are present

Steven Hawkins (Jira) issues at jboss.org
Wed May 8 10:24:00 EDT 2019


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

Steven Hawkins commented on TEIID-5739:
---------------------------------------

This is due to parser logic that is preserving hints that appear before the procedure body definition.  In the case of a line comment it is not preserving the newline, so it's effectively saving the definition as:

-- begin
    declare string v;
    execute immediate 'DELETE from dwh.testRemove' without return ;
end

On the next parsing it will just capture the first statement as the procedure as the block is effectively commented out.


> Procedure does not get executed (without error) when comment and variable declaration are present
> -------------------------------------------------------------------------------------------------
>
>                 Key: TEIID-5739
>                 URL: https://issues.jboss.org/browse/TEIID-5739
>             Project: Teiid
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: 12.0
>            Reporter: Dmitrii Pogorelov
>            Assignee: Steven Hawkins
>            Priority: Blocker
>
> Using the below definition, it should delete the data from the table. It will do it if you either remove the comment or the variable declaration. Interestingly, it looks like the proc is executed, but the data is still present in the test table:
> {code:sql}
> create virtual procedure deleteTableTest (
> ) AS 
> -- 
> begin
>     declare string v;
>     execute immediate 'DELETE from dwh.testRemove' without return ;
> end
> {code}



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the teiid-issues mailing list