Skip to content
Permalink
Browse files

fixed #772 large packet via SphinxQL interface; added regression to t…

…est 227
  • Loading branch information...
tomatolog committed Mar 22, 2019
1 parent 57932ae commit 36df1a407dc08263690e3492518613ace82d69ca
Showing with 30 additions and 2 deletions.
  1. +3 −1 src/searchd.cpp
  2. +2 −1 test/test_227/model.bin
  3. +25 −0 test/test_227/test.xml
@@ -3001,10 +3001,12 @@ bool NetInputBuffer_c::ReadFrom ( int iLen, int iTimeout, bool bIntr, bool bAppe
if ( iLen<=0 || iLen>g_iMaxPacketSize || m_iSock<0 )
return false;

int iOff = m_pCur - m_pBuf;
Resize ( m_iLen );
Reserve ( iTail + iLen );
BYTE * pBuf = m_pData + iTail;
m_pCur = m_pBuf = pBuf;
m_pBuf = m_pData;
m_pCur = bAppend ? m_pData + iOff : m_pData;
int iGot = sphSockRead ( m_iSock, pBuf , iLen, iTimeout, bIntr );
if ( g_bGotSigterm )
{
@@ -1,7 +1,8 @@
a:1:{i:0;a:1:{i:0;a:11:{i:0;a:8:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:5:"title";}s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";i:1073741825;}s:7:"matches";a:8:{i:1;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:2;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:3;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:4;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:11;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:12;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:13;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:14;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}}s:5:"total";s:1:"8";s:11:"total_found";s:1:"8";}i:1;i:1;i:2;i:2;i:3;a:8:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:5:"title";}s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";i:1073741825;}s:7:"matches";a:8:{i:1;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:2;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:3;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:4;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:1001;i:1;i:1002;}}}i:11;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:123;s:3:"mva";a:2:{i:0;i:1011;i:1;i:1012;}}}i:12;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:13;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:14;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}}s:5:"total";s:1:"8";s:11:"total_found";s:1:"8";}i:4;a:8:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:5:"title";}s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";i:1073741825;}s:7:"matches";a:4:{i:1;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:2;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:3;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:4;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}}s:5:"total";s:1:"4";s:11:"total_found";s:1:"4";}i:5;s:22:"connections | 8
a:1:{i:0;a:1:{i:0;a:13:{i:0;a:8:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:5:"title";}s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";i:1073741825;}s:7:"matches";a:8:{i:1;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:2;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:3;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:4;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:11;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:12;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:13;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:14;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}}s:5:"total";s:1:"8";s:11:"total_found";s:1:"8";}i:1;i:1;i:2;i:2;i:3;a:8:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:5:"title";}s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";i:1073741825;}s:7:"matches";a:8:{i:1;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:2;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:3;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:4;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:1001;i:1;i:1002;}}}i:11;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:123;s:3:"mva";a:2:{i:0;i:1011;i:1;i:1012;}}}i:12;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:13;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:14;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}}s:5:"total";s:1:"8";s:11:"total_found";s:1:"8";}i:4;a:8:{s:5:"error";s:0:"";s:7:"warning";s:0:"";s:6:"status";i:0;s:6:"fields";a:1:{i:0;s:5:"title";}s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";i:1073741825;}s:7:"matches";a:4:{i:1;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:2;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:1;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:3;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}i:4;a:2:{s:6:"weight";s:1:"1";s:5:"attrs";a:2:{s:8:"group_id";i:2;s:3:"mva";a:2:{i:0;i:10;i:1;i:11;}}}}s:5:"total";s:1:"4";s:11:"total_found";s:1:"4";}i:5;s:22:"connections | 8
1 rows";i:6;s:25:"command_status | 2
1 rows";i:7;s:18:"queries | 3
1 rows";i:8;s:22:"connections | 9
1 rows";i:9;s:25:"command_status | 5
1 rows";i:10;s:18:"queries | 3
1 rows";i:11;s:2:"OK";i:12;s:43:"1 | 0 | 0 | 1553088425 | 0.000000 |
1 rows";}}}
@@ -118,6 +118,22 @@ index rt
rt_field = title
rt_attr_uint = gid
}

index rt1
{
type = rt
path = <data_path/>/rt1
docinfo = extern
rt_mem_limit = 128M
rt_field = title
rt_field = content
rt_field = gidkey
rt_attr_uint = gid
rt_attr_float = price
rt_attr_bigint = big
rt_attr_timestamp = createdon
rt_attr_multi = categories
}
</agent0>
</config>

@@ -164,6 +180,15 @@ $results[] = $ql->Query ( "SHOW STATUS LIKE 'connections'" );
$results[] = $ql->Query ( "SHOW STATUS LIKE 'command_status'" );
$results[] = $ql->Query ( "SHOW STATUS LIKE 'queries'" );
// regression large packet via SphinxQL
$icontent = "";
for ( $i=0; $i<8389004; $i++ )
$icontent .= "sc";
$iquery = "REPLACE INTO rt1 (id, title, content, gid, price, big, categories, createdon, gidkey) VALUES (1, 'Title1', '" . $icontent . "', 0, 0, 0, (), 1553088425, '0Key')";
$results[] = $ql->Query ( $iquery );
$results[] = $ql->Query ( "SELECT * FROM rt1" );
]]></custom_test>

<db_create>

0 comments on commit 36df1a4

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