Fix MySQL visibility GroupBy bug #8879
Merged
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.
What changed?
If the group by key is returned as
[]byte, convert it to string inCountWorkflowExecutionsandCountCHASMExecutions.Why?
The Go driver for MySQL returns
VARCHARcolumns as[]byte. This is apparently not true of our other persistence backends.How did you test it?
Potential risks
Could break workflow visibility queries if this change is not correct.
Note
Handle MySQL driver returning VARCHAR as []byte for group-by keys and add tests decoding/validating group values.
parseCountGroupByGroupValueincommon/persistence/sql/sqlplugin/visibility.goto convert[]bytetostringfor non-ExecutionStatusgroup-by values (MySQL VARCHAR scan behavior).tests/chasm_test.go(TestCountExecutions_GroupBy), decodegroup.Values[0]and assert it is one of"Running"or"Completed"; keep error case for unsupportedGROUP BY.Written by Cursor Bugbot for commit a837b5b. This will update automatically on new commits. Configure here.