From: Roy Lyseng Date: May 27 2011 2:21pm Subject: Re: bzr commit into mysql-trunk branch (gleb.shchepa:3358) WL#4897 List-Archive: http://lists.mysql.com/commits/138341 Message-Id: <4DDFB34C.1030303@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Guilhem, Gleb, A couple of comments on Guilhem's comments first. >> + This method: >> + a) allocates a select_send object (if no one pre-allocated available), >> + b) calculates and sends whole EXPLAIN data. >> + >> + @returns >> + @retval FALSE Ok >> + @retval TRUE Error > > GB39 nowadays the coding style allows true/false too, it's up to you. My preferred Doxygen documentation for return values is @return false if successful, true if error This is so common, and saves two lines without loss of information. > > GB75 this code above resembles what is done in execute_sqlcom_select() (if > lex->describe is true), which is: > > thd->send_explain_fields(result); > res= mysql_explain_union(thd, &thd->lex->unit, result); > ... > if (res) > result->abort_result_set(); > else > result->send_eof(); > Can we make execute_sqlcom_select() call explain_data_modification(), to > avoid duplication? > The creation of the warning (of EXPLAIN EXTENDED) can also move into > explain_data_modification(). If this is done, explain_data_modification() must be renamed as a SELECT is not a data modification. My suggestion in that case would be explain_query_specification() (Query specification is the term used in the SQL standard for a SELECT block). Thank, Roy