# HG changeset patch # User Sascha L. Teichmann # Date 1302124378 0 # Node ID 61b7041204a7e3506b74a173216a3cbfd9b6931d # Parent 23ec48ce717e689bf0e36ad89f34b0eb239a6d8e Fix for flys/issue8 (part 2) artifacts/trunk@1651 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 23ec48ce717e -r 61b7041204a7 ChangeLog --- a/ChangeLog Wed Apr 06 16:49:14 2011 +0000 +++ b/ChangeLog Wed Apr 06 21:12:58 2011 +0000 @@ -1,11 +1,19 @@ -2011-04-04 Sascha L. Teichmann - - Possible fix for flys/issue8 - - * artifact-database/src/main/java/de/intevation/artifactdatabase/StringUtils.java: - (repeat) The term was repeated one time too often leading to invalid - SQL statements in database cleaner. I really should start writing - unit tests. +2011-04-06 Sascha L. Teichmann + + Fix for flys/issue8 (part 2) + + * artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java: + PostgreSQL does not like clauses like 'NOT IN ()' so write + 'NOT IN (NULL)' in these cases. + +2011-04-06 Sascha L. Teichmann + + Possible fix for flys/issue8 + + * artifact-database/src/main/java/de/intevation/artifactdatabase/StringUtils.java: + (repeat) The term was repeated one time too often leading to invalid + SQL statements in database cleaner. I really should start writing + unit tests. 2011-04-06 Ingo Weinzierl diff -r 23ec48ce717e -r 61b7041204a7 artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java Wed Apr 06 16:49:14 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DatabaseCleaner.java Wed Apr 06 21:12:58 2011 +0000 @@ -236,7 +236,9 @@ ? lockedIdsProvider.getLockedIds() : EMPTY_IDS; - String questionMarks = StringUtils.repeat('?', lockedIds.size(), ','); + String questionMarks = lockedIds.isEmpty() + ? "NULL" + : StringUtils.repeat('?', lockedIds.size(), ','); try { connection = dataSource.getConnection();