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

The type of year operation with the type of date is wrong #26215

Closed
mengxin9014 opened this issue Jul 13, 2021 · 3 comments
Closed

The type of year operation with the type of date is wrong #26215

mengxin9014 opened this issue Jul 13, 2021 · 3 comments
Assignees
Labels

Comments

@mengxin9014
Copy link
Contributor

Bug Report

create table t(a year,b date);
insert into t values(2005,"2004-10-10"),(2015,"2018-03-27");
alter table t set tiflash replica 1;
select * from t where a>b;

1. Minimal reproduce step (Required)

except:

actual:


<!-- a step by step guide for reproducing the bug. -->

### 2. What did you expect to see? (Required)
```mysql
+------+------------+
| a    | b          |
+------+------------+
| 2005 | 2004-10-10 |
+------+------------+

3. What did you see instead (Required)

empty

4. What is your TiDB version? (Required)

v5.0.1

@jebter
Copy link

jebter commented Jul 14, 2021

desc select * from t where a>b;
+---------------------+---------+-----------+---------------+--------------------------------------------------+
| id | estRows | task | access object | operator info |
+---------------------+---------+-----------+---------------+--------------------------------------------------+
| TableReader_7 | 1.60 | root | | data:Selection_6 |
| └─Selection_6 | 1.60 | cop[tikv] | | gt(cast(test.t.a, datetime(6) BINARY), test.t.b) |
| └─TableFullScan_5 | 2.00 | cop[tikv] | table:t | keep order:false, stats:pseudo |
+---------------------+---------+-----------+---------------+--------------------------------------------------+

@jebter
Copy link

jebter commented Aug 10, 2021

@mengxin9014 This problem has been solved?

@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

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

No branches or pull requests

4 participants