提交 1487876f authored 作者: noelgrandin@gmail.com's avatar noelgrandin@gmail.com

rename Database#update to Database#updateMeta for symmetry with the other meta related methods

上级 6cb91c1b
......@@ -53,7 +53,7 @@ public class AlterSchemaRename extends DefineCommand {
db.renameDatabaseObject(session, oldSchema, newSchemaName);
ArrayList<SchemaObject> all = db.getAllSchemaObjects();
for (SchemaObject schemaObject : all) {
db.update(session, schemaObject);
db.updateMeta(session, schemaObject);
}
return 0;
}
......
......@@ -102,7 +102,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
}
checkNoNullValues();
oldColumn.setNullable(false);
db.update(session, table);
db.updateMeta(session, table);
break;
}
case CommandInterface.ALTER_TABLE_ALTER_COLUMN_NULL: {
......@@ -112,7 +112,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
}
checkNullable();
oldColumn.setNullable(true);
db.update(session, table);
db.updateMeta(session, table);
break;
}
case CommandInterface.ALTER_TABLE_ALTER_COLUMN_DEFAULT: {
......@@ -120,7 +120,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
oldColumn.setSequence(null);
oldColumn.setDefaultExpression(session, defaultExpression);
removeSequence(sequence);
db.update(session, table);
db.updateMeta(session, table);
break;
}
case CommandInterface.ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE: {
......@@ -130,7 +130,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
if (oldColumn.isWideningConversion(newColumn)) {
convertAutoIncrementColumn(newColumn);
oldColumn.copy(newColumn);
db.update(session, table);
db.updateMeta(session, table);
} else {
oldColumn.setSequence(null);
oldColumn.setDefaultExpression(session, null);
......@@ -173,7 +173,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
case CommandInterface.ALTER_TABLE_ALTER_COLUMN_SELECTIVITY: {
int value = newSelectivity.optimize(session).getValue(session).getInt();
oldColumn.setSelectivity(value);
db.update(session, table);
db.updateMeta(session, table);
break;
}
default:
......
......@@ -46,7 +46,7 @@ public class AlterTableRename extends SchemaCommand {
if (!t.isHidden()) {
t.setHidden(hidden);
oldTable.setHidden(true);
db.update(session, oldTable);
db.updateMeta(session, oldTable);
}
return 0;
}
......
......@@ -53,10 +53,10 @@ public class AlterTableRenameColumn extends DefineCommand {
column.removeCheckConstraint();
column.addCheckConstraint(session, newCheckExpr);
table.setModified();
db.update(session, table);
db.updateMeta(session, table);
for (DbObject child : table.getChildren()) {
if (child.getCreateSQL() != null) {
db.update(session, child);
db.updateMeta(session, child);
}
}
return 0;
......
......@@ -107,7 +107,7 @@ public class AlterUser extends DefineCommand {
default:
DbException.throwInternalError("type=" + type);
}
db.update(session, user);
db.updateMeta(session, user);
return 0;
}
......
......@@ -114,7 +114,7 @@ public class Analyze extends DefineCommand {
columns[j].setSelectivity(selectivity);
}
if (manual) {
db.update(session, table);
db.updateMeta(session, table);
} else {
Session sysSession = db.getSystemSession();
if (sysSession != session) {
......@@ -122,7 +122,7 @@ public class Analyze extends DefineCommand {
// (which is the case if we are within a trigger)
// then we can't update the statistics because
// that would unlock all locked objects
db.update(sysSession, table);
db.updateMeta(sysSession, table);
sysSession.commit(true);
}
}
......
......@@ -119,7 +119,7 @@ public class CreateView extends SchemaCommand {
if (old == null) {
db.addSchemaObject(session, view);
} else {
db.update(session, view);
db.updateMeta(session, view);
}
return 0;
}
......
......@@ -115,7 +115,7 @@ public class GrantRevoke extends DefineCommand {
db.addDatabaseObject(session, right);
} else {
right.setRightMask(right.getRightMask() | rightMask);
db.update(session, right);
db.updateMeta(session, right);
}
}
}
......@@ -151,7 +151,7 @@ public class GrantRevoke extends DefineCommand {
db.removeDatabaseObject(session, right);
} else {
right.setRightMask(newRight);
db.update(session, right);
db.updateMeta(session, right);
}
}
}
......
......@@ -101,7 +101,7 @@ public class SetComment extends DefineCommand {
objectType == DbObject.USER ||
objectType == DbObject.INDEX ||
objectType == DbObject.CONSTRAINT) {
db.update(session, object);
db.updateMeta(session, object);
} else {
Comment comment = db.findComment(object);
if (comment == null) {
......@@ -118,7 +118,7 @@ public class SetComment extends DefineCommand {
db.removeDatabaseObject(session, comment);
} else {
comment.setCommentText(text);
db.update(session, comment);
db.updateMeta(session, comment);
}
}
}
......
......@@ -104,7 +104,7 @@ public class AlterSequence extends SchemaCommand {
// would keep other transactions from using the sequence
Session sysSession = db.getSystemSession();
synchronized (sysSession) {
db.update(sysSession, sequence);
db.updateMeta(sysSession, sequence);
sysSession.commit(true);
}
return 0;
......
......@@ -522,7 +522,7 @@ public class Set extends Prepared {
if (addNew) {
database.addDatabaseObject(session, setting);
} else {
database.update(session, setting);
database.updateMeta(session, setting);
}
}
......
......@@ -1564,7 +1564,7 @@ public class Database implements DataHandler {
* @param session the session
* @param obj the database object
*/
public synchronized void update(Session session, DbObject obj) {
public synchronized void updateMeta(Session session, DbObject obj) {
lockMeta(session);
int id = obj.getId();
removeMeta(session, id);
......@@ -1591,12 +1591,12 @@ public class Database implements DataHandler {
if (comment != null) {
DbException.throwInternalError();
}
update(session, obj);
updateMeta(session, obj);
// remember that this scans only one level deep!
if (list != null) {
for (DbObject o : list) {
if (o.getCreateSQL() != null) {
update(session, o);
updateMeta(session, o);
}
}
}
......
......@@ -303,7 +303,7 @@ public class Sequence extends SchemaObjectBase {
try {
value = valueWithMargin;
if (!isTemporary()) {
database.update(session, this);
database.updateMeta(session, this);
}
} finally {
value = realValue;
......
......@@ -1029,7 +1029,7 @@ public abstract class Table extends SchemaObjectBase {
for (Constraint cons : constraints) {
if (cons.usesIndex(index)) {
cons.setIndexOwner(index);
database.update(session, cons);
database.updateMeta(session, cons);
stillNeeded = true;
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论