-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Fix DB inconsistencies with extends/2 #2293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hvitved
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small thing, and also a dist-compare run would be good.
| else ( | ||
| not this instanceof ObjectType and | ||
| result instanceof ObjectType | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write
extend(this, getTypeRef(result))
or
not extend(this, _) and
not this instanceof ObjectType and
result instanceof ObjectType
…correctly give a base class of 'Object' when a base type is missing, which is often incorrect and can lead to db inconsistencies.
f04e8f2 to
14e81e0
Compare
| or | ||
| not extend(this, _) and | ||
| not this instanceof ObjectType and | ||
| result instanceof ObjectType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this result instanceof ObjectType and not result = ObjectType?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latter is not valid QL syntax, as the right-hand-side is a QL class and not an expression. result = any(ObjectType ot) would work, but instanceof is better IMO. Note that the extractor will guarantee that there is indeed only one element inside ObjectType.
|
I had to make a similar change on #4017. |
When a base class is unknown (due to a missing reference), Roslyn will incorrectly give a base class of
Object, which gets written to theextends/2table. This can cause DB inconsistencies. Instead, do not populateObjectas a base class, and instead deduce it in QL.