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
This commit is contained in:
Marc Prud'hommeaux 2007-01-18 01:26:57 +00:00
parent bb7bf59409
commit f0be9e1af1
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ class EqualExpression
public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate, public void appendTo(Select sel, ExpContext ctx, BinaryOpExpState bstate,
SQLBuffer buf, boolean val1Null, boolean val2Null) { SQLBuffer buf, boolean val1Null, boolean val2Null) {
if (val1Null && val2Null) if (val1Null && val2Null)
buf.appendValue(null).append(" IS ").appendValue(null); buf.append("1 = 1");
else if (val1Null || val2Null) { else if (val1Null || val2Null) {
Val val = (val1Null) ? getValue2() : getValue1(); Val val = (val1Null) ? getValue2() : getValue1();
ExpState state = (val1Null) ? bstate.state2 : bstate.state1; ExpState state = (val1Null) ? bstate.state2 : bstate.state1;