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

VALUES is now supported as a standalone command and as a table source.

上级 5181b56b
...@@ -3920,6 +3920,9 @@ public class Parser { ...@@ -3920,6 +3920,9 @@ public class Parser {
prec = expr.getPrecision(); prec = expr.getPrecision();
scale = expr.getScale(); scale = expr.getScale();
displaySize = expr.getDisplaySize(); displaySize = expr.getDisplaySize();
if (i >= columns.size()) {
throw DbException.get(ErrorCode.COLUMN_COUNT_DOES_NOT_MATCH);
}
Column c = columns.get(i); Column c = columns.get(i);
type = Value.getHigherOrder(c.getType(), type); type = Value.getHigherOrder(c.getType(), type);
prec = Math.max(c.getPrecision(), prec); prec = Math.max(c.getPrecision(), prec);
...@@ -3939,7 +3942,7 @@ public class Parser { ...@@ -3939,7 +3942,7 @@ public class Parser {
int rowCount = rows.size(); int rowCount = rows.size();
for (int i = 0; i < rowCount; i++) { for (int i = 0; i < rowCount; i++) {
if (rows.get(i).size() != columnCount) { if (rows.get(i).size() != columnCount) {
throw DbException.get(ErrorCode.COLUMN_COUNT_DOES_NOT_MATCH, "row " + (i + 1)); throw DbException.get(ErrorCode.COLUMN_COUNT_DOES_NOT_MATCH);
} }
} }
for (int i = 0; i < columnCount; i++) { for (int i = 0; i < columnCount; i++) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论