[ 
https://issues.apache.org/jira/browse/THRIFT-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12750169#action_12750169
 ] 

David Reiss commented on THRIFT-409:
------------------------------------

This seems good.  I'm pretty sure there is one more bug, but it is not a 
blocker for me if it is not a blocker for you.  As you are aware, you don't 
verify that that the second field header is actually the stop field.  As a 
result, if someone sends you a struct with more than one field (like, a C++ 
client that has non-nullable fields and currently ignores the union/struct 
distinction) that you expect to be a union, you will desynchronize.  I think 
the simplest fix would be to check it and throw an exception if it is not the 
stop field.  You could also 

There is probably a similar problem if you attempt to deserialize a struct with 
no fields.

> Add "union" to Thrift
> ---------------------
>
>                 Key: THRIFT-409
>                 URL: https://issues.apache.org/jira/browse/THRIFT-409
>             Project: Thrift
>          Issue Type: New Feature
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.2
>
>         Attachments: one_rule.diff, thrift-409-v2.patch, thrift-409-v3.patch, 
> thrift-409-v4.patch, thrift-409-v5.patch, thrift-409-v6.patch, 
> thrift-409-v7.patch, thrift-409-v8.patch, thrift-409-v9.patch, 
> thrift-409.patch
>
>
> It would be very helpful to have a "union" construct in Thrift. Let's decide 
> on the design and then break up into sub-issues to add this feature.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to