Skip to content

ORA-01790: expression must have same datatype as corresponding expression #114

@dmartin509

Description

@dmartin509

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions