Open Alkaagr81 opened 3 years ago
even with INSERT INTO t0 SELECT a FROM t1 JOIN t2 USING (a) ON DUPLICATE KEY UPDATE k= t1.a + t2.b + 10;
TiDB still gets a error.
ERROR 1054 (42S22): Unknown column t2.b
in 'field list' while MySQL succeeds.
So the problem must be: the clause behind the ON DUPLICATE KEY UPDATE should see the from
scope, which means t1 JOIN t2
here (of course a is not deduplicated). TiDB will extract what it needs from the bottom up.
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)