Permalink
Browse files

fixed #217 result set schema issues for index with multiple attribute…

…s and queries to multiple indexes; added regressions to test 355
  • Loading branch information...
tomatolog committed Apr 23, 2018
1 parent 80542fa commit b0ba932fff4a082f642cb737381c8a70215d4cc9
Showing with 227 additions and 2 deletions.
  1. +25 −0 src/sphinx.cpp
  2. +2 −2 src/sphinx.h
  3. +1 −0 test/test_355/model.bin
  4. +199 −0 test/test_355/test.xml
@@ -6156,11 +6156,36 @@ CSphSchema & CSphSchema::operator = ( CSphSchema && rhs )
m_dAttrs = std::move ( rhs.m_dAttrs );
m_dStaticUsed = std::move ( rhs.m_dStaticUsed );
m_dDynamicUsed = std::move ( rhs.m_dDynamicUsed );
RebuildHash();
}
return *this;
}
CSphSchema & CSphSchema::operator = ( const CSphSchema & rhs )
{
if ( this!=&rhs )
{
m_dDataPtrAttrs = rhs.m_dDataPtrAttrs;
m_iFirstFieldLenAttr = rhs.m_iFirstFieldLenAttr;
m_iLastFieldLenAttr = rhs.m_iLastFieldLenAttr;
m_sName = rhs.m_sName;
m_dFields = rhs.m_dFields;
m_dAttrs = rhs.m_dAttrs;
m_dStaticUsed = rhs.m_dStaticUsed;
m_dDynamicUsed = rhs.m_dDynamicUsed;
RebuildHash();
}
return *this;
}
CSphSchema::CSphSchema ( const CSphSchema & rhs )
{
*this = rhs;
}
const char * CSphSchema::GetName() const
{
@@ -1595,11 +1595,11 @@ class CSphSchema : public CSphSchemaHelper
public:
/// ctor
explicit CSphSchema ( const char * sName="(nameless)" );
CSphSchema ( const CSphSchema & ) = default;
CSphSchema ( const CSphSchema & rhs );
~CSphSchema(){}
CSphSchema & operator = ( const ISphSchema & rhs );
CSphSchema & operator = ( const CSphSchema & rhs ) = default;
CSphSchema & operator = ( const CSphSchema & rhs );
CSphSchema & operator = ( CSphSchema && rhs );
/// visitor-style uber-virtual assignment implementation

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,199 @@
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>attr hash at schema</name>
<skip_indexer/>
<config>
indexer
{
mem_limit = 16M
}
searchd
{
<searchd_settings/>
}
index rt1
{
type = rt
path = <data_path/>/rt1
rt_field = title1
rt_attr_uint = int1
rt_attr_uint = int2
rt_attr_uint = int3
rt_attr_uint = int4
rt_attr_uint = int5
rt_attr_uint = int6
rt_attr_uint = int7
rt_attr_uint = int8
rt_attr_uint = int9
}
index rt2:rt1
{
path = <data_path/>/rt2
}
index rt3:rt1
{
path = <data_path/>/rt3
}
index rt4:rt1
{
path = <data_path/>/rt4
}
index rt5:rt1
{
path = <data_path/>/rt5
}
index rt6:rt1
{
path = <data_path/>/rt6
}
index rt7:rt1
{
path = <data_path/>/rt7
}
index rt8:rt1
{
path = <data_path/>/rt8
}
index rt9:rt1
{
path = <data_path/>/rt9
}
index rtdist
{
type = distributed
local = rt1
local = rt2
local = rt3
local = rt4
local = rt5
local = rt6
local = rt7
local = rt8
local = rt9
}
index art1
{
type =rt
path = <data_path/>/art1
rt_field = title1
rt_attr_uint = int1
rt_attr_uint = int2
rt_attr_uint = int3
rt_attr_uint = int4
rt_attr_uint = int5
rt_attr_uint = int6
rt_attr_uint = int7
rt_attr_uint = int8
rt_attr_uint = int9
rt_attr_uint = int10
rt_attr_uint = int11
rt_attr_uint = int12
rt_attr_uint = int13
rt_attr_uint = int14
rt_attr_uint = int15
rt_attr_uint = int16
rt_attr_uint = int17
rt_attr_uint = int18
rt_attr_uint = int19
rt_attr_uint = int20
rt_attr_uint = int21
rt_attr_uint = int22
rt_attr_uint = int23
rt_attr_uint = int24
rt_attr_uint = int25
rt_attr_uint = int26
rt_attr_uint = int27
rt_attr_uint = int28
rt_attr_uint = int29
rt_attr_uint = int30
rt_attr_uint = int31
rt_attr_uint = int32
}
index art2:art1
{
path = <data_path/>/art2
}
index art3:art1
{
path = <data_path/>/art3
}
index art4:art1
{
path = <data_path/>/art4
}
index art5:art1
{
path = <data_path/>/art5
}
index art6:art1
{
path = <data_path/>/art6
}
index art7:art1
{
path = <data_path/>/art7
}
index art8:art1
{
path = <data_path/>/art8
}
index art9:art1
{
path = <data_path/>/art9
}
index artdist
{
type = distributed
local = art1
local = art2
local = art3
local = art4
local = art5
local = art6
local = art7
local = art8
local = art9
}
</config>
<sphqueries>
<sphinxql>insert into rt1 values(1,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt2 values(2,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt3 values(3,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt4 values(4,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt5 values(5,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt6 values(6,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt7 values(7,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt8 values(8,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into rt9 values(9,'find me',1,1,1,1,1,1,1,1,1)</sphinxql>
<sphinxql>insert into art1 values(1,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art2 values(2,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art3 values(3,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art4 values(4,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art5 values(5,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art6 values(6,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art7 values(7,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art8 values(8,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<sphinxql>insert into art9 values(9,'find me',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)</sphinxql>
<!-- bad cases -->
<sphinxql>select * from art1,art2,art3,art4,art5,art6,art7,art8</sphinxql>
<sphinxql>select * from art1,art2,art3,art4,art5,art6,art7,art8,art9</sphinxql>
<sphinxql>select * from artdist</sphinxql>
<sphinxql>select *,1 as a1,1 as a2,1 as a3,1 as a4,1 as a5,1 as a6, 1 as a7,1 as a8,1 as a9,1 as a10,1 as a11,1 as a12,1 as a13,1 as a14,1 as a15,1 as a16,1 as a17,1 as a18,1 as a19,1 as a20,1 as a21,1 as a22,1 as a23 from rt1,rt2,rt3,rt4,rt5,rt6,rt7,rt8</sphinxql>
<sphinxql>select *,1 as a1,1 as a2,1 as a3,1 as a4,1 as a5,1 as a6, 1 as a7,1 as a8,1 as a9,1 as a10,1 as a11,1 as a12,1 as a13,1 as a14,1 as a15,1 as a16,1 as a17,1 as a18,1 as a19,1 as a20,1 as a21,1 as a22,1 as a23 from rt1,rt2,rt3,rt4,rt5,rt6,rt7,rt8,rt9</sphinxql>
<sphinxql>select *,1 as a1,1 as a2,1 as a3,1 as a4,1 as a5,1 as a6, 1 as a7,1 as a8,1 as a9,1 as a10,1 as a11,1 as a12,1 as a13,1 as a14,1 as a15,1 as a16,1 as a17,1 as a18,1 as a19,1 as a20,1 as a21,1 as a22,1 as a23 from rtdist</sphinxql>
<sphinxql>select *,1 as a1,1 as a2,1 as a3,1 as a4,1 as a5,1 as a6, 1 as a7,1 as a8,1 as a9,1 as a10,1 as a11,1 as a12,1 as a13,1 as a14,1 as a15,1 as a16,1 as a17,1 as a18,1 as a19,1 as a20,1 as a21,1 as a22,1 as a23 from artdist</sphinxql>
</sphqueries>
</test>

0 comments on commit b0ba932

Please sign in to comment.