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
a1376aa0
Commit
a1376aa0
authored
Jan 24, 2007
by
dlenev@mockturtle.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed test case after merging fix for bug#24491 "using alias from source
table in insert ... on duplicate key" in 5.1 tree.
parent
282501df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
31 deletions
+32
-31
mysql-test/t/sp-error.test
mysql-test/t/sp-error.test
+32
-31
No files found.
mysql-test/t/sp-error.test
View file @
a1376aa0
...
...
@@ -1812,6 +1812,38 @@ PREPARE stmt FROM "CREATE VIEW v AS SELECT ?";
DROP
TABLE
t1
;
#
# BUG#24491 "using alias from source table in insert ... on duplicate key"
#
--
disable_warnings
drop
tables
if
exists
t1
;
drop
procedure
if
exists
bug24491
;
--
enable_warnings
create
table
t1
(
id
int
primary
key
auto_increment
,
value
varchar
(
10
));
insert
into
t1
(
id
,
value
)
values
(
1
,
'FIRST'
),
(
2
,
'SECOND'
),
(
3
,
'THIRD'
);
# Let us create routine with INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
# statement which in its ON DUPLICATE KEY clause erroneously tries to assign
# value to a column which is mentioned only in SELECT part.
create
procedure
bug24491
()
insert
into
t1
(
id
,
value
)
select
*
from
(
select
4
as
i
,
'FOURTH'
as
v
)
as
y
on
duplicate
key
update
v
=
'DUP'
;
# Both first and second calls to it should fail
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
drop
procedure
bug24491
;
# And now the same test for more complex case which is more close
# to the one that was reported originally.
create
procedure
bug24491
()
insert
into
t1
(
id
,
value
)
select
*
from
(
select
4
as
id
,
'FOURTH'
as
value
)
as
y
on
duplicate
key
update
y
.
value
=
'DUP'
;
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
drop
procedure
bug24491
;
drop
tables
t1
;
#
# End of 5.0 tests
#
...
...
@@ -1853,37 +1885,6 @@ drop function bug20701;
--
echo
End
of
5.1
tests
#
# BUG#24491 "using alias from source table in insert ... on duplicate key"
#
--
disable_warnings
drop
tables
if
exists
t1
;
drop
procedure
if
exists
bug24491
;
--
enable_warnings
create
table
t1
(
id
int
primary
key
auto_increment
,
value
varchar
(
10
));
insert
into
t1
(
id
,
value
)
values
(
1
,
'FIRST'
),
(
2
,
'SECOND'
),
(
3
,
'THIRD'
);
# Let us create routine with INSERT ... SELECT ... ON DUPLICATE KEY UPDATE
# statement which in its ON DUPLICATE KEY clause erroneously tries to assign
# value to a column which is mentioned only in SELECT part.
create
procedure
bug24491
()
insert
into
t1
(
id
,
value
)
select
*
from
(
select
4
as
i
,
'FOURTH'
as
v
)
as
y
on
duplicate
key
update
v
=
'DUP'
;
# Both first and second calls to it should fail
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
drop
procedure
bug24491
;
# And now the same test for more complex case which is more close
# to the one that was reported originally.
create
procedure
bug24491
()
insert
into
t1
(
id
,
value
)
select
*
from
(
select
4
as
id
,
'FOURTH'
as
value
)
as
y
on
duplicate
key
update
y
.
value
=
'DUP'
;
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
--
error
ER_BAD_FIELD_ERROR
call
bug24491
();
drop
procedure
bug24491
;
drop
tables
t1
;
#
# BUG#NNNN: New bug synopsis
...
...
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