-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
71226: rowexec: fix zigzag joiner with ON expression in some cases r=yuzefovich a=yuzefovich Zigzag joiner needs to tell the row fetcher which columns are needed. Previously, we forgot to include the columns that are needed by the ON expression but are not needed in the output, so when evaluating such an ON expression, we would hit an internal error. This commit fixes the problem by including all columns referenced by the ON expression into the set of columns to be fetched. Fixes: #71093 Release note (bug fix): Previously, CockroachDB could encounter an internal error when executing a zigzag join in some cases (when there are multiple filters present and at least one filter refers to the column that is part of STORING clause of the secondary index that is used by the zigzag join), and this has been fixed. 71231: Added SHOW CREATE SCHEDULES diagram r=ericharmeling a=ericharmeling Related to cockroachdb/docs#11008 @kathancox Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Eric Harmeling <[email protected]>
- Loading branch information
Showing
9 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
show_create_schedules_stmt ::= | ||
'SHOW' 'CREATE' 'ALL' 'SCHEDULES' | ||
| 'SHOW' 'CREATE' 'SCHEDULE' a_expr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# LogicTest: local | ||
|
||
# Make sure that the zigzag join is used in the regression tests for #71093. | ||
statement ok | ||
CREATE TABLE t71093 (a INT, b INT, c INT, d INT, INDEX a_idx(a) STORING (b), INDEX c_idx(c) STORING (d)); | ||
INSERT INTO t71093 VALUES (0, 1, 2, 3) | ||
|
||
query T | ||
EXPLAIN SELECT count(*) FROM t71093 WHERE a = 0 AND b = 1 AND c = 2 | ||
---- | ||
distribution: local | ||
vectorized: true | ||
· | ||
• group (scalar) | ||
│ | ||
└── • zigzag join | ||
pred: ((a = 0) AND (b = 1)) AND (c = 2) | ||
left table: t71093@a_idx | ||
left columns: (a, b) | ||
left fixed values: 1 column | ||
right table: t71093@c_idx | ||
right columns: (c) | ||
right fixed values: 1 column | ||
|
||
query T | ||
EXPLAIN SELECT count(*) FROM t71093 WHERE a = 0 AND c = 2 AND d = 3 | ||
---- | ||
distribution: local | ||
vectorized: true | ||
· | ||
• group (scalar) | ||
│ | ||
└── • zigzag join | ||
pred: ((a = 0) AND (c = 2)) AND (d = 3) | ||
left table: t71093@a_idx | ||
left columns: (a) | ||
left fixed values: 1 column | ||
right table: t71093@c_idx | ||
right columns: (c, d) | ||
right fixed values: 1 column | ||
|
||
query T | ||
EXPLAIN SELECT count(*) FROM t71093 WHERE a = 0 AND b = 1 AND c = 2 AND d = 3 | ||
---- | ||
distribution: local | ||
vectorized: true | ||
· | ||
• group (scalar) | ||
│ | ||
└── • zigzag join | ||
pred: (((a = 0) AND (b = 1)) AND (c = 2)) AND (d = 3) | ||
left table: t71093@a_idx | ||
left columns: (a, b) | ||
left fixed values: 1 column | ||
right table: t71093@c_idx | ||
right columns: (c, d) | ||
right fixed values: 1 column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters