提交 7aa0e49a authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Fix NPE in MERGE USING with unknown column

上级 1c0bbdc3
......@@ -21,6 +21,10 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Issue #1490: NullPointerException when running invalid MERGE statement
</li>
<li>Issue #1488: Improve documentation of window and some other functions
</li>
<li>Issue #1485: Default window frame in presence of ORDER BY is RANGE .., not ROWS
</li>
<li>PR #1484: New tests, reimplemented EXCLUDE clause, and assorted changes
......
......@@ -317,9 +317,15 @@ public class ExpressionColumn extends Expression {
}
return true;
case ExpressionVisitor.GET_COLUMNS1:
if (column == null) {
throw DbException.get(ErrorCode.COLUMN_NOT_FOUND_1, getSQL());
}
visitor.addColumn1(column);
return true;
case ExpressionVisitor.GET_COLUMNS2:
if (column == null) {
throw DbException.get(ErrorCode.COLUMN_NOT_FOUND_1, getSQL());
}
visitor.addColumn2(column);
return true;
default:
......
......@@ -208,5 +208,8 @@ SELECT * FROM TEST;
> 30
> rows: 3
MERGE INTO TEST USING (SELECT 40) ON UNKNOWN_COLUMN = 1 WHEN NOT MATCHED THEN INSERT (ID) VALUES (40);
> exception COLUMN_NOT_FOUND_1
DROP TABLE TEST;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论