提交 289b5f7a authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 eb0ce326
...@@ -121,7 +121,10 @@ public abstract class Query extends Prepared { ...@@ -121,7 +121,10 @@ public abstract class Query extends Prepared {
ExpressionColumn c = (ExpressionColumn) ec; ExpressionColumn c = (ExpressionColumn) ec;
found = col.equals(c.getColumnName()); found = col.equals(c.getColumnName());
if(alias != null && found) { if(alias != null && found) {
found = alias.equals(c.getOriginalAliasName()); String ca = c.getOriginalAliasName();
if(ca != null) {
found = alias.equals(ca);
}
} }
} else if(!(ec instanceof Alias)) { } else if(!(ec instanceof Alias)) {
continue; continue;
......
...@@ -42,28 +42,33 @@ public class ConditionInSelect extends Condition { ...@@ -42,28 +42,33 @@ public class ConditionInSelect extends Condition {
return l; return l;
} }
query.setSession(session); query.setSession(session);
LocalResult result = query.query(0); LocalResult rows = query.query(0);
boolean hasNull = false;
boolean result = all;
try { try {
boolean valueAll = all; while(rows.next()) {
while(result.next()) {
boolean value; boolean value;
Value r = result.currentRow()[0]; Value r = rows.currentRow()[0];
if(r == ValueNull.INSTANCE) { if(r == ValueNull.INSTANCE) {
value = false; value = false;
hasNull = true;
} else { } else {
value = Comparison.compareNotNull(database, l, r, compareType); value = Comparison.compareNotNull(database, l, r, compareType);
} }
if(!value && all) { if(!value && all) {
valueAll = false; result = false;
break; break;
} else if(value && !all) { } else if(value && !all) {
valueAll = true; result = true;
break; break;
} }
} }
return ValueBoolean.get(valueAll); if(!result && hasNull) {
return ValueNull.INSTANCE;
}
return ValueBoolean.get(result);
} finally { } finally {
result.close(); rows.close();
} }
} }
......
...@@ -1246,7 +1246,7 @@ public class Function extends Expression implements FunctionCall { ...@@ -1246,7 +1246,7 @@ public class Function extends Expression implements FunctionCall {
} else { } else {
int len = args.length; int len = args.length;
if(len>0 && args[len-1] == null) { if(len>0 && args[len-1] == null) {
throw Message.getSQLException(Message.INVALID_PARAMETER_COUNT_1, ""+len); throw Message.getSQLException(Message.INVALID_PARAMETER_COUNT_1, info.name + ": " + len);
} }
} }
} }
......
...@@ -30,6 +30,9 @@ public class JdbcSQLException extends SQLException { ...@@ -30,6 +30,9 @@ public class JdbcSQLException extends SQLException {
super(message + " [" + state + "-" + Constants.BUILD_ID + "]", state, errorCode); super(message + " [" + state + "-" + Constants.BUILD_ID + "]", state, errorCode);
this.originalMessage = message; this.originalMessage = message;
this.cause = cause; this.cause = cause;
//#ifdef JDK14
initCause(cause);
//#endif
} }
/** /**
...@@ -44,9 +47,13 @@ public class JdbcSQLException extends SQLException { ...@@ -44,9 +47,13 @@ public class JdbcSQLException extends SQLException {
*/ */
public void printStackTrace() { public void printStackTrace() {
super.printStackTrace(); super.printStackTrace();
//#ifdef JDK13
/*
if (cause != null) { if (cause != null) {
cause.printStackTrace(); cause.printStackTrace();
} }
*/
//#endif
if(getNextException() != null) { if(getNextException() != null) {
getNextException().printStackTrace(); getNextException().printStackTrace();
} }
...@@ -60,9 +67,13 @@ public class JdbcSQLException extends SQLException { ...@@ -60,9 +67,13 @@ public class JdbcSQLException extends SQLException {
public void printStackTrace(PrintWriter s) { public void printStackTrace(PrintWriter s) {
if(s!=null) { if(s!=null) {
super.printStackTrace(s); super.printStackTrace(s);
//#ifdef JDK13
/*
if (cause != null) { if (cause != null) {
cause.printStackTrace(s); cause.printStackTrace(s);
} }
*/
//#endif
if(getNextException() != null) { if(getNextException() != null) {
getNextException().printStackTrace(s); getNextException().printStackTrace(s);
} }
...@@ -77,9 +88,13 @@ public class JdbcSQLException extends SQLException { ...@@ -77,9 +88,13 @@ public class JdbcSQLException extends SQLException {
public void printStackTrace(PrintStream s) { public void printStackTrace(PrintStream s) {
if(s!=null) { if(s!=null) {
super.printStackTrace(s); super.printStackTrace(s);
//#ifdef JDK13
/*
if (cause != null) { if (cause != null) {
cause.printStackTrace(s); cause.printStackTrace(s);
} }
*/
//#endif
if(getNextException() != null) { if(getNextException() != null) {
getNextException().printStackTrace(s); getNextException().printStackTrace(s);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论