Correct FROM of some queries to the right schema #1295
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
Relation
cert_bund_advs
does not exist, however, the table resides in a schema calledcert
, hence it should becert.cert_bund_advs
. Same goes withcert_bund_cves
as well.With this PR,
FROM cert_
will be replaced withFROM cert.cert_
.Why:
When I tried to
EXPLAIN ANALYZE
a query, I got the following error:I looked into the source code and found that the table belongs to schema
cert
.Proof:
gvmd/src/manage_pg.c
Lines 3070 to 3083 in ea8242e
With my changes, these queries should now point to the right table in the right schema.
I also suspect that this is could be the cause of a performance issue reported in a third-party Docker deployment. Secure-Compliance-Solutions-LLC/GVM-Docker#54
How:
I did a basic
sed
substitution.Not verified yet as I haven't taken time to prepare a build environment (which what makes this PR a draft).
I'm planning on adding tests later.
Checklist: