Skip to content

Commit

Permalink
Fixes issue with incorrect schema in column exists precondition when …
Browse files Browse the repository at this point in the history
…checking using a snapshot
  • Loading branch information
mpvvliet authored and filipelautert committed May 9, 2024
1 parent c095fa2 commit d6b4409
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public void check(Database database, DatabaseChangeLog changeLog, ChangeSet chan
private void checkUsingSnapshot(Database database, DatabaseChangeLog changeLog) throws PreconditionFailedException, PreconditionErrorException {
Column example = new Column();
if (StringUtil.trimToNull(getTableName()) != null) {
example.setRelation(new Table().setName(database.correctObjectName(getTableName(), Table.class)).setSchema(new Schema(getCatalogName(), getSchemaName())));
String schemaName = getSchemaName();

Check notice

Code scanning / CodeQL

Possible confusion of local and field Note

Confusing name: method
checkUsingSnapshot
also refers to field
schemaName
(without qualifying it with 'this').
if (schemaName == null) {
schemaName = database.getDefaultSchemaName();
}
example.setRelation(new Table().setName(database.correctObjectName(getTableName(), Table.class)).setSchema(new Schema(getCatalogName(), schemaName)));
}
example.setName(database.correctObjectName(getColumnName(), Column.class));

Expand Down

0 comments on commit d6b4409

Please sign in to comment.