Bug 530214: TRIM(... FROM ...) operation fails for literal binding
Signed-off-by: Will Dazey <dazeydev.3@gmail.com>
Reviewed-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/expressions/ExpressionOperator.java b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/expressions/ExpressionOperator.java
index 67810fc..222ee4f 100644
--- a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/expressions/ExpressionOperator.java
+++ b/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/expressions/ExpressionOperator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -12,6 +12,8 @@
* Markus Karg - allow arguments to be specified multiple times in argumentIndices
* 05/07/2009-1.1.1 Dave Brosius
* - 263904: [PATCH] ExpressionOperator doesn't compare arrays correctly
+ * 01/23/2018-2.6 Will Dazey
+ * - 530214: trim operation should not bind parameters
******************************************************************************/
package org.eclipse.persistence.expressions;
@@ -3041,6 +3043,7 @@
exOperator.printsAs(v);
exOperator.bePrefix();
exOperator.setNodeClass(ClassConstants.FunctionExpression_Class);
+ exOperator.setIsBindingSupported(false);
return exOperator;
}
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
index 065a068..f38ba14 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2014 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -8,7 +8,9 @@
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
- * Oracle - initial API and implementation from Oracle TopLink
+ * Oracle - initial API and implementation from Oracle TopLink
+ * 01/23/2018-2.6 Will Dazey
+ * - 530214: trim operation should not bind parameters
******************************************************************************/
package org.eclipse.persistence.testing.tests.jpa.jpql;
@@ -3134,7 +3136,8 @@
"SELECT CONCAT('a', e.lastName) FROM Employee e",
"SELECT CONCAT(e.firstName, 'b') FROM Employee e",
"SELECT SUBSTRING(e.firstName, 1, 2) FROM Employee e",
- "SELECT TRIM(e.firstName) FROM Employee e",
+ "SELECT TRIM(e.firstName) FROM Employee e",
+ "SELECT TRIM('A' FROM e.firstName) FROM Employee e",
"SELECT TRIM(LEADING FROM e.firstName) FROM Employee e",
"SELECT TRIM(TRAILING FROM e.firstName) FROM Employee e",
"SELECT TRIM(LEADING 'A' FROM e.firstName) FROM Employee e",