Unverified 提交 e8f99400 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #1521 from grandinj/parallel-sorted-inserts

fix doing sorted-insert mode in parallel where not wanted
......@@ -130,6 +130,14 @@ public class Insert extends Prepared implements ResultTarget {
public int update() {
Index index = null;
if (sortedInsertMode) {
if (!session.getDatabase().isMVStore()) {
/*
* Take exclusive lock, otherwise two different inserts running at
* the same time, the second might accidentally get
* sorted-insert-mode.
*/
table.lock(session, /* exclusive */true, /* forceLockEvenInMvcc */true);
}
index = table.getScanIndex(session);
index.setSortedInsertMode(true);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论