提交 9b500d89 authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

Concurrent CREATE TABLE... IF NOT EXISTS in the presence of MULTI_THREAD=TRUE…

Concurrent CREATE TABLE... IF NOT EXISTS in the presence of MULTI_THREAD=TRUE could throw an exception.
上级 c5a90937
......@@ -53,6 +53,10 @@ Change Log
this is a problem for various libraries, including Apache Lucene.
</li><li>MVStore: use RandomAccessFile file system if the file name starts with "file:".
</li><li>Allow DATEADD to take a long value for count when manipulating milliseconds.
</li><li>When using MV_STORE=TRUE and the SET CACHE_SIZE setting, the cache size was incorrectly set,
so that it was effectly 1024 times smaller than it should be.
</li><li>Concurrent CREATE TABLE... IF NOT EXISTS in the presence of MULTI_THREAD=TRUE could
throw an exception.
</li></ul>
<h2>Version 1.4.186 Beta (2015-03-02)</h2>
......
......@@ -104,6 +104,10 @@ public class CreateTable extends SchemaCommand {
if (!db.isPersistent()) {
data.persistIndexes = false;
}
boolean isSessionTemporary = data.temporary && !data.globalTemporary;
if (!isSessionTemporary) {
db.lockMeta(session);
}
if (getSchema().findTableOrView(session, data.tableName) != null) {
if (ifNotExists) {
return 0;
......@@ -130,10 +134,6 @@ public class CreateTable extends SchemaCommand {
data.id = getObjectId();
data.create = create;
data.session = session;
boolean isSessionTemporary = data.temporary && !data.globalTemporary;
if (!isSessionTemporary) {
db.lockMeta(session);
}
Table table = getSchema().createTable(data);
ArrayList<Sequence> sequences = New.arrayList();
for (Column c : data.columns) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论