Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yuzefovich opened this issue Feb 5, 2020 · 2 comments
Open
Labels
C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-queries SQL Queries Team

Comments

@yuzefovich
Copy link
Member

yuzefovich commented Feb 5, 2020

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

@yuzefovich yuzefovich added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Feb 5, 2020
@yuzefovich yuzefovich added this to Triage in BACKLOG, NO NEW ISSUES: SQL Execution via automation Feb 5, 2020
@yuzefovich yuzefovich moved this from Triage to 20.1 Commitments in BACKLOG, NO NEW ISSUES: SQL Execution Feb 5, 2020
@asubiotto asubiotto moved this from 20.1 Commitments to 20.1.8 in BACKLOG, NO NEW ISSUES: SQL Execution Mar 4, 2020
@asubiotto asubiotto moved this from 20.1.8 to [BACKLOG] Enhancements/Features in BACKLOG, NO NEW ISSUES: SQL Execution Mar 4, 2020
@asubiotto
Copy link
Contributor

Mixed type comparisons with timestamps are disallowed after #45724

@jlinder jlinder added the T-sql-queries SQL Queries Team label Jun 16, 2021
@github-actions
Copy link

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!

@yuzefovich yuzefovich added C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. and removed no-issue-activity C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior. T-sql-queries SQL Queries Team
Projects
BACKLOG, NO NEW ISSUES: SQL Execution
[VECTORIZED BACKLOG] Enhancements/Fea...
Status: Backlog
Development

No branches or pull requests

3 participants