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
Fix during migration defaults are not compiled as detached #5606
Conversation
CREATE TYPE TestSelfLink3 { | ||
CREATE PROPERTY foo3 -> std::str; | ||
CREATE PROPERTY bar3 -> std::str { | ||
SET default := TestSelfLink3.foo3; | ||
SET default := .foo3; | ||
}; | ||
}; |
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 fix broke this test.
Turns out if you tried to do an INSERT after this test, it would fail. So it was wrong before.
@@ -1838,7 +1844,7 @@ def _check_id_default( | |||
'std::uuid_generate_v4', | |||
) | |||
|
|||
if ( | |||
while ( | |||
isinstance(expr, irast.Set) | |||
and expr.expr | |||
and irutils.is_trivial_select(expr.expr) |
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.
Compiling as detached produced double nested irast.Set
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.
Could you double check how other things that are detached handle this (policies, rewrites), since I don't remember, and we might want to unify the mechanisms?
We also need to have a more general discussion of what the plan is for schema things being detached, since the backstory here is kind of twisted and we're in a pretty mixed state right now
I've done an analysis of supported features and this is the resulting matrix:
All in all, pretty consistent. These are the things we could improve:
PS: these are all tested for properties only, no links or link properties. Schema used
|
That's a great table! Could you finish it up with indexes, constraints, and computeds? |
I think that
I get
Using your version with a runtime |
I've filled in the table for the remaining constructs. The |
Should I open a new issue about this? |
@aljazerzen, computeds have the |
(defaults too) |
Edit: oh, you wrote @elprans I'm getting these two errors:
... it this only in SDL maybe? Or am I doing something wrong? |
The default is still giving me errors, but only when I insert, which must be a bug:
|
A followup for #5606 (comment) This is techincally a breaking change, since any index definitions that are using `Object.property` will now throw errors. I do think it is quite minor and will probably not affect anyone, as this pattern is not documented and treated as detached in all other SDL expressions apart from computeds.
Follow up for #5606 (comment). Triggers that are not Delete, can now contain partial paths that refer to `__new__`. Not a breaking change.
A followup for #5606 (comment) This is techincally a breaking change, since any index definitions that are using `Object.property` will now throw errors. I do think it is quite minor and will probably not affect anyone, as this pattern is not documented and treated as detached in all other SDL expressions apart from computeds.
Closes #5547