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

Uncorrect result when there's union #26559

Closed
winoros opened this issue Jul 26, 2021 · 1 comment · Fixed by #26561
Closed

Uncorrect result when there's union #26559

winoros opened this issue Jul 26, 2021 · 1 comment · Fixed by #26561
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@winoros
Copy link
Member

winoros commented Jul 26, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

create table t(a timestamp, b datetime);
insert into t values('2020-07-29 09:07:01', '2020-07-27 16:57:36');
select greatest(a, b) from t union select null;

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

+---------------------+
| greatest(a, b)      |
+---------------------+
| NULL                |
| 2020-07-29 09:07:01 |
+---------------------+

3. What did you see instead (Required)

+----------------+
| greatest(a, b) |
+----------------+
| NULL           |
|                |
+----------------+
2 rows in set, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+-----------------------------------------+
| Level   | Code | Message                                 |
+---------+------+-----------------------------------------+
| Warning | 1406 | Data Too Long, field len 0, data len 19 |
+---------+------+-----------------------------------------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

current master

@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
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants