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

date_format with "\n" as pattern has different behavior with MySQL #32232

Closed
lzmhhh123 opened this issue Feb 10, 2022 · 0 comments · Fixed by #32358
Closed

date_format with "\n" as pattern has different behavior with MySQL #32232

lzmhhh123 opened this issue Feb 10, 2022 · 0 comments · Fixed by #32358
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@lzmhhh123
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(dt datetime);

explain select * from t where dt <= date_format('2022-02-09', '%Y-%m-%d 16:33:00');

explain select * from t where dt <= date_format('2022-02-09', '%Y-%m-%d
16:33:00');

2. What did you expect to see? (Required)

The selection condition of execution plan in both sqls are le(test.t.dt, 2022-02-09 16:33:00.000000)

3. What did you see instead (Required)

The second is le(test.t.dt, NULL)

4. What is your TiDB version? (Required)

4.0, 5.0, 5.1, and older 5.1 versions.

@lzmhhh123 lzmhhh123 added the type/bug The issue is confirmed as a bug. label Feb 10, 2022
@lzmhhh123 lzmhhh123 changed the title date_format with "\n" as partern has different behavior with MySQL date_format with "\n" as pattern has different behavior with MySQL Feb 10, 2022
@ti-chi-bot ti-chi-bot added may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. labels Feb 15, 2022
@ichn-hu ichn-hu added affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. and removed severity/moderate may-affects-4.0 This bug maybe affects 4.0.x versions. may-affects-5.1 This bug maybe affects 5.1.x versions. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-5.0 This bug maybe affects 5.0.x versions. labels Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. affects-5.0 This bug affects 5.0.x versions. affects-5.1 This bug affects 5.1.x versions. affects-5.2 This bug affects 5.2.x versions. affects-5.3 This bug affects 5.3.x versions. affects-5.4 This bug affects 5.4.x versions. severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
4 participants