Commit c613cbf
Daniel Q. Kim
Fix Nullable(X)->Y cross-type ALTER MODIFY COLUMN
PR ClickHouse#84770 generates _CAST(ifNull(col, default), TargetType).
When source and target base types differ (e.g. Nullable(UInt8) -> String),
ifNull throws NO_COMMON_TYPE because getLeastSupertype({UInt8, String}) fails.
Fix: swap to ifNull(_CAST(col, Nullable(TargetType)), _CAST(default, TargetType)).
Ref: ClickHouse#84770, ClickHouse#5985
Signed-off-by: Daniel Q. Kim <daniel.kim@altinity.com>1 parent c63afbe commit c613cbf
File tree
3 files changed
+31
-3
lines changed- src/Interpreters
- tests/queries/0_stateless
3 files changed
+31
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
171 | 179 | | |
172 | | - | |
| 180 | + | |
173 | 181 | | |
174 | 182 | | |
175 | 183 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
0 commit comments