Commit f723412
authored
fix: Adjust the constant optimization in
The constant optimization in `list_contains` was incorrect (and could
cause a crash like #3210), because it:
1. produced a `ConstantArray` with the length of the `elements` array,
rather than with the length of the input `ListArray`.
2. produced a `ConstantArray(true)` when all `elements` matched, without
correlating with the `offsets` (which might contain empty lists).
This change adjusts the constant optimization to only trigger if no
elements match, and to produce a `ConstantArray` of the appropriate
length.
Fixes #3210.list_contains (#3211)1 parent 8f1ad34 commit f723412
1 file changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | | - | |
70 | | - | |
71 | | - | |
| 69 | + | |
| 70 | + | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
251 | 250 | | |
252 | 251 | | |
253 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
254 | 271 | | |
255 | 272 | | |
256 | 273 | | |
| |||
0 commit comments