Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d58f2bdf
Commit
d58f2bdf
authored
Oct 25, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/13392-bug-4.1-mysql
parents
b4e8705b
45369edf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
mysql-test/r/insert_select.result
mysql-test/r/insert_select.result
+8
-0
mysql-test/t/insert_select.test
mysql-test/t/insert_select.test
+12
-0
sql/item.cc
sql/item.cc
+7
-0
No files found.
mysql-test/r/insert_select.result
View file @
d58f2bdf
...
...
@@ -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;
mysql-test/t/insert_select.test
View file @
d58f2bdf
...
...
@@ -214,4 +214,16 @@ insert into t1(f1) select if(max(f1) is null, '2000',max(f1)+1) from t1;
select
*
from
t1
;
drop
table
t1
;
#
# Bug #13392 values() fails with 'ambiguous' or returns NULL
# with ON DUPLICATE and SELECT
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
);
--
error
1054
insert
into
t1
(
x
,
y
)
select
x
,
z
from
t2
on
duplicate
key
update
x
=
values
(
z
);
--
error
1109
insert
into
t1
(
x
,
y
)
select
x
,
z
from
t2
on
duplicate
key
update
x
=
values
(
t2
.
x
);
drop
table
t1
,
t2
;
# End of 4.1 tests
sql/item.cc
View file @
d58f2bdf
...
...
@@ -2796,8 +2796,14 @@ bool Item_insert_value::fix_fields(THD *thd,
Item
**
items
)
{
DBUG_ASSERT
(
fixed
==
0
);
st_table_list
*
orig_next_table
=
table_list
->
next
;
table_list
->
next
=
0
;
if
(
!
arg
->
fixed
&&
arg
->
fix_fields
(
thd
,
table_list
,
&
arg
))
{
table_list
->
next
=
orig_next_table
;
return
1
;
}
table_list
->
next
=
orig_next_table
;
if
(
arg
->
type
()
==
REF_ITEM
)
{
...
...
@@ -2809,6 +2815,7 @@ bool Item_insert_value::fix_fields(THD *thd,
arg
=
ref
->
ref
[
0
];
}
Item_field
*
field_arg
=
(
Item_field
*
)
arg
;
if
(
field_arg
->
field
->
table
->
insert_values
)
{
Field
*
def_field
=
(
Field
*
)
sql_alloc
(
field_arg
->
field
->
size_of
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment