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

Select result is not compatible with MySQL while performing union operation between char and integer #25603

Open
PragmaTwice opened this issue Jun 21, 2021 · 1 comment
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@PragmaTwice
Copy link
Contributor

PragmaTwice commented Jun 21, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE a(b char);
SELECT b FROM a UNION SELECT avg(1);

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

In MySQL:

+---------+
| b       |
+---------+
| 1.00000 |
+---------+
1 row in set (0.00 sec)

Type of 1.00000 is char(7), not integer

3. What did you see instead (Required)

+--------+
| b      |
+--------+
| 1.0000 |
+--------+
1 row in set (0.00 sec)

Type of 1.0000 is char(24), not integer (by creating a view and describing it, strangely)

4. What is your TiDB version? (Required)

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
                                                                                                                                                 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.2.0-alpha-88-ged52601e6
Edition: Community
Git Commit Hash: ed52601e6eb560138db8cdccdfa1b5e2d33a11f0
Git Branch: master
UTC Build Time: 2021-06-16 13:03:48
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
@PragmaTwice PragmaTwice added the type/bug The issue is confirmed as a bug. label Jun 21, 2021
@yudongusa
Copy link

seems duplicate one of #25600

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

No branches or pull requests

3 participants