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

union result is not differ from mysql #7075

Closed
XuHuaiyu opened this issue Jul 17, 2018 · 2 comments · Fixed by #7112
Closed

union result is not differ from mysql #7075

XuHuaiyu opened this issue Jul 17, 2018 · 2 comments · Fixed by #7112
Assignees
Labels
type/bug The issue is confirmed as a bug.
Milestone

Comments

@XuHuaiyu
Copy link
Contributor

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
create table t(a int);
create table s(a int unsigned);

insert into t value(-1);
insert into s value(1);
  1. What did you expect to see?
select * from t union all select * from s;
+------+
| a    |
+------+
|   -1 |
|    1 |
+------+

select * from s union all select * from t;
+------+
| a    |
+------+
|    0 |
|    1 |
+------+
  1. What did you see instead?
select * from t union all select * from s;
+------+
| a    |
+------+
|   -1 |
|    1 |
+------+

select * from s union all select * from t;
+------+
| a    |
+------+
|   -1 |
|    1 |
+------+
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v2.1.0-beta-61-g44e34bd-dirty
Git Commit Hash: 44e34bd30468fb35df4526d37c8511b259c6794d
Git Branch: castintasdecimal
UTC Build Time: 2018-07-17 09:39:23
GoVersion: go version go1.10.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
@XuHuaiyu XuHuaiyu added the type/bug The issue is confirmed as a bug. label Jul 17, 2018
@XuHuaiyu XuHuaiyu self-assigned this Jul 17, 2018
@XuHuaiyu XuHuaiyu added this to the 2.1 milestone Jul 17, 2018
@zz-jason
Copy link
Member

The result of mysql seems strange... Is it mysql 5.7?

@XuHuaiyu
Copy link
Contributor Author

yes, mysql 5.7
I think it's somewhat reasonable,
since the result type is an aggregate type of two types.

And it seems the unsigned flag of the first column
would affect the final type unsigned flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants