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

Got error when using insert into select on duplicate key update #30224

Closed
guo-shaoge opened this issue Nov 29, 2021 · 2 comments
Closed

Got error when using insert into select on duplicate key update #30224

guo-shaoge opened this issue Nov 29, 2021 · 2 comments
Assignees
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@guo-shaoge
Copy link
Collaborator

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

drop table if exists ccd;
drop table if exists cm1;
create table ccd (s int, b int, p int);
create table cm1 (p int);
insert into ccd (p) select 3 from cm1 on duplicate key update p = cm1.p;

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

no error

3. What did you see instead (Required)

mysql> insert into ccd (p) select 3 from cm1 on duplicate key update p = cm1.p;
ERROR 1054 (42S22): Unknown column 'cm1.p' in 'field list'

4. What is your TiDB version? (Required)

mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()

                             |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.15-9-g605c1fa58b
Edition: Community
Git Commit Hash: 605c1fa58b0425817b3d8e258d1a1685d93d4d7c
Git Branch: release-4.0
UTC Build Time: 2021-11-28 07:23:59
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)
@guo-shaoge guo-shaoge added the type/bug The issue is confirmed as a bug. label Nov 29, 2021
@sylzd
Copy link
Contributor

sylzd commented Nov 30, 2021

/assign

@XuHuaiyu XuHuaiyu added sig/planner SIG: Planner and removed sig/execution SIG execution labels Dec 1, 2021
@guo-shaoge
Copy link
Collaborator Author

dup with #28078

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

No branches or pull requests

5 participants