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 schema when insert into ON DUPLICATE #14164

Closed
SunRunAway opened this issue Dec 20, 2019 · 5 comments · Fixed by #14412 or #33656
Closed

can't find schema when insert into ON DUPLICATE #14164

SunRunAway opened this issue Dec 20, 2019 · 5 comments · Fixed by #14412 or #33656
Assignees
Labels
affects-4.0 This bug affects 4.0.x versions. priority/release-blocker This PR blocks a release. Please review it ASAP. severity/critical sig/planner SIG: Planner type/bug This issue is a bug.

Comments

@SunRunAway
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
drop table a;
drop table b;
create table a (x int);
create table b (x int ,y int);
insert into a select x from b ON DUPLICATE KEY UPDATE 
a.x=b.y;
  1. What did you expect to see?
Query OK, 0 rows affected (0.00 sec)
Records: 0  Duplicates: 0  Warnings: 0
  1. What did you see instead?

ERROR 1054 (42S22): Unknown column 'b.y' in 'field list'

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
@SunRunAway SunRunAway added the type/bug This issue is a bug. label Dec 20, 2019
@SunRunAway
Copy link
Contributor Author

Another case:

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
drop table a;
drop table b;
create table a (x int);
create table b (x int);
insert into a select if(x, 1, 2) x from b ON DUPLICATE KEY UPDATE a.x=b.x;
  1. What did you expect to see?
Query OK, 0 rows affected (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0
  1. What did you see instead?

ERROR 1054 (42S22): Unknown column 'b.x' in 'field list'

@SunRunAway
Copy link
Contributor Author

Better to fix it in v3.0.9

@winoros winoros assigned winoros and unassigned eurekaka Dec 26, 2019
@SunRunAway SunRunAway changed the title can find schema when insert into ON DUPLICATE can't find schema when insert into ON DUPLICATE Dec 26, 2019
@SunRunAway SunRunAway added the priority/release-blocker This PR blocks a release. Please review it ASAP. label Jan 8, 2020
@zz-jason zz-jason added the sig/planner SIG: Planner label Mar 10, 2020
@github-actions github-actions bot added this to Need Triage in SIG Planner Kanban Mar 10, 2020
@zz-jason zz-jason moved this from Need Triage to Backlog: High Priority in SIG Planner Kanban Mar 10, 2020
@zz-jason zz-jason moved this from Issue Backlog: High Priority to Issue: In Progress in SIG Planner Kanban Mar 11, 2020
@github-actions github-actions bot added this to Need Triage in Question and Bug Reports Jun 2, 2020
@ghost ghost removed this from Need Triage in Question and Bug Reports Jul 24, 2020
@SunRunAway
Copy link
Contributor Author

Due to "The feature can not work in its main workflow", I change the severity to cirtical.

SIG Planner Kanban automation moved this from Coding/Reviewing to Coding Finished (This Week) Jan 6, 2021
@ti-srebot
Copy link
Contributor

ti-srebot commented Jan 6, 2021

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)

MySQL's behavior is somehow against logic. So TiDB wasn't compatible with it before.

2. Symptom (optional)

The SQL mentioned in the issue will report error.

3. All Trigger Conditions (optional)

See issue body.

4. Workaround (optional)

No.

5. Affected versions

[v4.0.1:v4.0.10], unreleased

6. Fixed versions

master

@tiancaiamao
Copy link
Contributor

Rejected in 4.0.16 bug triage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.0 This bug affects 4.0.x versions. priority/release-blocker This PR blocks a release. Please review it ASAP. severity/critical sig/planner SIG: Planner type/bug This issue is a bug.
Projects
No open projects
SIG Planner Kanban
  
Coding Finished (This Week)
6 participants