@Override public String getSchemaName() { return table.getSchema().getName(); }
@Override public String getSchemaName() { Table table = column.getTable(); return table == null ? null : table.getSchema().getName(); }
/** * Initialize the base index. * * @param newTable the table * @param id the object id * @param name the index name * @param newIndexColumns the columns that are indexed or null if this is * not yet known * @param newIndexType the index type */ public Index(Table newTable, String name, IndexColumn[] newIndexColumns, IndexType newIndexType) { initSchemaObjectBase(newTable.getSchema(), name); this.indexType = newIndexType; this.table = newTable; if (newIndexColumns != null) { this.indexColumns = newIndexColumns; columns = new Column[newIndexColumns.length]; int len = columns.length; columnIds = new int[len]; for (int i = 0; i < len; i++) { Column col = newIndexColumns[i].column; columns[i] = col; columnIds[i] = col.getColumnId(); } } }
private AlterTableAlterColumn parseAlterTableAlterColumnType(Table table, String columnName, Column column) { Column newColumn = parseColumnForTable(columnName, column.isNullable()); AlterTableAlterColumn command = new AlterTableAlterColumn(session, table.getSchema()); command.setTable(table); command.setType(CommandInterface.ALTER_TABLE_ALTER_COLUMN_CHANGE_TYPE); command.setOldColumn(column); command.setNewColumn(newColumn); return command; }
private AlterTableAlterColumn parseAlterTableAddColumn(Table table) { readIf("COLUMN"); Schema schema = table.getSchema(); AlterTableAlterColumn command = new AlterTableAlterColumn(session, schema);
columnName = readColumnIdentifier(); if (!equalsToken(schema, filter.getTable().getSchema() .getName())) { throw DbException.get(ErrorCode.SCHEMA_NOT_FOUND_1, schema);
if (readIf("ADD")) { Prepared command = parseAlterTableAddConstraintIf(table.getName(), table.getSchema()); if (command != null) { return command; boolean value = readBooleanSetting(); AlterTableSet command = new AlterTableSet(session, table.getSchema(), type, value); command.setTableName(table.getName()); if (readIf("CHECK")) { } else if (readIf("RENAME")) { read("TO"); String newName = readIdentifierWithSchema(table.getSchema() .getName()); checkSchema(table.getSchema()); AlterTableRename command = new AlterTableRename(session, getSchema()); boolean ifExists = readIfExists(false); String constraintName = readIdentifierWithSchema(table .getSchema().getName()); ifExists = readIfExists(ifExists); checkSchema(table.getSchema()); AlterTableDropConstraint command = new AlterTableDropConstraint( session, getSchema(), ifExists); .getSchema().getName());