Commit e684994
authored
fix:
## Which issue does this PR close?
- Closes #20526.
## Rationale for this change
Per Postgres and the SQL spec, `cardinality()` of an empty array should
be zero; we previously returned `NULL`.
Along the way, fix another bug: we previously returned `0` for the
cardinality of an untyped `NULL` and `NULL` for the cardinality of a
typed null (e.g., `NULL::int[]`). We should return `NULL` in both cases.
## What changes are included in this PR?
Bug fixes, update SLT.
## Are these changes tested?
Yes.
## Are there any user-facing changes?
Yes: the behavior of `cardinality` has changed, albeit the previous
behavior was incorrect.cardinality() of an empty array should be zero (#20533)1 parent d7d6461 commit e684994
2 files changed
Lines changed: 22 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5181 | 5181 | | |
5182 | 5182 | | |
5183 | 5183 | | |
5184 | | - | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
5185 | 5190 | | |
5186 | 5191 | | |
5187 | 5192 | | |
5188 | 5193 | | |
5189 | | - | |
| 5194 | + | |
5190 | 5195 | | |
5191 | 5196 | | |
5192 | 5197 | | |
| |||
5195 | 5200 | | |
5196 | 5201 | | |
5197 | 5202 | | |
| 5203 | + | |
| 5204 | + | |
| 5205 | + | |
| 5206 | + | |
| 5207 | + | |
| 5208 | + | |
5198 | 5209 | | |
5199 | 5210 | | |
5200 | 5211 | | |
| |||
0 commit comments