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