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

Fix issue 4733. Update the mysql, mssql, postgresql and oracle initialize files. #4736

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

albertwangnz
Copy link
Contributor

Fixes Issue

setting autoUpdate to false causes "Old database schema identified", but schema is up to date

The problem

In the commit, 811a9eb, the data.version in core/src/main/resources/dependencycheck.properties was updated to 5.2.1. Meanwhile, the database schema file and its version in core/src/main/resources/data/initialize.sql was updated to 5.2.1 as well.

However, the other initialize files and their versions, like core/src/main/resources/data/initialize_postgres.sql, haven't been updated.

Therefore, when somebody installes Dependency Check by using core/src/main/resources/data/initialize_postgres.sql, and when they run the goal check, the data.version is 5.2.1, but the database schema version is 5.2. And if they configure autoUpdate to false, an exception will be thrown in the file core/src/main/java/org/owasp/dependencycheck/data/nvdcve/DatabaseManager.java in the method ensureSchemaVersion, from the line 512.

Description of Change

Updated the other initialize files and their versions by studying the commit 811a9eb.

Have test cases been added to cover the new functionality?

There is no functionality. Manually tested core/src/main/resources/data/initialize_postgres.sql.

@boring-cyborg boring-cyborg bot added the core changes to core label Aug 9, 2022
@albertwangnz
Copy link
Contributor Author

Hi @aikebah, how are you? I noticed this issue and created this pull request. Since it is related to one of your previous commits, could you kindly help with reviewing it?

Btw, thank you for your help last time with regard to #4614.

Cheers.

Regards,
Albert

@jeremylong
Copy link
Owner

Thank you for the PR! I can't believe I forgot to update the other database initialization scripts - sorry about that.

@jeremylong jeremylong merged commit 9d3443c into jeremylong:main Aug 9, 2022
@jeremylong jeremylong added this to the 7.1.2 milestone Aug 9, 2022
@albertwangnz albertwangnz deleted the fix-4377 branch August 9, 2022 09:34
@albertwangnz
Copy link
Contributor Author

Thank you for the PR! I can't believe I forgot to update the other database initialization scripts - sorry about that.

Thank you for the quick approval :-)

@albertwangnz
Copy link
Contributor Author

Btw, I think the PR fixed the issue #4600 as well.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core changes to core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants