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