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

Enrico Olivelli commented on CALCITE-2395:
------------------------------------------

[~julianhyde] regarding SqlUpdatabilityClause class....I have created such 
class because the standard talks about this syntax
{code:java}
SELECT .... FOR READ_ONLY{code}
so I image in the future we will have some "kind" of SqlUpdatabilityClause, 
like FOR_UPDATE and FOR_READ_ONLY

I can add support for "READ_ONLY"  in this work, although it is not strictly 
needed and I don't think it is really useful.

So I can use a simple SqlNodeList, with these conventions:
 * null -> no clause at all
 * empty -> select .. for update  (without table list)
 * non empty -> select ... for update of table,table,table

I have used "updatability clause" term because SQL uses that name, but if we 
don't want to include "FOR READ_ONLY" it makes sense to call this "lock clause"

 

Okay for the other comments.

I will move forward, please give me another "ACK" and I will drop 
SqlUpdatabilityClause, just to confirm that we are not interested in "FOR 
READ_ONLY"

 

Cheers

 

> Support SELECT xxx FROM TABLE FOR UPDATE syntax
> -----------------------------------------------
>
>                 Key: CALCITE-2395
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2395
>             Project: Calcite
>          Issue Type: New Feature
>          Components: core
>    Affects Versions: 1.16.0
>            Reporter: Enrico Olivelli
>            Assignee: Julian Hyde
>            Priority: Major
>
> I am using Calcite SQL Parser and Volcano Planner.
> I need to support SQL syntax
> SELECT ... FROM table FOR UPDATE
>  
> see for instance PostGre docs
> [https://www.postgresql.org/docs/9.5/static/sql-select.html.]
>  
> I would like at least to support this syntax at SQL Parser level, the 'for 
> update' spec should be reported by the RelNode so that the system can take it 
> into account and perform explicit locking.
>  
> Linked downstream project issue:
> https://github.com/diennea/herddb/issues/228
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to