提交 0c6d0c44 authored 作者: Owner's avatar Owner

Removed last meta fix - seems to not be needed

上级 341a5915
...@@ -23,7 +23,6 @@ import org.h2.schema.Sequence; ...@@ -23,7 +23,6 @@ import org.h2.schema.Sequence;
import org.h2.table.Column; import org.h2.table.Column;
import org.h2.table.IndexColumn; import org.h2.table.IndexColumn;
import org.h2.table.Table; import org.h2.table.Table;
import org.h2.util.ColumnNamer;
import org.h2.util.New; import org.h2.util.New;
import org.h2.value.DataType; import org.h2.value.DataType;
import org.h2.value.Value; import org.h2.value.Value;
...@@ -100,7 +99,6 @@ public class CreateTable extends SchemaCommand { ...@@ -100,7 +99,6 @@ public class CreateTable extends SchemaCommand {
@Override @Override
public int update() { public int update() {
boolean metaLockAquired = false;
if (!transactional) { if (!transactional) {
session.commit(true); session.commit(true);
} }
...@@ -109,10 +107,8 @@ public class CreateTable extends SchemaCommand { ...@@ -109,10 +107,8 @@ public class CreateTable extends SchemaCommand {
data.persistIndexes = false; data.persistIndexes = false;
} }
boolean isSessionTemporary = data.temporary && !data.globalTemporary; boolean isSessionTemporary = data.temporary && !data.globalTemporary;
try {
if (!isSessionTemporary) { if (!isSessionTemporary) {
db.lockMeta(session); db.lockMeta(session);
metaLockAquired = true;
} }
if (getSchema().resolveTableOrView(session, data.tableName) != null) { if (getSchema().resolveTableOrView(session, data.tableName) != null) {
if (ifNotExists) { if (ifNotExists) {
...@@ -228,24 +224,16 @@ public class CreateTable extends SchemaCommand { ...@@ -228,24 +224,16 @@ public class CreateTable extends SchemaCommand {
} }
throw e; throw e;
} }
}
finally{
if (!isSessionTemporary && metaLockAquired) {
db.unlockMeta(session);
}
}
return 0; return 0;
} }
private void generateColumnsFromQuery() { private void generateColumnsFromQuery() {
int columnCount = asQuery.getColumnCount(); int columnCount = asQuery.getColumnCount();
ArrayList<Expression> expressions = asQuery.getExpressions(); ArrayList<Expression> expressions = asQuery.getExpressions();
ColumnNamer columnNamer= new ColumnNamer(session);
for (int i = 0; i < columnCount; i++) { for (int i = 0; i < columnCount; i++) {
Expression expr = expressions.get(i); Expression expr = expressions.get(i);
int type = expr.getType(); int type = expr.getType();
String name = columnNamer.getColumnName(expr,i,expr.getAlias()); String name = expr.getAlias();
long precision = expr.getPrecision(); long precision = expr.getPrecision();
int displaySize = expr.getDisplaySize(); int displaySize = expr.getDisplaySize();
DataType dt = DataType.getDataType(type); DataType dt = DataType.getDataType(type);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论