lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Dyer (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SOLR-2141) NullPointerException when using escapeSql function
Date Tue, 27 Nov 2012 16:09:59 GMT

     [ https://issues.apache.org/jira/browse/SOLR-2141?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Dyer updated SOLR-2141:
-----------------------------

    Attachment: SOLR-2141.patch

final patch to commit, fixes a locale problem in the unit test.

Dominik, this patch solves the absence of the dih.functions. namespace, so you can use either
"dih." or "dataimport." as before.  Also, it solves the related problem on SOLR-3842.  Finally
it has a pretty good unit test that demonstrates this issue, SOLR-3842 and SOLR-4047 (this
last one doesn't appear to actually be broken).
                
> NullPointerException when using escapeSql function
> --------------------------------------------------
>
>                 Key: SOLR-2141
>                 URL: https://issues.apache.org/jira/browse/SOLR-2141
>             Project: Solr
>          Issue Type: Bug
>          Components: contrib - DataImportHandler
>    Affects Versions: 1.4.1, 4.0
>         Environment: openjdk 1.6.0 b12
>            Reporter: Edward Rudd
>            Assignee: James Dyer
>             Fix For: 4.1, 5.0
>
>         Attachments: dih-config.xml, dih-file.xml, SOLR-2141.b341f5b.patch, SOLR-2141.patch,
SOLR-2141.patch, SOLR-2141.patch, SOLR-2141.patch, SOLR-2141.patch, SOLR-2141.patch, SOLR-2141-sample.patch,
SOLR-2141-test.patch
>
>
> I have two entities defined, nested in each other..
> <entity name="article" query="select category, subcategory from articles">
>    <entity name="other" query="select other from othertable where category='${dataimporter.functions.escapeSql(article.category)}'
>               AND subcategory='${dataimporter.functions.escapeSql(article.subcategory)}'">
 
>    </entity>
> </entity>
> Now, when I run that it bombs on any article where subcategory = '' (it's a NOT NULL
column so empty string is there)  If i do where subcategory!='' in the article query it works
fine (aside from not pulling in all of the articles).
> org.apache.solr.handler.dataimport.DataImportHandlerException: java.lang.NullPointerException
>         at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:424)
>         at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:383)
>         at org.apache.solr.handler.dataimport.DocBuilder.doFullDump(DocBuilder.java:242)
>         at org.apache.solr.handler.dataimport.DocBuilder.execute(DocBuilder.java:180)
>         at org.apache.solr.handler.dataimport.DataImporter.doFullImport(DataImporter.java:331)
>         at org.apache.solr.handler.dataimport.DataImporter.runCmd(DataImporter.java:389)
>         at org.apache.solr.handler.dataimport.DataImporter$1.run(DataImporter.java:370)
> Caused by: java.lang.NullPointerException
>         at org.apache.solr.handler.dataimport.EvaluatorBag$1.evaluate(EvaluatorBag.java:75)
>         at org.apache.solr.handler.dataimport.EvaluatorBag$5.get(EvaluatorBag.java:216)
>         at org.apache.solr.handler.dataimport.EvaluatorBag$5.get(EvaluatorBag.java:204)
>         at org.apache.solr.handler.dataimport.VariableResolverImpl.resolve(VariableResolverImpl.java:107)
>         at org.apache.solr.handler.dataimport.TemplateString.fillTokens(TemplateString.java:81)
>         at org.apache.solr.handler.dataimport.TemplateString.replaceTokens(TemplateString.java:75)
>         at org.apache.solr.handler.dataimport.VariableResolverImpl.replaceTokens(VariableResolverImpl.java:87)
>         at org.apache.solr.handler.dataimport.SqlEntityProcessor.nextRow(SqlEntityProcessor.java:71)
>         at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:237)
>         at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:357)
>         ... 6 more

--
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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message