Commit fbe3cfdd authored by gmantele's avatar gmantele
Browse files

ADQL: Fix big bug: no parenthesis in the SQL translation for ADQL constraints...

ADQL: Fix big bug: no parenthesis in the SQL translation for ADQL constraints with parenthesis ( ex: A AND (B OR C)) )
parent 612ab4fe
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import adql.query.SelectItem;
import adql.query.constraint.ADQLConstraint;
import adql.query.constraint.Between;
import adql.query.constraint.Comparison;
import adql.query.constraint.ConstraintsGroup;
import adql.query.constraint.Exists;
import adql.query.constraint.In;
import adql.query.constraint.IsNull;
@@ -83,7 +84,7 @@ import adql.query.operand.function.geometry.RegionFunction;
 * An extension is already available for PgSphere: {@link PgSphereTranslator}.</b></p>
 * 
 * @author Gr&eacute;gory Mantelet (CDS;ARI)
 * @version 1.2 (11/2013)
 * @version 1.2 (03/2014)
 * 
 * @see PgSphereTranslator
 */
@@ -277,6 +278,9 @@ public class PostgreSQLTranslator implements ADQLTranslator {

	@Override
	public String translate(ClauseConstraints clause) throws TranslationException{
		if (clause instanceof ConstraintsGroup)
			return "(" + getDefaultADQLList(clause) + ")";
		else
			return getDefaultADQLList(clause);
	}