Skip to content
Permalink
Browse files

fixed #690 crash of daemon on match mode all and empty full text quer…

…y; added regression to gtest
  • Loading branch information...
tomatolog committed Feb 26, 2019
1 parent daa88b5 commit 84fe7405d17b59f4dcde15a6c8e8503923503def
Showing with 10 additions and 1 deletion.
  1. +9 −0 src/gtests_searchd.cpp
  2. +1 −1 src/searchd.cpp
@@ -251,4 +251,13 @@ TEST ( searchd_stuff, iovec_behaviour )
ASSERT_EQ ( tIO.IOSize (), 1 );
tIO.StepForward (4);
ASSERT_EQ ( tIO.IOSize (), 0 );
}

TEST ( searchd_stuff, prepare_emulation )
{
CSphQuery tQuery;
tQuery.m_eMode = SPH_MATCH_ALL;
PrepareQueryEmulation ( &tQuery );

ASSERT_EQ ( tQuery.m_eRanker, SPH_RANK_PROXIMITY );
}
@@ -3756,7 +3756,7 @@ void PrepareQueryEmulation ( CSphQuery * pQuery )
return;

const char * szQuery = pQuery->m_sRawQuery.cstr ();
int iQueryLen = strlen(szQuery);
int iQueryLen = ( szQuery ? strlen(szQuery) : 0 );

pQuery->m_sQuery.Reserve ( iQueryLen*2+8 );
char * szRes = (char*) pQuery->m_sQuery.cstr ();

0 comments on commit 84fe740

Please sign in to comment.
You can’t perform that action at this time.