coalesce(Int, Utf8) coerces to Int
Open
bug
- Dominant language
- Rust
- Stars
- 9.3k
- Forks
- 2.4k
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 344
Description
### Describe the bug
Type coercion of `COALESCE` returns Int even when there are string arguments. This is not always correct, as '' is a valid string but cannot be converted to int.
### To Reproduce
```sql
SELECT coalesce(1,'')
```
should be typed as a string, not int
### Expected behavior
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start by running the reported SQL reproduction, SELECT coalesce(1,''), and inspect how COALESCE determines its result type. Compare the inferred type with the expected string type and add or update coverage for this case; done means string arguments are not incorrectly coerced to Int.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100