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.05k stars 3.8k forks source link

colexec: fix mixed type comparison between Timestamp and TimestampTZ #44770

Open yuzefovich opened 4 years ago

yuzefovich commented 4 years ago

I believe currently there is an issue when comparing values of Timestamp type against TimestampTZ type. In the vectorized engine both are mapped to coltypes.Timestamp, so the generated code doesn't know that there are some differences. Timestamp value needs to be "shifted" into the time zone of the evaluation context before comparison whereas TimestampTZ value doesn't need to, but currently we're comparing the values as if both were TimestampTZ. This issue should fixed as part of #43559.

If we don't fix it before the release, we need to have some fallback mechanism - either remove the support for one of the types or plumb through logical types in all operators and prohibit specifically such mixed type comparison.

Jira issue: CRDB-5204

asubiotto commented 4 years ago

Mixed type comparisons with timestamps are disallowed after #45724

github-actions[bot] commented 1 year ago

We have marked this issue as stale because it has been inactive for 18 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to CockroachDB!