You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "worryg0d (via GitHub)" <gi...@apache.org> on 2026/04/01 10:06:36 UTC

Re: [PR] Iter.MapScan is unable to scan data of user-defined types fix [cassandra-gocql-driver]

worryg0d commented on code in PR #1939:
URL: https://github.com/apache/cassandra-gocql-driver/pull/1939#discussion_r3021090896


##########
marshal.go:
##########
@@ -2923,9 +2923,13 @@ func (udt UDTTypeInfo) Marshal(value interface{}) ([]byte, error) {
 func (udt UDTTypeInfo) Unmarshal(data []byte, value interface{}) error {
 	// do this up here so we don't need to duplicate all of the map logic below
 	if iptr, ok := value.(*interface{}); ok && iptr != nil {
-		v := map[string]interface{}{}
-		*iptr = v
+		var v map[string]interface{}
 		value = &v
+		// Deffering this to the end of the method so dst var will hold updated map value
+		// https://issues.apache.org/jira/projects/CASSGO/issues/CASSGO-115
+		defer func() {
+			*iptr = v
+		}()
 	}

Review Comment:
   Updated patch - now there is an unmarshalIntoMap method, which is called for both *map[string]interface{} and *interface{} cases



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org