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

Julian Hyde commented on CALCITE-705:
-------------------------------------

You are correct. DML statements return an updateCount and no result set. SELECT 
returns updateCount = -1 and a result set.

Run the test RemoteDriverTest.testCreateInsertUpdateDrop and you will see that 
this works. in particular, "statement.execute(insert)" returns false. Put a 
breakpoint in the constructor of Service.ResultSetResponse and you will see how 
the updateCount and firstFrame fields are set differently for DML, DDL and 
queries.

This proves that RemoteMeta does the right thing. Now we need to make 
CalciteMeta correct also.

At a low level, it is fine that a Calcite DML statement returns a "result set" 
containing a count in a ROWCOUNT column. But somewhere at a higher point in the 
stack needs to present that as an updateCount and not a result set. It should 
notice that we are running a DML statement. Can you figure out where to put 
that code?

Your implementation must call Meta.PrepareCallback.assign with updateCount = 1, 
firstFrame = null.

> AvaticaStatement execute method to support DML
> ----------------------------------------------
>
>                 Key: CALCITE-705
>                 URL: https://issues.apache.org/jira/browse/CALCITE-705
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: YeongWei
>            Assignee: Julian Hyde
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to