2134: Fixed sql error in relations modified listener #211
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.
Link to ticket
https://leantime.itkdev.dk/dashboard/show#/tickets/showTicket/2134
Description
Running
app:screen-layouts:load
orapp:template:load
on large installations resulted in a SQL errorThis happened in
App\EventListener\RelationsChecksumListener
because some of the resulting values fromGROUP_CONCAT()
resulted in strings to long to be valid integers. Thereby breaking on subsequent=
comparisons.Adding
DISTINCT
toGROUP_CONCAT()
ensures this doesn't happen given that we are concatenating0's
and1's
. So with theDISTINCT
the only possible results are0
,1
,01
and10
. Because the result of theGROUP_CONCAT()
is only used as anBOOLEAN
/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
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.