DBZ-3612 Do not parse Oracle ALTER TABLE ddl for unknown tables

This commit is contained in:
Chris Cranford 2021-06-15 07:20:32 -04:00 committed by Gunnar Morling
parent 96fc521f85
commit aedb6118da

View File

@ -60,6 +60,10 @@ public class AlterTableParserListener extends BaseParserListener {
public void enterAlter_table(PlSqlParser.Alter_tableContext ctx) {
previousTableId = null;
TableId tableId = new TableId(catalogName, schemaName, getTableName(ctx.tableview_name()));
if (parser.databaseTables().forTable(tableId) == null) {
LOGGER.debug("Ignoring ALTER TABLE statement for non-captured table {}", tableId);
return;
}
tableEditor = parser.databaseTables().editTable(tableId);
if (tableEditor == null) {
throw new ParsingException(null, "Trying to alter table " + tableId.toString()