-
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: tlp failed on complex join condition involving geometry #84957
Comments
Reduced to: CREATE TABLE table1 (
col1_0 INET,
col1_1 DATE NOT NULL,
col1_2 BOX2D,
col1_3 GEOMETRY NOT NULL,
col1_4 STRING
AS (CASE WHEN col1_1 IS NULL THEN '' ELSE '%"':::STRING END) VIRTUAL
NOT NULL,
UNIQUE (col1_0 DESC) STORING(col1_2),
FAMILY (col1_2, col1_1, col1_3)
);
INSERT
INTO defaultdb.public.table1 (col1_1, col1_2, col1_3)
VALUES (
'1986-09-20':::DATE,
'BOX(-0.9553617556250505 0.373642371510408,-0.5504995924074046 0.882407929762621)':::BOX2D,
'01060000000200000001030000000100000004000000000000000000444000000000000044400000000000003440000000000080464000000000008046400000000000003E4000000000000044400000000000004440010300000002000000060000000000000000003440000000000080414000000000000024400000000000003E40000000000000244000000000000024400000000000003E4000000000000014400000000000804640000000000000344000000000000034400000000000804140040000000000000000003E40000000000000344000000000000034400000000000002E40000000000000344000000000000039400000000000003E400000000000003440'
);
SELECT
*
FROM
defaultdb.public.table1 AS tab_13521
JOIN defaultdb.public.table1 AS tab_13522 ON true;
(
SELECT
*
FROM
defaultdb.public.table1 AS tab_13521
JOIN defaultdb.public.table1 AS tab_13522 ON
tab_13521.col1_3::GEOMETRY
NOT IN (
WITH
with_341 (col_893)
AS (
SELECT
tab_13523.col1_4 AS col_893
FROM
defaultdb.public.table1@table1_col1_0_key
AS tab_13523
WHERE
true
)
SELECT
st_makeline(
'01030000C0010000000A000000E3541998A11EF4C1C67BC6F18E0CECC16004C47A6465BEC16261323B0A0B02C2A33FBDE96D28FAC129F4CF457C3CF3C1F0140B9AFE96CB41FECB17EE639BF5C1FC247EB9A4A1F14109C4D1CC823CF3C10C0DFBF987C1F0C1702A1D6536E6EDC1EAD22042D4950142EFEBD6B09485FBC13C047ED673D8E14180C023B327CDB6416090BD005C36FC4100CB95253527994110AD54A4EFF5DB4138A60149E149FD41367E609059ADF741A05C761FB9ACB74117BB44BCE60AFBC18E7212E96300EBC182F302118343F0417883F37F03D2E54120F5A6A828C1EB411812EB8CC687DB416047BC2FA05BE9C1D8280DA81393FB410044FB875BBAEE41264046DE3D4D00C29BCEDD83824C01C270909E5D4896FF4144A4A6C7236FEE4130F610770050DCC1E3541998A11EF4C1C67BC6F18E0CECC16004C47A6465BEC16261323B0A0B02C2'::GEOMETRY
)::GEOMETRY::GEOMETRY
AS col_894
FROM
with_341 AS cte_ref_115
WHERE
true
GROUP BY
cte_ref_115.col_893
LIMIT
23
)
)
UNION ALL
(
SELECT
*
FROM
defaultdb.public.table1 AS tab_13521
JOIN defaultdb.public.table1 AS tab_13522 ON
NOT
(
tab_13521.col1_3::GEOMETRY
NOT IN (
WITH
with_341 (col_893)
AS (
SELECT
tab_13523.col1_4 AS col_893
FROM
defaultdb.public.table1@table1_col1_0_key
AS tab_13523
WHERE
true
)
SELECT
st_makeline(
'01030000C0010000000A000000E3541998A11EF4C1C67BC6F18E0CECC16004C47A6465BEC16261323B0A0B02C2A33FBDE96D28FAC129F4CF457C3CF3C1F0140B9AFE96CB41FECB17EE639BF5C1FC247EB9A4A1F14109C4D1CC823CF3C10C0DFBF987C1F0C1702A1D6536E6EDC1EAD22042D4950142EFEBD6B09485FBC13C047ED673D8E14180C023B327CDB6416090BD005C36FC4100CB95253527994110AD54A4EFF5DB4138A60149E149FD41367E609059ADF741A05C761FB9ACB74117BB44BCE60AFBC18E7212E96300EBC182F302118343F0417883F37F03D2E54120F5A6A828C1EB411812EB8CC687DB416047BC2FA05BE9C1D8280DA81393FB410044FB875BBAEE41264046DE3D4D00C29BCEDD83824C01C270909E5D4896FF4144A4A6C7236FEE4130F610770050DCC1E3541998A11EF4C1C67BC6F18E0CECC16004C47A6465BEC16261323B0A0B02C2'::GEOMETRY
)::GEOMETRY::GEOMETRY
AS col_894
FROM
with_341 AS cte_ref_115
WHERE
true
GROUP BY
cte_ref_115.col_893
LIMIT
23
)
)
)
UNION ALL
(
SELECT
*
FROM
defaultdb.public.table1 AS tab_13521
JOIN defaultdb.public.table1 AS tab_13522 ON
(
tab_13521.col1_3::GEOMETRY
NOT IN (
WITH
with_341 (col_893)
AS (
SELECT
tab_13523.col1_4 AS col_893
FROM
defaultdb.public.table1@table1_col1_0_key
AS tab_13523
WHERE
true
)
SELECT
st_makeline(
'01030000C0010000000A000000E3541998A11EF4C1C67BC6F18E0CECC16004C47A6465BEC16261323B0A0B02C2A33FBDE96D28FAC129F4CF457C3CF3C1F0140B9AFE96CB41FECB17EE639BF5C1FC247EB9A4A1F14109C4D1CC823CF3C10C0DFBF987C1F0C1702A1D6536E6EDC1EAD22042D4950142EFEBD6B09485FBC13C047ED673D8E14180C023B327CDB6416090BD005C36FC4100CB95253527994110AD54A4EFF5DB4138A60149E149FD41367E609059ADF741A05C761FB9ACB74117BB44BCE60AFBC18E7212E96300EBC182F302118343F0417883F37F03D2E54120F5A6A828C1EB411812EB8CC687DB416047BC2FA05BE9C1D8280DA81393FB410044FB875BBAEE41264046DE3D4D00C29BCEDD83824C01C270909E5D4896FF4144A4A6C7236FEE4130F610770050DCC1E3541998A11EF4C1C67BC6F18E0CECC16004C47A6465BEC16261323B0A0B02C2'::GEOMETRY
)::GEOMETRY::GEOMETRY
AS col_894
FROM
with_341 AS cte_ref_115
WHERE
true
GROUP BY
cte_ref_115.col_893
LIMIT
23
)
) IS NULL
); |
Results of the two queries:
|
This one looks like a bug in our logical properties calculation for I think there may be a similar problem with |
Postgres also returns
I guess we assume all operators return non-null values if their input is non-null? |
I think this is still correct in most cases - for example I don't see how cockroach/pkg/sql/opt/operator.go Lines 366 to 373 in 003c036
|
86604: scbuildstmt: added cluster version gating for declarative schema changer r=Xiang-Gu a=Xiang-Gu For each implemented DDL stmt in the new schema changer, we added a minimal supported cluster version so that we can return an unimplemented error when the cluster version is lower than the minimal supported cluster version of that DDL statement. This will be useful in mixed-version cluster where we make sure we don't use new schema changer for statements that are only supported in v22.2, but not in v22.1. Partially fix #79840 Release justification: improve safety and prevent issues in mixed-version cluster. Release note: None 86605: builtins: don't panic on placeholders in bounded staleness function r=rafiss a=rafiss fixes #86243 Release note (bug fix): Fixed a crash/panic that could occur if placeholder arguments were used with the with_min_timestamp or with_max_staleness functions. Release justification: Fix a crash caused by a panic. 86607: sql: add nil guard when formatting placeholders r=rafiss a=rafiss Fixes #85363 Release note (bug fix): Fixed a crash that could happen when formatting queries that have placeholder BitArray arguments. Release justification: Fix a panic. 86634: sql: remove sql.defaults.optimizer_use_not_visible_indexes.enabled r=mgartner,wenyihu6,rafiss a=michae2 **sql: remove sql.defaults.optimizer_use_not_visible_indexes.enabled** In 22.2 the use of cluster settings for session setting defaults is deprecated, but I forgot this when reviewing #86033. Remove the unreleased default cluster setting we added. Release note: None **sql: add more session variables to statement bundles** Add some missing session variables to statement diagnostic bundles. This isn't quite everything, but it's better than what we had before. Release note: None ---- Release justification: low-risk bug fix. 86673: insights: enable the anomaly detector r=matthewtodd a=matthewtodd This change turns on the insights "anomaly detector" by default, catching statement executions in the >p99 latency for their fingerprint that are also far enough away from median latency and above a (default 50ms) threshold. Release justification: Category 2: Bug fixes and low-risk updates to new functionality. Release note (ops change): The `sql.insights.anomaly_detection.enabled` cluster setting now defaults to true, and the `sql.insights.anomaly_detection.latency_threshold` cluster setting now defaults to 50ms, down from 100ms to complement the fixed-threshold detector's default of 100ms. 86722: opt: don't mark st_makeline and st_extend as non-null r=DrewKimball a=DrewKimball `st_makeline` can take arguments of type `POINT`, `MULTIPOINT`, and `LINESTRING`. Other types cause it to return null (even if the input is non-null). Similarly, `st_extent` returns null when the input geometry is non-null, but empty. This commit prevents these two aggregate functions from being marked as non-null, since doing so can lead to incorrect results in the cases mentioned above. Fixes #84957 Release justification: low-risk fix to bug that can lead to incorrect results Release note (bug fix): Fixed a longstanding bug that could cause the optimizer to produce an incorrect plan when aggregate functions `st_makeline` or `st_extent` were called with invalid-type and empty inputs respectively. 86747: ui: fix typo r=maryliag a=maryliag Fix typo on Execution Index Recommendation text, using singular or plural accordingly. Release justification: low risk change Release note: None 86791: sql: slight refactor to audit logging code r=rafiss a=RichardJCai Release justification: Small refactor, no functionality change Release note: None Fixes #84760 Co-authored-by: Xiang Gu <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Michael Erickson <[email protected]> Co-authored-by: Matthew Todd <[email protected]> Co-authored-by: DrewKimball <[email protected]> Co-authored-by: Marylia Gutierrez <[email protected]> Co-authored-by: richardjcai <[email protected]>
`st_makeline` can take arguments of type `POINT`, `MULTIPOINT`, and `LINESTRING`. Other types cause it to return null (even if the input is non-null). Similarly, `st_extent` returns null when the input geometry is non-null, but empty. This commit prevents these two aggregate functions from being marked as non-null, since doing so can lead to incorrect results in the cases mentioned above. Fixes #84957 Release justification: low-risk fix to bug that can lead to incorrect results Release note (bug fix): Fixed a longstanding bug that could cause the optimizer to produce an incorrect plan when aggregate functions `st_makeline` or `st_extent` were called with invalid-type and empty inputs respectively.
`st_makeline` can take arguments of type `POINT`, `MULTIPOINT`, and `LINESTRING`. Other types cause it to return null (even if the input is non-null). Similarly, `st_extent` returns null when the input geometry is non-null, but empty. This commit prevents these two aggregate functions from being marked as non-null, since doing so can lead to incorrect results in the cases mentioned above. Fixes cockroachdb#84957 Release justification: low-risk fix to bug that can lead to incorrect results Release note (bug fix): Fixed a longstanding bug that could cause the optimizer to produce an incorrect plan when aggregate functions `st_makeline` or `st_extent` were called with invalid-type and empty inputs respectively.
`st_makeline` can take arguments of type `POINT`, `MULTIPOINT`, and `LINESTRING`. Other types cause it to return null (even if the input is non-null). Similarly, `st_extent` returns null when the input geometry is non-null, but empty. This commit prevents these two aggregate functions from being marked as non-null, since doing so can lead to incorrect results in the cases mentioned above. Fixes #84957 Release justification: low-risk fix to bug that can lead to incorrect results Release note (bug fix): Fixed a longstanding bug that could cause the optimizer to produce an incorrect plan when aggregate functions `st_makeline` or `st_extent` were called with invalid-type and empty inputs respectively.
`st_makeline` can take arguments of type `POINT`, `MULTIPOINT`, and `LINESTRING`. Other types cause it to return null (even if the input is non-null). Similarly, `st_extent` returns null when the input geometry is non-null, but empty. This commit prevents these two aggregate functions from being marked as non-null, since doing so can lead to incorrect results in the cases mentioned above. Fixes #84957 Release justification: low-risk fix to bug that can lead to incorrect results Release note (bug fix): Fixed a longstanding bug that could cause the optimizer to produce an incorrect plan when aggregate functions `st_makeline` or `st_extent` were called with invalid-type and empty inputs respectively.
roachtest.tlp failed with artifacts on release-22.1 @ 3fbf4a9d769e6db6aafd8a241a2a09b7c5e33738:
Help
See: roachtest README
See: How To Investigate (internal)
This test on roachdash | Improve this report!
Jira issue: CRDB-17971
The text was updated successfully, but these errors were encountered: