Commit 201c016
fix:
## Which issue does this PR close?
- Closes apache#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.
(cherry picked from commit e684994)cardinality() of an empty array should be zero (apache#20533)1 parent 76c91c1 commit 201c016
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 | |
|---|---|---|---|
| |||
5032 | 5032 | | |
5033 | 5033 | | |
5034 | 5034 | | |
5035 | | - | |
| 5035 | + | |
| 5036 | + | |
| 5037 | + | |
| 5038 | + | |
| 5039 | + | |
| 5040 | + | |
5036 | 5041 | | |
5037 | 5042 | | |
5038 | 5043 | | |
5039 | 5044 | | |
5040 | | - | |
| 5045 | + | |
5041 | 5046 | | |
5042 | 5047 | | |
5043 | 5048 | | |
| |||
5046 | 5051 | | |
5047 | 5052 | | |
5048 | 5053 | | |
| 5054 | + | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
5049 | 5060 | | |
5050 | 5061 | | |
5051 | 5062 | | |
| |||
0 commit comments