cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.1k stars 3.81k forks source link

Function return-type overload versus CASE statement regression #132792

Open bobvawter opened 2 weeks ago

bobvawter commented 2 weeks ago

select case when 0=1 then '2024-10-16 21:08:20.933859'::timestamp else current_timestamp end

In v23.1 and in postgres v14.5, this expression works and returns a value of type timestamp

Starting in v23.2 and confirmed through 24.2 this returns an error:

ERROR: incompatible value type: expected '2024-10-16 21:08:20.933859'::TIMESTAMP to be of type timestamptz, found type timestamp

Jira issue: CRDB-43279

blathers-crl[bot] commented 2 weeks ago

Hi @bobvawter, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

rafiss commented 1 day ago

looks like the same as https://github.com/cockroachdb/cockroach/issues/134043 and https://github.com/cockroachdb/cockroach/issues/133831. I bisected the regression to https://github.com/cockroachdb/cockroach/pull/108387