[FIX] SQL: Fix the issue with database collation setting when retrieving column values #5089
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.
Issue
The database can have different collation settings (how to compare characters in the group by, distinct, ...). It has an impact on values we get when we retrieve all distinct values from column to create a discrete variable. If a collation is Latin it ignores utf8 characters, it can even be case insensitive. When creating variable we still want to have all possible values in the column since later when we retrieve actual data for a table (SELECT * FROM Table) we get values as they are (collation does not have an effect).
Description of changes
This PR implements a workaround for GROUP BY in cases when we want all values to create a variable.
Includes