Commit a5450538 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/usr/local/bk/mysql-5.0

into  mysql.com:/usr/home/pem/bug13729/mysql-5.0

parents f8aae3e6 c91a2e9e
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -3868,5 +3868,22 @@ drop procedure bug10100pv|
drop procedure bug10100pd|
drop procedure bug10100pc|
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 t1,t2;
+56 −0
Original line number Diff line number Diff line
@@ -369,3 +369,59 @@ drop procedure bug13825_0|
drop procedure bug13825_1|
drop procedure bug13825_2|
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|
+25 −0
Original line number Diff line number Diff line
@@ -4773,6 +4773,31 @@ drop procedure bug10100pv|
drop procedure bug10100pd|
drop procedure bug10100pc|
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|


+64 −0
Original line number Diff line number Diff line
@@ -355,6 +355,70 @@ drop procedure bug13825_2|
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
#
+4 −1
Original line number Diff line number Diff line
@@ -1589,6 +1589,7 @@ void end_thread(THD *thd, bool put_in_cache)
      wake_thread--;
      thd=thread_cache.get();
      thd->real_id=pthread_self();
      thd->thread_stack= (char *) &thd;
      (void) thd->store_globals();
      thd->thr_create_time= time(NULL);
      threads.append(thd);
@@ -6912,8 +6913,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
  case OPT_MYISAM_STATS_METHOD:
  {
    ulong method_conv;
    myisam_stats_method_str= argument;
    int method;
    LINT_INIT(method_conv);

    myisam_stats_method_str= argument;
    if ((method=find_type(argument, &myisam_stats_method_typelib, 2)) <= 0)
    {
      fprintf(stderr, "Invalid value of myisam_stats_method: %s.\n", argument);
Loading