From f0be9e1af1d077653d3a34ebd066a1bd412c9157 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Thu, 18 Jan 2007 01:26:57 +0000 Subject: [PATCH] Changed SQL generated by JPQL query "null = null" from "NULL IS NULL" to "1 = 1", since some databases (e.g., DB2) dislike "NULL IS NULL", but everyone is OK with "1 = 1". git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@497276 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java index 62a2e68fe..e5defbbc6 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/EqualExpression.java @@ -36,7 +36,7 @@ class EqualExpression public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate, SQLBuffer buf, boolean val1Null, boolean val2Null) { if (val1Null && val2Null) - buf.appendValue(null).append(" IS ").appendValue(null); + buf.append("1 = 1"); else if (val1Null || val2Null) { Val val = (val1Null) ? getValue2() : getValue1(); ExpState state = (val1Null) ? bstate.state2 : bstate.state1;