-
Notifications
You must be signed in to change notification settings - Fork 394
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
Raise error when computed global is set or reset. #7374
Conversation
ea520dd
to
e8b0c54
Compare
if isinstance(expr, (qlast.ConfigSet, qlast.ConfigReset)): | ||
if glob.get_expr(ctx.env.schema): | ||
raise errors.ConfigurationError( | ||
f"global '{glob_name}' is computed from an expression and " |
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'd probably just say "computed global 'whatever' may not be modified" or some such
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.
This seems good for set global
. We want to also check what happens when the client specifies the values via the protocol
@msullivan I saw the issue mentioned that. With these changes, it seems that setting the global silently deletes it from the state. |
I'm not sure what you mean by that |
ccd4fbf
to
022a181
Compare
Also added a test to the python client here: edgedb/edgedb-python#494 |
After
set global foo := false;
, attempting to runset global lol := false;
produces the following error:close #7368