提交 29cba7f9 authored 作者: Thomas Mueller's avatar Thomas Mueller

When altering a table with triggers, new triggers are created and initialized…

When altering a table with triggers, new triggers are created and initialized with a table name that ends with tableName_COPY_x_y.
上级 94280278
......@@ -174,7 +174,8 @@ public class AlterTableAlterColumn extends SchemaCommand {
throw DbException.getUnsupportedException("TEMP TABLE");
}
Database db = session.getDatabase();
String tempName = db.getTempTableName(session);
String baseName = table.getName();
String tempName = db.getTempTableName(baseName, session);
Column[] columns = table.getColumns();
ArrayList<Column> newColumns = New.arrayList();
Table newTable = cloneTableStructure(columns, db, tempName, newColumns);
......@@ -358,7 +359,7 @@ public class AlterTableAlterColumn extends SchemaCommand {
String newTableName = newTable.getName();
Database db = sourceTable.getDatabase();
// save the real table under a temporary name
db.renameSchemaObject(session, sourceTable, db.getTempTableName(session));
db.renameSchemaObject(session, sourceTable, db.getTempTableName(sourceTableName, session));
try {
// have our new table impersonate the target table
db.renameSchemaObject(session, newTable, sourceTableName);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论