mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fix bug#13392 Wrong VALUES() behaviour in INSERT SELECT with ON DUPLICATE
VALUES() can only refer to table insert going to. But Item_insert_value::fix_fields() were passing to it's arg full table list, This results in finding second column which shouldn't be found, and failing with error about ambiguous field. Item_insert_value::fix_fields() now passes only first table of full table list. sql/item.cc: Fix bug #14016 date_format() 2nd parameter was compared using case insensitive collation. If second parameter of date_format() is constant then it's collation is changed to case sensitive. mysql-test/r/insert_select.result: Test case for bug#14016 2nd parameter was compared using case insensitive collation mysql-test/t/insert_select.test: Test case for bug#14016 2nd parameter was compared using case insensitive collation
This commit is contained in:
@ -678,3 +678,11 @@ f1
|
||||
2001
|
||||
2002
|
||||
drop table t1;
|
||||
create table t1(x int, y int);
|
||||
create table t2(x int, z int);
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(x);
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(z);
|
||||
ERROR 42S22: Unknown column 'z' in 'field list'
|
||||
insert into t1(x,y) select x,z from t2 on duplicate key update x=values(t2.x);
|
||||
ERROR 42S02: Unknown table 't2' in field list
|
||||
drop table t1,t2;
|
||||
|
Reference in New Issue
Block a user