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: add missing trash suffix when getting by id #2151

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

mattmundell
Copy link
Contributor

@mattmundell mattmundell commented Mar 11, 2024

What

In init_get_iterator2_with be sure to add the "_trash" suffix on the table name when getting a single resource.

Why

Otherwise there's an SQL error, for example:

o m m '<get_scanners trash="1" scanner_id="6521a066-26cd-4019-af73-8f822ee6f833"/>'

fails, with

ERROR:  missing FROM-clause entry for table "scanners"
LINE 1: ...ST ('secret' AS TEXT)) FROM scanners_trash  WHERE scanners.i...
                                                             ^
 (7)

in the log.

References

Introduced in 2020 in c9dc67a in /pull/1076.

@mattmundell mattmundell requested a review from a team as a code owner March 11, 2024 20:29
Copy link

Conventional Commits Report

Type Number
Bug Fixes 1

🚀 Conventional commits found.

@timopollmeier timopollmeier merged commit 69a06f7 into greenbone:main Mar 14, 2024
13 of 17 checks passed
@mattmundell mattmundell deleted the get-by-id-missing-trash branch March 14, 2024 14:34
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