[ 
https://issues.apache.org/jira/browse/LUCENE-5192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13754013#comment-13754013
 ] 

Shai Erera commented on LUCENE-5192:
------------------------------------

Ahh, good catch. I didn't notice FieldNumbers is sync'd. But, I think this _if_ 
is wrong/problematic:

{noformat}
-        if (docValues != null) {
+        if (!fi.hasDocValues() && docValues != null) {
+          // First time we are seeing doc values type for
+          // this field:
{noformat}

With this fix, if somebody tries to add a field 'f' as NUMERIC and then BINARY, 
we won't catch it? This is caught today by FI.setDVType, but with this fix, 
that won't be called? Do I miss something? Perhaps you can add an 'else if' and 
compare the given type and fi.getDVType(), but that's just duplicating code 
from FI.setDVType.
                
> FieldInfos.Builder failed to catch adding field with different DV type under 
> some circumstances
> -----------------------------------------------------------------------------------------------
>
>                 Key: LUCENE-5192
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5192
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/index
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>             Fix For: 5.0, 4.5
>
>         Attachments: LUCENE-5192.patch, LUCENE-5192.patch
>
>
> I found it while working on LUCENE-5189. I'll attach a patch with a simple 
> testcase which reproduces the problem and a fix.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to