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

Check db version before creating SQL functions #1304

Merged
merged 4 commits into from
Sep 24, 2020

Conversation

mattmundell
Copy link
Contributor

@mattmundell mattmundell commented Sep 23, 2020

What:

Do the db version check before creating the SQL functions.

Why:

"CREATE OR REPLACE FUNCTION" fails if an argument name changes and the body of the function changes. In this case the migrator needs to be run before the "CREATE OR REPLACE FUNCTION", so we have to check the versions first.

How:

  1. Modify "level_min_severity" in manage_pg.c:
  • rename arg lvl to level
  • add a new CASE with some random name.
  1. restart gvmd
  2. gvmd.log should have a database is wrong version log, and not a PQexec failed: ERROR: cannot change name of input parameter “lvl” log.

Checklist:

@mattmundell mattmundell marked this pull request as ready for review September 23, 2020 15:04
@timopollmeier timopollmeier merged commit 02dbb17 into greenbone:master Sep 24, 2020
@mattmundell mattmundell deleted the check-before-funcs branch October 3, 2020 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants