提交 341a5915 authored 作者: Owner's avatar Owner

Reverted schema meta lock fix, not needed

上级 d4fb4c1c
...@@ -5206,7 +5206,7 @@ public class Parser { ...@@ -5206,7 +5206,7 @@ public class Parser {
if (readIf("(")) { if (readIf("(")) {
cols = parseColumnList(); cols = parseColumnList();
for (String c : cols) { for (String c : cols) {
// we don't really know the type of the column, so UNKNOWN will // we don't really know the type of the column, so STRING will
// have to do // have to do
columns.add(new Column(c, Value.STRING)); columns.add(new Column(c, Value.STRING));
} }
......
...@@ -639,14 +639,9 @@ public class Schema extends DbObjectBase { ...@@ -639,14 +639,9 @@ public class Schema extends DbObjectBase {
* @return the created {@link Table} object * @return the created {@link Table} object
*/ */
public Table createTable(CreateTableData data) { public Table createTable(CreateTableData data) {
Database acquiredMetaLockDatabase = null;
try{
synchronized (database) { synchronized (database) {
if (!data.temporary || data.globalTemporary) { if (!data.temporary || data.globalTemporary) {
database.lockMeta(data.session); database.lockMeta(data.session);
// remember to unlock the meta lock before we leave this method
acquiredMetaLockDatabase = database;
} }
data.schema = this; data.schema = this;
if (data.tableEngine == null) { if (data.tableEngine == null) {
...@@ -661,24 +656,11 @@ public class Schema extends DbObjectBase { ...@@ -661,24 +656,11 @@ public class Schema extends DbObjectBase {
if (data.tableEngineParams == null) { if (data.tableEngineParams == null) {
data.tableEngineParams = this.tableEngineParams; data.tableEngineParams = this.tableEngineParams;
} }
// the createTable method unlocks the meta - so turn off flag now
acquiredMetaLockDatabase=null;
return database.getTableEngine(data.tableEngine).createTable(data); return database.getTableEngine(data.tableEngine).createTable(data);
} }
// the RegularTable constructor unlocks the meta - so turn off flag now
acquiredMetaLockDatabase=null;
return new RegularTable(data); return new RegularTable(data);
} }
} }
finally{
if(acquiredMetaLockDatabase!=null && data.session!=null){
if(acquiredMetaLockDatabase.isSysTableLockedBy(data.session)){
acquiredMetaLockDatabase.unlockMeta(data.session);
}
}
}
}
public TableSynonym createSynonym(CreateSynonymData data) { public TableSynonym createSynonym(CreateSynonymData data) {
synchronized (database) { synchronized (database) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论