提交 adb511b0 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 574eec00
...@@ -91,7 +91,12 @@ public class Update extends Prepared { ...@@ -91,7 +91,12 @@ public class Update extends Prepared {
} else if (newExpr == ValueExpression.DEFAULT) { } else if (newExpr == ValueExpression.DEFAULT) {
Column column = table.getColumn(i); Column column = table.getColumn(i);
Expression defaultExpr = column.getDefaultExpression(); Expression defaultExpr = column.getDefaultExpression();
Value v = defaultExpr.getValue(session); Value v;
if (defaultExpr == null) {
v = column.validateConvertUpdateSequence(session, null);
} else {
v = defaultExpr.getValue(session);
}
int type = column.getType(); int type = column.getType();
newValue = v.convertTo(type); newValue = v.convertTo(type);
} else { } else {
......
...@@ -612,7 +612,7 @@ public class ValueLob extends Value { ...@@ -612,7 +612,7 @@ public class ValueLob extends Value {
public boolean equals(Object other) { public boolean equals(Object other) {
try { try {
return compareSecure((Value) other, null) == 0; return other instanceof ValueLob && compareSecure((Value) other, null) == 0;
} catch (SQLException e) { } catch (SQLException e) {
throw Message.convertToInternal(e); throw Message.convertToInternal(e);
} }
......
...@@ -37,6 +37,9 @@ select * from test; ...@@ -37,6 +37,9 @@ select * from test;
> 3 null > 3 null
> rows: 3 > rows: 3
update test set a=default;
> update count: 3
drop table test; drop table test;
> ok > ok
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论