Skip to content

2134: Fixed sql error in relations modified listener #211

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

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

turegjorup
Copy link
Contributor

@turegjorup turegjorup commented Aug 20, 2024

Link to ticket

https://leantime.itkdev.dk/dashboard/show#/tickets/showTicket/2134

Description

Running app:screen-layouts:load or app:template:load on large installations resulted in a SQL error

SQLSTATE[22003]: Numeric value out of range: 1916 Got overflow when converting '' to DECIMAL. Value truncated 

This happened in App\EventListener\RelationsChecksumListener because some of the resulting values from GROUP_CONCAT()resulted in strings to long to be valid integers. Thereby breaking on subsequent = comparisons.

Adding DISTINCT to GROUP_CONCAT() ensures this doesn't happen given that we are concatenating 0's and 1's . So with the DISTINCT the only possible results are 0, 1, 01and 10. Because the result of the GROUP_CONCAT() is only used as an BOOLEAN/ TINYINT this doesn't change the function of the query.

Screenshot of the result

If your change affects the user interface you should include a screenshot of the result with the pull request.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

If your code does not pass all the requirements on the checklist you have to add a comment explaining why this change
should be exempt from the list.

Additional comments or questions

If you have any further comments or questions for the reviewer please add them here.

@turegjorup turegjorup self-assigned this Aug 20, 2024
@turegjorup turegjorup merged commit dce7fcc into main Aug 20, 2024
13 checks passed
@turegjorup turegjorup deleted the hotfix/2.0.7 branch March 31, 2025 18:49
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.

1 participant