From: Zardosht Kasheff Date: September 29 2009 2:41pm Subject: can show engine status ever return an error? List-Archive: http://lists.mysql.com/internals/37333 Message-Id: <2f9663ba0909290741t700716bbjb6e0ff8204ada219@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Hello all, While implementing our storage engine's version of show engine status, I noticed that if the handlerton function show_status ever returns an error, this causes a crash in a debug build of mysqld, in protocol.cc line 416, in the following code: case Diagnostics_area::DA_EMPTY: default: DBUG_ASSERT(0); The reason is that the variable thd->main_da.status() is not set when this function is called. In the function ha_show_status, in handler.cc, I see the following code to end the function: if (!result) my_eof(thd); return result; } So, if the handlerton's show_status function successfully returns, my_eof(thd) is called, and the assert is not hit in protocol.cc. However, if show_status returns an error, then nothing is called here, causing the assert. That being said, what is the expected behavior here? Is the assumption that show_status can never return an error (and if so, then shouldn't show_status be a void function and not return a bool)? Is there something simple and safe that can be done that allows show_status to return an error in some cases, but not causing a crash? Perhaps: if (!result) my_eof(thd); else something_else; return result; } Thanks -Zardosht