Bug #24971 Stored procedures: mysqld displays warning message
Submitted: 11 Dec 2006 20:07 Modified: 29 Jun 2007 0:18
Reporter: Peter Gulutzan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version:5.1.13-falcon-alpha-debug/5.1BK OS:Linux (SUSE 10.0 / 64-bit)
Assigned to: Konstantin Osipov CPU Architecture:Any

[11 Dec 2006 20:07] Peter Gulutzan
Description:
I have a few events which call a stored procedure which dynamically kills.

I occasionally, among all the Scheduler notes, this warning on mysqld screen:

061211 12:57:11 [ERROR] SCHEDULER: [`root@localhost`][`d2`.`e2`] Failed to load routine d2.p. The table mysql.proc is missing, corrupt, or contains bad data (internal code -2)]

I only mention this because I thought the message is interesting.
If it doesn't interest the person it's assigned to, then he/she
should feel free to declare it "not a bug" immediately.

How to repeat:
At the time that I started this, mysql.proc was empty and mysql.event was empty.

delimiter //
set @@autocommit=0//
create table t (s1 int, s2 blob, key(s1)) engine=innodb//
create procedure p ()
begin
  declare v int;
  declare continue handler for sqlexception begin end;
  select id into v
  from information_schema.processlist
  where info not like '%select%' or info is null
  limit 1;
  select v;
  set @v = concat('kill ',v);
  prepare stmt1 from @v;
  execute stmt1;
  insert into t values (v,repeat('a',1000));
  update t set s1 = s1 + 1;
  commit;
  end//
create event e1 on schedule every 1 second do call p()//
create event e2 on schedule every 1 second do call p()//
create event e3 on schedule every 1 second do call p()//
set global event_scheduler = 1//

Now examine messages on mysqld.
[11 Dec 2006 20:33] Andrey Hristov
-2 is SP_OPEN_TABLE_FAILED error of SP. The table was gone for a moment? Is it related to 21414? Peter, is it only in a falcon tree or you get in a non-Falcon tree?
[11 Dec 2006 20:52] Peter Gulutzan
It also happens with 5.1.15-beta-debug.
[12 Dec 2006 1:25] MySQL Verification Team
Thank you for the bug report. Verified on Suse 10 32-bit on 5.1BK:

061211 23:25:37 [Note] SCHEDULER: [test.e2 of root@localhost] executing in thread 85. Execution 28
061211 23:25:37 [Note] SCHEDULER: [test.e3 of root@localhost] executing in thread 86. Execution 28
061211 23:25:37 [ERROR] SCHEDULER: [`root@localhost`][`test`.`e3`] Failed to load routine test.p. The table mysql.proc is missing, corrupt, or contains bad data (internal code -2)]
[29 May 2007 10:16] Andrei Elkin
Two bugs Bug#27563, Bug#27565 are possibly related.
[29 May 2007 10:18] Andrei Elkin
Please keep in mind 'KILL' and stored functions are a participant in those two as well.
[29 Jun 2007 0:18] Konstantin Osipov
Can't repeat it any more.
Likely was related to Bug#27563.
Since it's impossible to test error output of mysqld in the test suite currently, and this error output was the only manifestation, closing the bug.
Thank you for your bug report.
Leaving the test to run for the night.