Commit 1799dba
Merge cockroachdb#156962
156962: colexec: fix projections with constant NULL values r=mgartner a=mgartner
This commit fixes a bug in the vectorized engine that caused internal
errors when projections operated on constant NULL values. The
proj_const_right_ops operators do not correctly handle NULL inputs. So,
we avoid these code paths when operator does not operate on NULL values
and the LHS or RHS of an operator is NULL by simply projecting NULLs.
This is similar to the change made in cockroachdb#128123 and addresses a TODO added
in that PR.
This code path is unlikely to hit (maybe impossible) without generic
query plans. In an optimized cusotm plan, the optimizer will fold
expressions with `NULL` values at optimization time, and the execution
engine will never see expressions of this form.
Fixes cockroachdb#152771
Release note (bug fix): A bug has been fixed that could cause internal
errors for queries using generic query plans with `NULL` placeholder
values.
Co-authored-by: Marcus Gartner <[email protected]>File tree
2 files changed
+33
-5
lines changed- pkg/sql
- colexec/colbuilder
- logictest/testdata/logic_test
2 files changed
+33
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2828 | 2828 | | |
2829 | 2829 | | |
2830 | 2830 | | |
2831 | | - | |
2832 | | - | |
2833 | | - | |
2834 | | - | |
2835 | | - | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
2836 | 2841 | | |
2837 | 2842 | | |
2838 | 2843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
0 commit comments