From 7e2bb179e33d83bc0ce785c9793988466b473fa0 Mon Sep 17 00:00:00 2001 From: Manuel Soulier Date: Mon, 7 Aug 2023 09:59:54 +0200 Subject: [PATCH] fix for the WHERE conditions containing OR in loading rules --- .../arc/core/service/engine/chargeur/ChargeurCSV.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arc-core/src/main/java/fr/insee/arc/core/service/engine/chargeur/ChargeurCSV.java b/arc-core/src/main/java/fr/insee/arc/core/service/engine/chargeur/ChargeurCSV.java index f4e72a368..3046575d8 100644 --- a/arc-core/src/main/java/fr/insee/arc/core/service/engine/chargeur/ChargeurCSV.java +++ b/arc-core/src/main/java/fr/insee/arc/core/service/engine/chargeur/ChargeurCSV.java @@ -267,8 +267,7 @@ private void applyFormat() throws ArcException { joinTable.get(i).contains(".") ? joinTable.get(i) : this.env + "." + joinTable.get(i)); // récupération des colonnes de la table - List colsIn = new ArrayList(); - colsIn = UtilitaireDao.get(0) + List colsIn = UtilitaireDao.get(0) .executeRequest(this.connexion, new ArcPreparedStatementBuilder( "select " + joinSelect.get(i) + " from " + joinTable.get(i) + " limit 0")) @@ -346,7 +345,7 @@ private void applyFormat() throws ArcException { req.append("\n FROM " + this.tableTempA + " u ) v ) w "); req.append("\n WHERE false "); for (String s : wheres) { - req.append("\n AND " + s); + req.append("\n AND (" + s + ")"); } req.append(";"); UtilitaireDao.get(0).executeImmediate(connexion, req); @@ -408,7 +407,7 @@ private void applyFormat() throws ArcException { req.append("\n ) v ) w "); req.append("\n WHERE true "); for (String s : wheres) { - req.append("\n AND " + s); + req.append("\n AND (" + s +")"); } req.append(";"); UtilitaireDao.get(0).executeImmediate(connexion, req);