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

Can't select data by timestamp equals a literal #2856

Closed
MichaelScofield opened this issue Dec 1, 2023 · 2 comments · Fixed by #2905
Closed

Can't select data by timestamp equals a literal #2856

MichaelScofield opened this issue Dec 1, 2023 · 2 comments · Fixed by #2905
Assignees
Labels
C-bug Category Bugs

Comments

@MichaelScofield
Copy link
Collaborator

What type of bug is this?

Incorrect result

What subsystems are affected?

Standalone mode

Minimal reproduce step

First create table and insert data:

mysql> create table test(ts timestamp time index, a int);
Query OK, 0 rows affected (30.06 sec)

mysql> insert into test values(1,1);
Query OK, 1 row affected (0.03 sec)

mysql> select * from test;
+----------------------------+------+
| ts                         | a    |
+----------------------------+------+
| 1970-01-01 00:00:00.001000 |    1 |
+----------------------------+------+
1 row in set (0.07 sec)

Then select * from test where ts = '1970-01-01 00:00:00.001000';.

The result is empty, which is incorrect.

Two walkaround:

  • add time unit directly: select * from test where ts = “1970-01-01 00:00:00.001000”::timestamp_ms;
  • add time zone to time literal: select * from test where ts = "1970-01-01 08:00:00.001000"

What did you expect to see?

select non-empty data

What did you see instead?

select empty data

What operating system did you use?

all

Relevant log output and stack trace

No response

@waynexia waynexia added the C-bug Category Bugs label Dec 8, 2023
@killme2008
Copy link
Contributor

@waynexia What's the status of this issue?

@waynexia
Copy link
Member

@waynexia What's the status of this issue?

It's fixed in #2905

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants