From c6c194dddbb5a3a473c9195e23aec12505dd6146 Mon Sep 17 00:00:00 2001 From: Stefan Neuhaus Date: Sat, 29 Jul 2017 19:49:32 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20save=5Fproperties=20on=20Postgres=20?= =?UTF-8?q?=E2=80=9CCALL=20save=5Fproperty(.)=E2=80=9D=20does=20not=20work?= =?UTF-8?q?=20(tested=20with=20Postgres=209.6):=20SQL=20Error=20[42601]:?= =?UTF-8?q?=20ERROR:=20syntax=20error=20at=20or=20near=20"CALL"=20=20=20Po?= =?UTF-8?q?sition:=201=20=20=20org.postgresql.util.PSQLException:=20ERROR:?= =?UTF-8?q?=20syntax=20error=20at=20or=20near=20"CALL"=20=20=20Position:?= =?UTF-8?q?=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/owasp/dependencycheck/data/nvdcve/CveDB.java | 2 +- .../main/resources/data/dbStatements_postgresql.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java index 093a7a761..c4b08cde3 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/data/nvdcve/CveDB.java @@ -512,7 +512,7 @@ public final class CveDB implements AutoCloseable { if (mergeProperty != null) { mergeProperty.setString(1, key); mergeProperty.setString(2, value); - mergeProperty.executeUpdate(); + mergeProperty.execute(); } else { // No Merge statement, so doing an Update/Insert... final PreparedStatement updateProperty = getPreparedStatement(UPDATE_PROPERTY); diff --git a/dependency-check-core/src/main/resources/data/dbStatements_postgresql.properties b/dependency-check-core/src/main/resources/data/dbStatements_postgresql.properties index 72f3fff08..15c33956e 100644 --- a/dependency-check-core/src/main/resources/data/dbStatements_postgresql.properties +++ b/dependency-check-core/src/main/resources/data/dbStatements_postgresql.properties @@ -12,5 +12,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -MERGE_PROPERTY=CALL save_property(?, ?) -CLEANUP_ORPHANS=DELETE FROM cpeEntry WHERE id IN (SELECT id FROM cpeEntry LEFT JOIN software ON cpeEntry.id = software.CPEEntryId WHERE software.CPEEntryId IS NULL); \ No newline at end of file +MERGE_PROPERTY=SELECT save_property(?, ?) +CLEANUP_ORPHANS=DELETE FROM cpeEntry WHERE id IN (SELECT id FROM cpeEntry LEFT JOIN software ON cpeEntry.id = software.CPEEntryId WHERE software.CPEEntryId IS NULL);