Bug #28881 Adding an INTERVAL to an EVENT let the server crash.
Submitted: 4 Jun 2007 16:36 Modified: 3 Jul 2007 17:39
Reporter: Horst Hunger Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S1 (Critical)
Version:5.1.19 OS:Linux (suse 10.1)
Assigned to: Andrey Hristov CPU Architecture:Any

[4 Jun 2007 16:36] Horst Hunger
Description:
The following test program has 3 events startting at "current_timestamp" and running. When I add an "INTERVAL 2 SECOND" to the events the server crashes with

Errors are (from /data0/mysql/mysql-5.1-build/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 112: query 'DROP USER evtest2@localhost' failed: 2013: Lost connection to MySQL server during query
(the last lines may be the most important ones)

The backtrace:

Core was generated by `/data0/mysql/mysql-5.1-build/sql/mysqld --no-defaults --console --basedir=/data'.
Program terminated with signal 11, Segmentation fault.

warning: Can't read pathname for load map: Eingabe-/Ausgabefehler.
Reading symbols from /lib/libz.so.1...done.
Loaded symbols for /lib/libz.so.1
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/libm.so.6...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
#0  0xffffe410 in __kernel_vsyscall ()
(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7f715f6 in pthread_kill () from /lib/libpthread.so.0
#2  0x0842f05b in write_core (sig=11) at stacktrace.c:229
#3  0x08275188 in handle_segfault (sig=11) at mysqld.cc:2237
#4  <signal handler called>
#5  0x0845e1f8 in Event_job_data::execute (this=0xb73ea3bc, thd=0x8a35080, drop=true)
    at event_data_objects.cc:1989
#6  0x0845d219 in Event_worker_thread::run (this=0xb73ea45f, thd=0x8a35080,
    event=0x8a09118) at event_scheduler.cc:308
#7  0x0845d330 in event_worker_thread (arg=0x8a09118) at event_scheduler.cc:258
#8  0xb7f6d34b in start_thread () from /lib/libpthread.so.0
#9  0xb7e8e65e in clone () from /lib/libc.so.6

The server also ends up with

Errors are (from /data0/mysql/mysql-5.1-build/mysql-test/var/log/mysqltest-time) :
mysqltest: At line 119: query 'select id,ev_nm,ev_cnt from event_log order by id' failed: 2006: MySQL server has gone away
(the last lines may be the most important ones)

Are there synchronization problems?

How to repeat:
put the 2 attached test programs into mysql-test(, create the result files) and execute
perl mysql-test-run.pl ev_bug7
[4 Jun 2007 18:19] Sveta Smirnova
Thank you for the report.

Verified as described.
[6 Jun 2007 17:13] Andrey Hristov
Possible duplicate of bug#28924 "If I drop the user who is the definer of an active event then server cores". Please recheck, when 28924 is pushed.
[27 Jun 2007 12:39] Andrey Hristov
Fix for bug#29156 fixes the problem
[3 Jul 2007 17:39] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.21 per comments from Andrey.