-
Notifications
You must be signed in to change notification settings - Fork 2
Description
When passing in more than one say child and if the child uses pointers there is a potential for the datatypes to get mixed up if one of the child's pointers is nil and the other child's pointer is set. If this occurs the following error is returned.
"ORA-01790: expression must have same datatype as corresponding expression"
It appears a nil pointer check was added to the convertValue function which will return a nil if a pointer is nil. This causes the original type of the reference to get lost [ (*bool)(nil) was being converted to nil ]. From what I can tell this check was added because nil *bool types where not be persisted correctly. But looking at the convertValue function we don't want to return nil *bool as again the datatypes will get mixed up since the convertValue function is converting bools to int's so we want to return (*int)(nil) for nil *bools to keep the types the same.
The case I primarily ran into was with the usage of an *int in which one of the child's *int's were set and the other was a nil *int. This again caused the datatypes not to match in the corresponding expression. But the same goes for *bool's as well.
Please see PR for additional guidance and suggested fix.