Skip to content

Treat autoremove builds query parameter as integer#1627

Merged
williamjallen merged 2 commits into
Kitware:masterfrom
williamjallen:autoremove-query-limit-param
Aug 9, 2023
Merged

Treat autoremove builds query parameter as integer#1627
williamjallen merged 2 commits into
Kitware:masterfrom
williamjallen:autoremove-query-limit-param

Conversation

@williamjallen
Copy link
Copy Markdown
Collaborator

@williamjallen williamjallen commented Aug 8, 2023

The query parameter for the limit clause in one of the build autoremoval scripts is currently being passed to the database as a string. This is problematic, and prints the following message to the logs:
production.ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''500'' at line 9

MySQL does a limited amount of type conversion, but does not extend the type conversion to limit clauses. By passing the query parameter as an integer, the problem will be resolved.

I also addressed the only other case of this type of bug, even though it's not directly related to the bug report per se.

This PR is a good example of why passing numeric strings around is a bad idea...

@williamjallen williamjallen force-pushed the autoremove-query-limit-param branch from 7a8c576 to 7dce1de Compare August 8, 2023 22:15
@williamjallen williamjallen force-pushed the autoremove-query-limit-param branch from 56e4c0c to e56d936 Compare August 8, 2023 22:36
@zackgalbreath zackgalbreath added this pull request to the merge queue Aug 9, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 9, 2023
@williamjallen williamjallen added this pull request to the merge queue Aug 9, 2023
Merged via the queue into Kitware:master with commit a4abe5c Aug 9, 2023
@williamjallen williamjallen deleted the autoremove-query-limit-param branch August 9, 2023 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants