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

update sql function annotation_update_textsearch to check for resourc… #1949

Closed
wants to merge 1 commit into from

Conversation

h-artzi
Copy link
Contributor

@h-artzi h-artzi commented Nov 19, 2020

Without checking if resource_id existence, queries can fail due to a foreign key constraint.
Related post: https://discuss.cyberarkcommons.org/t/database-error-after-backup-restore/474/11

What does this PR do?

The following SQL function annotation_update_textsearch is updated to ensure the resource_id exists during update/deletion. If it doesn't an appropriate log message is recorded. This ensures we do not receive the 500 error highlighted in the issue.

What ticket does this PR close?

Resolves #1948

Checklists

Change log

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR, and/or there is a follow-on issue to update docs, or
  • This PR does not require updating any documentation

@h-artzi h-artzi requested a review from a team as a code owner November 19, 2020 17:49
@h-artzi h-artzi marked this pull request as draft November 19, 2020 17:49
@h-artzi h-artzi force-pushed the update-resource_update_textsearch-function branch 5 times, most recently from e27a15a to 3ce56d8 Compare November 19, 2020 20:05
…e_id existance

Without checking if resource_id existance, queries can fail due to a foreign key constraint.
Related post: https://discuss.cyberarkcommons.org/t/database-error-after-backup-restore/474/11
@h-artzi h-artzi force-pushed the update-resource_update_textsearch-function branch from 3ce56d8 to 38c8e5e Compare November 19, 2020 20:37
@codeclimate
Copy link

codeclimate bot commented Nov 19, 2020

Code Climate has analyzed commit 38c8e5e and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.4%.

View more on Code Climate.

@izgeri
Copy link
Contributor

izgeri commented Nov 23, 2020

would this change merit an update to UPGRADING.md?

@micahlee
Copy link
Contributor

Superseded by #1999

@micahlee micahlee closed this Jan 19, 2021
@ismarc ismarc deleted the update-resource_update_textsearch-function branch April 13, 2022 19:10
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.

database error after backup and restore
3 participants