lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Timm <tim...@aol.com>
Subject DataImportHandler
Date Mon, 08 Feb 2010 20:31:47 GMT
It looks like the dataimporter.functions.escapeSql(String) function 
escapes quotes, but fails to escape '\' characters which are problematic 
especially when the field value ends in a \.  Also, on failure, I get an 
alarming notice of a possible resource leak.  I couldn't find Jira 
issues for either.

-Sean

(field names and data below have been sanitized)

config query line:
query="SELECT SUM(fielda) AS A, SUM(fieldb) AS B FROM tablea where 
fieldc='${dataimporter.functions.escapeSql(outer_entity.fieldc)}'"

SEVERE: Full Import failed
org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to 
execute query: SELECT SUM(fielda) AS A, SUM(fieldb) AS B FROM tablea 
where fieldc='somedata\' Processing Document # 1587
        at 
org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:72)
        at 
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:253)
        at 
org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:210)
        at 
org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:39)
        at 
org.apache.solr.handler.dataimport.SqlEntityProcessor.initQuery(SqlEntityProcessor.java:58)
        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)
        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: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have 
an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near ''somedata\'' at 
line 1
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:3277)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:3206)
        at com.mysql.jdbc.Statement.execute(Statement.java:727)
        at 
org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:246)
        ... 12 more
Feb 8, 2010 3:22:51 PM org.apache.solr.update.DirectUpdateHandler2 rollback
INFO: start rollback
Feb 8, 2010 3:22:51 PM org.apache.solr.update.DirectUpdateHandler2 rollback
INFO: end_rollback
Feb 8, 2010 3:22:53 PM org.apache.solr.update.SolrIndexWriter finalize
SEVERE: SolrIndexWriter was not closed prior to finalize(), indicates a 
bug -- POSSIBLE RESOURCE LEAK!!!



Mime
View raw message