Browse Source

fixed #2170 indexer failure on joined with docid=0 and dupes at field
added regression to test 146

git-svn-id: svn://svn.sphinxsearch.com/sphinx/branches/rel22@4906 406a0c4d-033a-0410-8de8-e80135713968

tomat 11 years ago
parent
commit
041b5d7eab
3 changed files with 27 additions and 2 deletions
  1. 4 2
      src/sphinx.cpp
  2. 0 0
      test/test_146/model.bin
  3. 23 0
      test/test_146/test.xml

+ 4 - 2
src/sphinx.cpp

@@ -25818,10 +25818,12 @@ bool CSphSource_Document::IterateDocument ( CSphString & sError )
 	for ( ;; )
 	{
 		m_tState.m_dFields = NextDocument ( sError );
-		if ( HasJoinedFields() )
-			m_dAllIds.Add ( m_tDocInfo.m_uDocID );
 		if ( m_tDocInfo.m_uDocID==0 )
 			return true;
+		// moved that here as docid==0 means eof for regular query
+		// but joined might produce doc with docid==0 and breaks delta packing
+		if ( HasJoinedFields() )
+			m_dAllIds.Add ( m_tDocInfo.m_uDocID );
 
 		if ( !m_tState.m_dFields )
 			return false;

File diff suppressed because it is too large
+ 0 - 0
test/test_146/model.bin


+ 23 - 0
test/test_146/test.xml

@@ -74,6 +74,27 @@ index ignore_absent_joined_ids
 	path = <data_path/>/ignore_absent_joined_ids
 }
 
+source multi_joined
+{
+	type = mysql
+	<sql_settings/>
+	sql_attr_uint = idd
+
+	sql_query = SELECT 490495 id, 11 idd, 'Beast Obsessed 3 - Scene 12 - Future Works' t1, '' t2 UNION SELECT 490496 id, 11 idd, 'Hot Fonde Aaliyah Love Foo Her Stud Longer' t1, 'When Ryan comes into the picture' t2 UNION SELECT 490497 id, 11 idd, 'Daia Gloomer Big Noob In Prague' t1, 'Daia Gloomer Big Noob' t2
+
+	sql_joined_field = t1 from query; SELECT 0 id, 'aspirine brunette fooneling powder solo latina group salsa webcam gum idling shovel european killing too tan lines' t1 UNION SELECT 490495 id, 'job babe cow busty mugshot wire all full trip' t1 UNION SELECT 490496 id, 'hd fonde style glamour love madison ryan aaliyah' t1  UNION SELECT 490497 id, 'job salsa redhead famous shot tilt daia gloomer' t1
+	sql_joined_field = t1 from query; SELECT 490496 id, 'Aaliyah Love' t1
+}
+
+index multi_joined
+{
+	source = multi_joined
+	path = <data_path/>/multi_joined
+	
+	docinfo			= extern
+ 	charset_table		= 0..9, a..z, A..Z->a..z, _
+}
+
 </config>
 
 <db_create>
@@ -129,6 +150,8 @@ insert into test_joined (id, text) values
 	<query mode="extended2" index="test" sortmode="extended" sortby="@id asc">"do not as dog sleepy"</query>
 	<!-- regression crash on pure joined fields index indexing -->
 	<query mode="extended2" index="pure" sortmode="extended" sortby="@id asc">( dog sleepy ) | my</query>
+	<!-- regression crash on joined fields index indexing with docid==0 and dupes -->
+	<query mode="extended2" index="multi_joined" sortmode="extended" sortby="@id asc"></query>
 </queries>
 
 </test>

Some files were not shown because too many files changed in this diff