-
Notifications
You must be signed in to change notification settings - Fork 95
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
SELECT: If the schema is strict and a projected field doesn't exist, we should return an error #465
Comments
This implies the WHERE clause too. SELECT a from foo WHERE b > 10; should also returns an error. |
Good point, anywhere an expression is used in the SELECT statement (WHERE, GROUP BY, etc.) |
I was tackling issue #464 and found that it is more than related to this issue. Consider we have changed behavior how
So, the way how Probably we should think about these issue not like "forbid some behavior in this case", but more like "forbid using undefined identificators everywhere except where non-strict schema used". |
I think it might be easier and less expensive to do a static check only once during the preparation phase, right after the query has been parsed, rather than during the evaluation phase of Lifecycle of a queryFirst, here is a simplistic overview of the lifecycle of a query: query string (ex: During the preparation phase, we have a full view of the query right after it has been parsed, and we also have access to the table information (what is the schema, is it strict, etc.). ProposalTo do this we need to modify this (to better understand the relationship between these two structures, see this schema in the documentation) We then simply need to read the context received in the Then we do the same to all other statements (UpdateStmt, DeleteStmt, etc.) |
Hello, @asdine! Thanks for great explanation you provided earlier, that was a lot of help to me. We discussed this feature a while ago, but finally I have enough time to give it enough time for some completion. I made some early draft only for select core case #504 and realized there are a lot of design questions that can affect the scope of PR (one or many) and because I'm by any means no maintainer I want to address them here and then continue to work on this feature, so if you are fine with this, there my thought on this feature.
|
An error should be returned instead
The detection must be done during the preparation phase, before executing the query.
The text was updated successfully, but these errors were encountered: