提交 3cd15fa6 authored 作者: Thomas Mueller's avatar Thomas Mueller

Deleting rows in the trigger table inside a trigger could result in a NullPointerException.

上级 1cda128a
......@@ -406,8 +406,8 @@ public class PageDataLeaf extends PageData {
boolean remove(long key) {
int i = find(key);
if (keys[i] != key) {
throw DbException.get(ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1, index.getSQL() + ": " + key + " " + keys[i]);
if (keys == null || keys[i] != key) {
throw DbException.get(ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1, index.getSQL() + ": " + key + " " + (keys == null ? -1 : keys[i]));
}
index.getPageStore().logUndo(this, data);
if (entryCount == 1) {
......
......@@ -402,7 +402,7 @@ public abstract class TestBase {
*
* @throws AssertionError always throws an AssertionError
*/
protected void fail() {
public void fail() {
fail("Unexpected success");
}
......@@ -1115,7 +1115,7 @@ public abstract class TestBase {
*
* @param e the error
*/
protected void assertKnownException(SQLException e) {
public void assertKnownException(SQLException e) {
assertKnownException("", e);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论