Bug #41127 Maria: assertion when SHOW ENGINE MARIA LOGS and missing logs
Submitted: 29 Nov 2008 22:09 Modified: 8 Jan 2009 10:45
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Maria storage engine Severity:S3 (Non-critical)
Version:5.1-maria OS:Linux
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[29 Nov 2008 22:09] Guilhem Bichot
Description:
Probably exists in 6.0-maria but have not checked.
Start mysqld with:

./mtr --mem alias --start-and-exit --gdb

Then in another window do "rm" of var/master-data/maria_log.00000001 .
Now do "show engine maria logs" in a client:

mysqld: sql_class.cc:462: void Diagnostics_area::set_eof_status(THD*): Assertion `! is_set()' failed.
(gdb) bt
#0  0xb7fdf410 in ?? ()
#1  0xb6a99178 in ?? ()
#2  0x00000006 in ?? ()
#3  0xb7e1c801 in abort () from /lib/libc.so.6
#4  0xb7e147bb in __assert_fail () from /lib/libc.so.6
#5  0x082774d6 in Diagnostics_area::set_eof_status (this=0x92da6a8, 
    thd=0x92d98b0) at sql_class.cc:462
#6  0x081bc51e in my_eof (thd=0x92d98b0) at sql_class.h:2259
#7  0x083b9508 in ha_show_status (thd=0x92d98b0, db_type=0x92c7d80, 
    stat=HA_ENGINE_LOGS) at handler.cc:4370
#8  0x082a7794 in mysql_execute_command (thd=0x92d98b0) at sql_parse.cc:3336
#9  0x082acd23 in mysql_parse (thd=0x92d98b0, 
    inBuf=0x932abf8 "show engine maria logs", length=22, 
    found_semicolon=0xb6a9a27c) at sql_parse.cc:5811
#10 0x082ad8a0 in dispatch_command (command=COM_QUERY, thd=0x92d98b0, 
    packet=0x930c391 "", packet_length=22) at sql_parse.cc:1208

Explanation: maria_show_status() calls my_stat() with MY_WME. As log file is missing, and as MY_WME is used, my_error() is called, which calls my_message_sql, which registers an error to be sent to the client. Then maria_show_status() returns 0 (which means "ok") and so ha_show_status() decides to send an ok (my_eof()). And it's forbidden to send ok after registering an error.
I guess that my_stat() should be called without MY_WME.

How to repeat:
see description.
[15 Dec 2008 10:08] Bugs System
Pushed into 6.0.9-alpha  (revid:sanja@sun.com-20081201132137-bhzw81wcbe7lxb2n) (version source revid:guilhem@mysql.com-20081213204800-0nubni3t4ihn4hv9) (pib:5)
[8 Jan 2009 10:45] MC Brown
Test case failure. No documentation needed.