-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
opt, invertedexpr: inverted join may return incorrect results with additional filter #55648
Comments
Hi @rytaft, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
4 similar comments
Hi @rytaft, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Hi @rytaft, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Hi @rytaft, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Hi @rytaft, please add branch-* labels to identify which branch(es) this release-blocker affects. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
Prior to this commit, it was possible for an inverted join to return incorrect results if it had an additional scalar filter as part of the join condition. For example, a join condition such as ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 0 0)')) could be susceptible to this issue, because we pre-compute the SpanExpression for the scalar filter and store it for re-use. The problem was that the pre-computed SpanExpression was being modified and then reused, leading to memory corruption. This commit fixes the problem by making a copy of the pre-computed SpanExpression before using it and modifying it. Fixes cockroachdb#55648 Release note (bug fix): Fixed a bug that could occur for spatial queries involving a join between two spatial columns, when there was an additional filter on one of the spatial columns, and that column also had an inverted index defined. This bug could cause incorrect results to be returned, in which some rows were omitted from the output that should have been included.
55649: opt,invertedexpr: fix memory corruption issue in inverted join r=rytaft a=rytaft Prior to this commit, it was possible for an inverted join to return incorrect results if it had an additional scalar filter as part of the join condition. For example, a join condition such as ``` ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 0 0)')) ``` could be susceptible to this issue, because we pre-compute the `SpanExpression` for the scalar filter and store it for re-use. The problem was that the pre-computed `SpanExpression` was being modified and then reused, leading to memory corruption. This commit fixes the problem by making a copy of the pre-computed `SpanExpression` before using it and modifying it. Fixes #55648 Release note (bug fix): Fixed a bug that could occur for spatial queries involving a join between two spatial columns, when there was an additional filter on one of the spatial columns, and that column also had an inverted index defined. This bug could cause incorrect results to be returned, in which some rows were omitted from the output that should have been included. Co-authored-by: Rebecca Taft <[email protected]>
Prior to this commit, it was possible for an inverted join to return incorrect results if it had an additional scalar filter as part of the join condition. For example, a join condition such as ST_Contains(g1.geom, g2.geom) AND ST_Contains(g1.geom, ST_MakePolygon('LINESTRING(0 0, 0 5, 5 5, 0 0)')) could be susceptible to this issue, because we pre-compute the SpanExpression for the scalar filter and store it for re-use. The problem was that the pre-computed SpanExpression was being modified and then reused, leading to memory corruption. This commit fixes the problem by making a copy of the pre-computed SpanExpression before using it and modifying it. Fixes cockroachdb#55648 Release note (bug fix): Fixed a bug that could occur for spatial queries involving a join between two spatial columns, when there was an additional filter on one of the spatial columns, and that column also had an inverted index defined. This bug could cause incorrect results to be returned, in which some rows were omitted from the output that should have been included.
There is a bug in the inverted join logic which may cause some rows to be incorrectly omitted from the output if there is an additional scalar filter that is part of the join condition. For example:
The two above queries should return exactly the same results, since the only difference is that they use different indexes. However, clearly the results are different.
The text was updated successfully, but these errors were encountered: