-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 failure when Unowned lookup IS NULL #10346
Fix failure when Unowned lookup IS NULL #10346
Conversation
This test case shows a regression in the query planner for queries that use `IS NULL` condition on an unowned lookup vindex column. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Elisa Vaccaro <30807261+evaccaro@users.noreply.github.com> Co-authored-by: Jakob Class <mikrobi@github.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
Updating the title of this PR to facilitate the release notes generation. |
utils.Exec(t, conn, "select * from t8 WHERE t9_id IS NULL") | ||
|
||
// Cleanup | ||
utils.Exec(t, conn, "delete from t9 WHERE parent_id = 1") |
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.
nit: we could put this in a defer
in case line 88 fails. (I don't remember if utils.Exec
terminate the test early if there is a failure, if not, then there is no need for a defer
)
if !ContainsAggregation(k) { | ||
return false | ||
} |
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 wouldn't support select exprs like count(a.id)+count(b.id)
since ContainsAggregation
checks for FuncExpr
, is that a problem?
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.
you're thinking of IsAggregation
. ContainsAggregation
checks in the whole expression tree for aggregation
* Add a failing test case showing Gen4 planner failure. This test case shows a regression in the query planner for queries that use `IS NULL` condition on an unowned lookup vindex column. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Elisa Vaccaro <30807261+evaccaro@users.noreply.github.com> Co-authored-by: Jakob Class <mikrobi@github.com> * bugfix: Limit the use of NoRoutesSpecialHandling to when it's needed Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Elisa Vaccaro <30807261+evaccaro@users.noreply.github.com> Co-authored-by: Jakob Class <mikrobi@github.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com>
…eeded (#11020) * fix V3: only use the special NoRoute handling mode when needed (#10422) Signed-off-by: Andres Taylor <andres@planetscale.com> * fix: build Signed-off-by: Harshit Gangal <harshit@planetscale.com> * Fix failure when Unowned lookup IS NULL (#10346) * Add a failing test case showing Gen4 planner failure. This test case shows a regression in the query planner for queries that use `IS NULL` condition on an unowned lookup vindex column. Signed-off-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Elisa Vaccaro <30807261+evaccaro@users.noreply.github.com> Co-authored-by: Jakob Class <mikrobi@github.com> * bugfix: Limit the use of NoRoutesSpecialHandling to when it's needed Signed-off-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Elisa Vaccaro <30807261+evaccaro@users.noreply.github.com> Co-authored-by: Jakob Class <mikrobi@github.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com> Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Harshit Gangal <harshit@planetscale.com> Signed-off-by: deepthi <deepthi@planetscale.com> Co-authored-by: Andres Taylor <andres@planetscale.com> Co-authored-by: Arthur Schreiber <arthurschreiber@github.com> Co-authored-by: Elisa Vaccaro <30807261+evaccaro@users.noreply.github.com> Co-authored-by: Jakob Class <mikrobi@github.com> Co-authored-by: deepthi <deepthi@planetscale.com>
Description
We should not use the
NoRoutesSpecialHandling
mode for vindex lookup queries.This PR changes when we apply this special handling mode. Before, we did it for all plans that were single routes, with this change we are more conservative and only use it in one of two situations:
select count(*) from tbl
.dual
query. If we have been able to merge adual
query with a subquery, we need to run the query and return something, even if no routes can be found to match the subquery predicates. This is because thedual
table always returns a single row. Example of this would beselect exists(select 1 from tbl where foo = 43)
Related Issue(s)
Checklist
Deployment Notes