提交 9d02ae76 authored 作者: Thomas Mueller's avatar Thomas Mueller

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

上级 26dfd8b0
......@@ -12,6 +12,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import org.h2.constant.ErrorCode;
import org.h2.engine.Constants;
import org.h2.engine.Session;
import org.h2.engine.UndoLogRecord;
......@@ -131,6 +132,9 @@ public class ScanIndex extends BaseIndex {
Row free = new Row(null, 1);
free.setKey(firstFree);
long key = row.getKey();
if (rows.size() <= key) {
throw DbException.get(ErrorCode.ROW_NOT_FOUND_WHEN_DELETING_1, rows.size() + ": " + key);
}
rows.set((int) key, free);
firstFree = key;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论