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

Can't find column errors when using group_concat #22082

Closed
qw4990 opened this issue Dec 29, 2020 · 5 comments
Closed

Can't find column errors when using group_concat #22082

qw4990 opened this issue Dec 29, 2020 · 5 comments
Labels
severity/moderate sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@qw4990
Copy link
Contributor

qw4990 commented Dec 29, 2020

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `tx` (
  `ct_name` varchar(100) DEFAULT NULL,
  `employee_name` varchar(100) DEFAULT NULL
);

select group_concat(ct_name_tt order by ct_nums_tt)
from (
  select  ct_name_t as ct_name_tt ,ct_nums_t as ct_nums_tt
  from
      (
      select  t1.ct_name as ct_name_t, t1.ct_name+' ' as ct_nums_t, t1.employee_name
      from (
          select employee_name, ct_name
          from tx
          group by employee_name,ct_name
          ) t1
      ) t
  group by ct_name_t,ct_nums_t
) tt;

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

The query above returns an empty result without any error.

3. What did you see instead (Required)

ERROR 1105 (HY000): Can't find column tt.ct_nums_tt in schema Column: [test.t.ct_name_t,t.ct_nums_t] Unique key: [[test.t.ct_name_t,t.ct_nums_t]]

4. What is your TiDB version? (Required)

Release-3.0.20

mysql> select version();
+---------------------+
| version()           |
+---------------------+
| 5.7.25-TiDB-v3.0.20 |
+---------------------+
1 row in set (0.00 sec)
@qw4990 qw4990 added type/bug The issue is confirmed as a bug. sig/execution SIG execution severity/moderate labels Dec 29, 2020
@TszKitLo40
Copy link
Contributor

In master version, the result is NULL. It seems that this issue has been fixed.

@XuHuaiyu
Copy link
Contributor

@qw4990 Maybe we need to check which commit in master fixed this issue.

@XuHuaiyu XuHuaiyu added sig/planner SIG: Planner and removed sig/execution SIG execution labels Jan 18, 2021
@yudongusa
Copy link

@qw4990 @XuHuaiyu since it's been quite awhile after this was fixed and probably hard to locate the PR actually fixed the issue, should we go ahead to close it?

@winoros
Copy link
Member

winoros commented Nov 23, 2021

Since 3.0.x is not maintained now. We are going to close this issue.
If you meet this one, upgrading would solve it. :)

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

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

5 participants