Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null pointer issue if change changelog object is null #2837

Merged
merged 5 commits into from
Jun 3, 2022

Conversation

kamalnigam
Copy link
Contributor

@kamalnigam kamalnigam commented May 11, 2022

This will throw null pointer if change changelog object is null.
Cannot invoke "liquibase.changelog.DatabaseChangeLog.isIncludeIgnore()" because "changeLog" is null.
Environment Production
Liquibase Version: it started in 3.7.x onward.
public boolean isInheritableIgnore() {
DatabaseChangeLog changeLog = this.getChangeLog();
return changeLog.isIncludeIgnore();
}
This method was added in 3.7.x

Following is the change list
commit 9ae2b57

Liquibase Integration & Version: Spring boot

Liquibase Extension(s) & Version: it started in 3.7.x onward.

Database Vendor & Version: Oracle

Operating System Type & Version: Windows 10

Pull Request Type

Bug fix (non-breaking change which fixes an issue.)
https://forum.liquibase.org/t/null-pointer-exception-in-liquibase-core/6838

Description

when changelog object remain null. this method through null pointer issue.

public boolean isInheritableIgnore() {
DatabaseChangeLog changeLog = this.getChangeLog();
return changeLog.isIncludeIgnore();
}
This method was added in 3.7.x

Cannot invoke "liquibase.changelog.DatabaseChangeLog.isIncludeIgnore()" because "changeLog" is null.

Steps To Reproduce

https://forum.liquibase.org/t/null-pointer-exception-in-liquibase-core/6838

Actual Behavior

Code should no throw null pointer issue

Expected/Desired Behavior

A clear and concise description of what happens in the software after this pull request.

Screenshots (if appropriate)

image

image

Additional Context

Add any other context about the problem here.

Fast Track PR Acceptance Checklist:

Need Help?

[Come chat with us in the Liquibase Forum.](https://forum.liquibase.org/t/null-pointer-exception-in-liquibase-core/6838 Yes, to discuss this.)

This will throw null pointer if change changelog object is null. this object can be null if we got below issue in the code. 
"Error executing SQL SELECT COUNT(*) FROM DATABASECHANGELOG: ORA-00942: table or view does not exist"
@kamalnigam
Copy link
Contributor Author

Hi @kataggart , when these changes will be reviewed?

@kataggart
Copy link
Contributor

@kamalnigam US is on holiday through Monday. I will raise it in our team stand up on Tuesday. Sorry I can't give you a more firm estimate regarding exactly when the PR will be reviewed. Thanks.

@nvoxland nvoxland changed the base branch from master to 1_9 June 1, 2022 18:52
@nvoxland nvoxland changed the base branch from 1_9 to master June 1, 2022 18:52
@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Jun 1, 2022
Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. The change makes sense, and I added a unit test (and did some minor code reformatting), but I'm not sure how to configure a system to hit the problem. Even from the forum post I could pick out specific repo steps. Could you provide some?

Notes and test results:

Things to be aware of

  • Change makes sense and added a unit test, but didn't know what to manually test

Things to worry about

  • Nothing

@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Jun 1, 2022
@github-actions
Copy link

github-actions bot commented Jun 1, 2022

Unit Test Results

  4 524 files  ±  0    4 524 suites  ±0   29m 18s ⏱️ - 3m 32s
  4 423 tests +  1    4 209 ✔️ +  1     214 💤 ±0  0 ±0 
52 356 runs  +12  47 348 ✔️ +12  5 008 💤 ±0  0 ±0 

Results for commit 367dc0e. ± Comparison against base commit c1a67a7.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix is targeted to a specific condition where a changeset does not have a parent changelog. It is unclear what steps to follow to reproduce the issue. However, the fix prevents an NPE and Dev evaluates the change as safe.

  • Unit tests added.
  • No additional testing necessary.

APPROVED

Test Harness Execution
Functional Test Results
NOTE: Test failures in the functional test suite are due to mismatch in expected console output and actual console output for the checks feature. These are unrelated to the changes in this PR and can be disregarded.

@nvoxland nvoxland merged commit a67e29e into liquibase:master Jun 3, 2022
Conditioning++ automation moved this from To Do to Done Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate DBOracle DBPostgres IntegrationSpringboot OSWindows SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions SourceForum TypeBug ver3.7.0
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants