-
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
roachtest: sqlsmith/setup=rand-tables/setting=no-mutations failed #62686
Comments
Reduced repro:
results in
Having an inverted index seems to be required for the repro. cc @mgartner |
It's reproducible with just a
|
We don't correctly handle |
The bug is present in JOINs as well. This test fails:
|
This commit fixes a panic that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an additional `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DFullyWithin(a, b, NULL::FLOAT8)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites the `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#60527 Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#60527 Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
62893: opt: fix geospatial function NULL argument panics r=mgartner a=mgartner This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes #60527 Fixes #62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2. 62984: storage: reduce memory allocations in intentInterleavingIter r=sumeerbhola a=sumeerbhola The memory allocations for computing the bounds for the EngineIterator were 33% of the memory allocations in batcheval.Scan in a joinReader benchmark (the rest, as expected, is in pebbleResults for storing the result of the scan). These allocations were 6% of the cpu in MVCCScanToBytes in the same benchmark. Release note: None Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: sumeerbhola <[email protected]>
This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#60527 Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#60527 Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#60527 Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
This commit fixes panics that occurred when planning inverted index scans and when performing inverted joins on `GEOMETRY` and `GEOGRAPHY` inverted indexes for queries containing geospatial functions with an `NULL` constant argument. This panic only occurred when the constant `NULL` argument was cast to an acceptable type for the function overload, for example `ST_DWithin(a, b, NULL::FLOAT8)` or `ST_DWithin(NULL:GEOMETRY, b, 1)`. Without the cast, no panic occured because `tree.FuncExpr.TypeCheck` rewrites a `tree.FuncExpr` as `tree.DNull` when any of the arguments have an unknown type, such as an uncast `NULL`. This rewriting happens even before the `tree.FuncExpr` is built into a `memo.FunctionExpr` by optbuilder. Fixes cockroachdb#60527 Fixes cockroachdb#62686 Release note (bug fix): Queries that reference tables with `GEOMETRY` or `GEOGRAPHY` inverted indexes and that call geospatial functions with constant `NULL` values cast to a type, like `NULL::GEOMETRY` or `NULL::FLOAT8`, no longer error. This bug was present since 20.2.
(roachtest).sqlsmith/setup=rand-tables/setting=no-mutations failed on master@3cfe2a38044b9e0d47b09815658e8634e4f4bfda:
More
Artifacts: /sqlsmith/setup=rand-tables/setting=no-mutations
See this test on roachdash
powered by pkg/cmd/internal/issues
The text was updated successfully, but these errors were encountered: