Fixed segments SQL queries for PostgreSQL compatibility

This commit is contained in:
Tugdual Saunier 2014-03-06 14:53:54 +00:00
parent 6137c374a7
commit ae38c92491
1 changed files with 3 additions and 3 deletions

View File

@ -90,7 +90,7 @@ public class IndexerDBCoordinator
final ResultIterator<Map<String, Object>> dbSegments = final ResultIterator<Map<String, Object>> dbSegments =
handle.createQuery( handle.createQuery(
String.format( String.format(
"SELECT payload FROM %s WHERE used = 1 AND dataSource = :dataSource", "SELECT payload FROM %s WHERE used = true AND dataSource = :dataSource",
dbTables.getSegmentsTable() dbTables.getSegmentsTable()
) )
) )
@ -304,8 +304,8 @@ public class IndexerDBCoordinator
return handle.createQuery( return handle.createQuery(
String.format( String.format(
DbConnector.isPostgreSQL(handle)? DbConnector.isPostgreSQL(handle)?
"SELECT payload FROM %s WHERE dataSource = :dataSource and start >= :start and \"end\" <= :end and used = 0": "SELECT payload FROM %s WHERE dataSource = :dataSource and start >= :start and \"end\" <= :end and used = false":
"SELECT payload FROM %s WHERE dataSource = :dataSource and start >= :start and end <= :end and used = 0", "SELECT payload FROM %s WHERE dataSource = :dataSource and start >= :start and end <= :end and used = false",
dbTables.getSegmentsTable() dbTables.getSegmentsTable()
) )
) )