Marshal/Unmarshal missing UDT fields as null instead of failing in unsafe mode
We can't return an error in case a field is added to the UDT,
otherwise existing code would break by simply altering the UDT in the
database. For extra fields at the end of the UDT put nulls to be in
line with gocql, but also python-driver and java-driver.
In gocql it was fixed in d2ed1bb74f
This commit is contained in:
committed by
Sylwia Szunejko
parent
c6f942afc7
commit
6a60650668
@@ -215,6 +215,13 @@ func (q *Queryx) Bind(v ...interface{}) *Queryx {
|
||||
return q
|
||||
}
|
||||
|
||||
// Scan executes the query, copies the columns of the first selected
|
||||
// row into the values pointed at by dest and discards the rest. If no rows
|
||||
// were selected, ErrNotFound is returned.
|
||||
func (q *Queryx) Scan(v ...interface{}) error {
|
||||
return q.Query.Scan(udtWrapSlice(q.Mapper, q.unsafe, v)...)
|
||||
}
|
||||
|
||||
// Err returns any binding errors.
|
||||
func (q *Queryx) Err() error {
|
||||
return q.err
|
||||
|
||||
Reference in New Issue
Block a user