DBZ-538 Improve invalid DDL statement reporting
This commit is contained in:
parent
374999ee45
commit
0b269a6e41
@ -290,7 +290,6 @@ public boolean applyDdl(SourceInfo source, String databaseName, String ddlStatem
|
|||||||
if (skipUnparseableDDL) {
|
if (skipUnparseableDDL) {
|
||||||
logger.warn("Ignoring unparseable DDL statement '{}': {}", ddlStatements);
|
logger.warn("Ignoring unparseable DDL statement '{}': {}", ddlStatements);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Error parsing DDL statement and updating tables: {}", ddlStatements);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -289,7 +289,7 @@ public final void parse(TokenStream ddlContent, Tables databaseTables) throws Pa
|
|||||||
}
|
}
|
||||||
} catch (ParsingException e) {
|
} catch (ParsingException e) {
|
||||||
ddlContent.rewind(marker);
|
ddlContent.rewind(marker);
|
||||||
throw e;
|
throw new ParsingException(e.getPosition(), "Failed to parse statement '" + ddlContent.getInputString() + "'", e);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
parsingFailed(ddlContent.nextPosition(), "Unexpected exception (" + t.getMessage() + ") parsing", t);
|
parsingFailed(ddlContent.nextPosition(), "Unexpected exception (" + t.getMessage() + ") parsing", t);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,6 @@ public final void recover(Map<String, ?> source, Map<String, ?> position, Tables
|
|||||||
if (skipUnparseableDDL) {
|
if (skipUnparseableDDL) {
|
||||||
logger.warn("Ignoring unparseable statements '{}' stored in database history: {}", ddl, e);
|
logger.warn("Ignoring unparseable statements '{}' stored in database history: {}", ddl, e);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Cannot parse DDL statements {} stored in history, exiting", ddl);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2691,4 +2691,11 @@ public void tokenize(CharacterStream input,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return a string to be parsed
|
||||||
|
*/
|
||||||
|
public String getInputString() {
|
||||||
|
return inputString;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user