[
https://issues.apache.org/jira/browse/SOLR-8770?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15187625#comment-15187625
]
Shawn Heisey commented on SOLR-8770:
------------------------------------
I've gone digging into the code a little bit. I don't entirely understand what
I'm looking at.
For the binary writer, I cannot see anything that delves into the individual
fields of a document, so there's nowhere to add a null check. The code (in
JavaBinUpdateRequestCodec) appears to use an iterator to add documents to a
NamedList.
The code in ClientUtils#writeVal seems to indicate that there might be
legitimate uses for a null object, as there are certain situations where a null
will be added to the XML. I would need to understand other areas of the code
to know what's going on there.
If there are indeed legitimate uses for a null object in SolrInputDocument
field, then it will not be possible to throw IAE in SolrInputDocument.
> BinaryRequestWriter interprets null object in field as literal "NULL" string
> ----------------------------------------------------------------------------
>
> Key: SOLR-8770
> URL: https://issues.apache.org/jira/browse/SOLR-8770
> Project: Solr
> Issue Type: Bug
> Components: clients - java
> Affects Versions: 5.5
> Reporter: Shawn Heisey
>
> From what I've been able to determine, if a null object is added with
> SolrInputDocument#addField, the xml writer does not include that field in the
> request, but the binary writer sends the literal string "NULL".
> This became apparent when upgrading SolrJ to 5.5, which uses the binary
> writer by default. Switching back to 5.4.1 fixed it, until I forced the
> 5.4.1 client to use the binary writer. My source data is MySQL. JDBC is
> where the null objects are coming from.
> Adding a null check to my doc.addField call has fixed my program with the 5.5
> client, but this is likely to catch other upgrading users off guard.
> At the very least, the 5.5.1 CHANGES.txt file needs a note, but I believe the
> behavior of the binary writer should match the behavior of the xml writer.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]