fix SphinxSE to not leave Sphinx_error status variable uninitialized

This commit is contained in:
Sergei Golubchik 2014-02-14 15:16:23 +01:00
parent fb27ce22f7
commit 64f96de766
2 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,7 @@ SET optimizer_switch=@save_optimizer_switch;
drop table ts;
show status like "sphinx_error%";
Variable_name Value
Sphinx_error OFF
Sphinx_error
show status like "sphinx_total%";
Variable_name Value
Sphinx_total 2

View File

@ -3575,11 +3575,13 @@ int sphinx_showfunc_words ( THD * thd, SHOW_VAR * out, char * sBuffer )
int sphinx_showfunc_error ( THD * thd, SHOW_VAR * out, char * )
{
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
out->type = SHOW_CHAR;
if ( pStats && pStats->m_bLastError )
{
out->type = SHOW_CHAR;
out->value = pStats->m_sLastMessage;
}
else
out->value = (char*)"";
return 0;
}