提交 dc89e63f authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix NPE in error message generation and reuse method

上级 21b3ef34
......@@ -305,15 +305,7 @@ public class Insert extends Prepared implements ResultTarget {
buff.append(",\n");
}
buff.append('(');
buff.resetCount();
for (Expression e : expr) {
buff.appendExceptFirst(", ");
if (e == null) {
buff.append("DEFAULT");
} else {
e.getSQL(buff.builder());
}
}
Expression.writeExpressions(buff.builder(), expr);
buff.append(')');
}
} else {
......
......@@ -242,15 +242,7 @@ public class Merge extends Prepared {
buff.append(", ");
}
buff.append('(');
buff.resetCount();
for (Expression e : expr) {
buff.appendExceptFirst(", ");
if (e == null) {
buff.append("DEFAULT");
} else {
e.getSQL(buff.builder());
}
}
Expression.writeExpressions(buff.builder(), expr);
buff.append(')');
}
} else {
......
......@@ -222,15 +222,7 @@ public class Replace extends Prepared {
buff.append(", ");
}
buff.append('(');
buff.resetCount();
for (Expression e : expr) {
buff.appendExceptFirst(", ");
if (e == null) {
buff.append("DEFAULT");
} else {
e.getSQL(buff.builder());
}
}
Expression.writeExpressions(buff.builder(), expr);
buff.append(')');
}
} else {
......
......@@ -54,7 +54,12 @@ public abstract class Expression {
if (i > 0) {
builder.append(", ");
}
expressions[i].getSQL(builder);
Expression e = expressions[i];
if (e == null) {
builder.append("DEFAULT");
} else {
e.getSQL(builder);
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论