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
c5475706
Commit
c5475706
authored
Nov 24, 2005
by
pem@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/usr/home/pem/bug13729/mysql-5.0
parents
f5804869
04114124
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
172 additions
and
2 deletions
+172
-2
mysql-test/r/sp.result
mysql-test/r/sp.result
+17
-0
mysql-test/r/sp_trans.result
mysql-test/r/sp_trans.result
+56
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+23
-0
mysql-test/t/sp_trans.test
mysql-test/t/sp_trans.test
+64
-0
sql/sql_update.cc
sql/sql_update.cc
+12
-2
No files found.
mysql-test/r/sp.result
View file @
c5475706
...
@@ -3868,5 +3868,22 @@ drop procedure bug10100pv|
...
@@ -3868,5 +3868,22 @@ drop procedure bug10100pv|
drop procedure bug10100pd|
drop procedure bug10100pd|
drop procedure bug10100pc|
drop procedure bug10100pc|
drop view v1|
drop view v1|
drop procedure if exists bug13729|
drop table if exists t3|
create table t3 (s1 int, primary key (s1))|
insert into t3 values (1),(2)|
create procedure bug13729()
begin
declare continue handler for sqlexception select 55;
update t3 set s1 = 1;
end|
call bug13729()|
55
55
select * from t3|
s1
1
2
drop procedure bug13729|
drop table t3|
drop table t3|
drop table t1,t2;
drop table t1,t2;
mysql-test/r/sp_trans.result
View file @
c5475706
...
@@ -369,3 +369,59 @@ drop procedure bug13825_0|
...
@@ -369,3 +369,59 @@ drop procedure bug13825_0|
drop procedure bug13825_1|
drop procedure bug13825_1|
drop procedure bug13825_2|
drop procedure bug13825_2|
drop table t1, t2|
drop table t1, t2|
drop table if exists t3|
drop procedure if exists bug14840_1|
drop procedure if exists bug14840_2|
create table t3
(
x int,
y int,
primary key (x)
) engine=InnoDB|
create procedure bug14840_1()
begin
declare err int default 0;
declare continue handler for sqlexception
set err = err + 1;
start transaction;
update t3 set x = 1, y = 42 where x = 2;
insert into t3 values (3, 4711);
if err > 0 then
rollback;
else
commit;
end if;
select * from t3;
end|
create procedure bug14840_2()
begin
declare err int default 0;
declare continue handler for sqlexception
begin
set err = err + 1;
select err as 'Ping';
end;
update t3 set x = 1, y = 42 where x = 2;
update t3 set x = 1, y = 42 where x = 2;
insert into t3 values (3, 4711);
select * from t3;
end|
insert into t3 values (1, 3), (2, 5)|
call bug14840_1()|
x y
1 3
2 5
delete from t3|
insert into t3 values (1, 3), (2, 5)|
call bug14840_2()|
Ping
1
Ping
2
x y
1 3
2 5
3 4711
drop procedure bug14840_1|
drop procedure bug14840_2|
drop table t3|
mysql-test/t/sp.test
View file @
c5475706
...
@@ -4773,6 +4773,29 @@ drop procedure bug10100pv|
...
@@ -4773,6 +4773,29 @@ drop procedure bug10100pv|
drop
procedure
bug10100pd
|
drop
procedure
bug10100pd
|
drop
procedure
bug10100pc
|
drop
procedure
bug10100pc
|
drop
view
v1
|
drop
view
v1
|
# BUG#13729: Stored procedures: packet error after exception handled
#
--
disable_warnings
drop
procedure
if
exists
bug13729
|
drop
table
if
exists
t3
|
--
enable_warnings
create
table
t3
(
s1
int
,
primary
key
(
s1
))
|
insert
into
t3
values
(
1
),(
2
)
|
create
procedure
bug13729
()
begin
declare
continue
handler
for
sqlexception
select
55
;
update
t3
set
s1
=
1
;
end
|
call
bug13729
()
|
# Used to cause Packets out of order
select
*
from
t3
|
drop
procedure
bug13729
|
drop
table
t3
|
drop
table
t3
|
...
...
mysql-test/t/sp_trans.test
View file @
c5475706
...
@@ -355,6 +355,70 @@ drop procedure bug13825_2|
...
@@ -355,6 +355,70 @@ drop procedure bug13825_2|
drop
table
t1
,
t2
|
drop
table
t1
,
t2
|
#
# BUG#14840: CONTINUE handler problem
#
--
disable_warnings
drop
table
if
exists
t3
|
drop
procedure
if
exists
bug14840_1
|
drop
procedure
if
exists
bug14840_2
|
--
enable_warnings
create
table
t3
(
x
int
,
y
int
,
primary
key
(
x
)
)
engine
=
InnoDB
|
# This used to hang the client since the insert returned with an
# error status (left over from the update) even though it succeeded,
# which caused the execution to end at that point.
create
procedure
bug14840_1
()
begin
declare
err
int
default
0
;
declare
continue
handler
for
sqlexception
set
err
=
err
+
1
;
start
transaction
;
update
t3
set
x
=
1
,
y
=
42
where
x
=
2
;
insert
into
t3
values
(
3
,
4711
);
if
err
>
0
then
rollback
;
else
commit
;
end
if
;
select
*
from
t3
;
end
|
# A simpler (non-transactional) case: insert at select should be done
create
procedure
bug14840_2
()
begin
declare
err
int
default
0
;
declare
continue
handler
for
sqlexception
begin
set
err
=
err
+
1
;
select
err
as
'Ping'
;
end
;
update
t3
set
x
=
1
,
y
=
42
where
x
=
2
;
update
t3
set
x
=
1
,
y
=
42
where
x
=
2
;
insert
into
t3
values
(
3
,
4711
);
select
*
from
t3
;
end
|
insert
into
t3
values
(
1
,
3
),
(
2
,
5
)
|
call
bug14840_1
()
|
delete
from
t3
|
insert
into
t3
values
(
1
,
3
),
(
2
,
5
)
|
call
bug14840_2
()
|
drop
procedure
bug14840_1
|
drop
procedure
bug14840_2
|
drop
table
t3
|
#
#
# BUG#NNNN: New bug synopsis
# BUG#NNNN: New bug synopsis
#
#
...
...
sql/sql_update.cc
View file @
c5475706
...
@@ -465,7 +465,12 @@ int mysql_update(THD *thd,
...
@@ -465,7 +465,12 @@ int mysql_update(THD *thd,
}
}
else
if
(
!
ignore
||
error
!=
HA_ERR_FOUND_DUPP_KEY
)
else
if
(
!
ignore
||
error
!=
HA_ERR_FOUND_DUPP_KEY
)
{
{
thd
->
fatal_error
();
// Force error message
/*
If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to
do anything; otherwise...
*/
if
(
error
!=
HA_ERR_FOUND_DUPP_KEY
)
thd
->
fatal_error
();
/* Other handler errors are fatal */
table
->
file
->
print_error
(
error
,
MYF
(
0
));
table
->
file
->
print_error
(
error
,
MYF
(
0
));
error
=
1
;
error
=
1
;
break
;
break
;
...
@@ -1259,7 +1264,12 @@ bool multi_update::send_data(List<Item> ¬_used_values)
...
@@ -1259,7 +1264,12 @@ bool multi_update::send_data(List<Item> ¬_used_values)
updated
--
;
updated
--
;
if
(
!
ignore
||
error
!=
HA_ERR_FOUND_DUPP_KEY
)
if
(
!
ignore
||
error
!=
HA_ERR_FOUND_DUPP_KEY
)
{
{
thd
->
fatal_error
();
// Force error message
/*
If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to
do anything; otherwise...
*/
if
(
error
!=
HA_ERR_FOUND_DUPP_KEY
)
thd
->
fatal_error
();
/* Other handler errors are fatal */
table
->
file
->
print_error
(
error
,
MYF
(
0
));
table
->
file
->
print_error
(
error
,
MYF
(
0
));
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
...
...
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