-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
executor: fix json_objectagg() on varbinary type #27119
base: master
Are you sure you want to change the base?
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-check_dev_2 |
@@ -109,6 +111,21 @@ func (e *jsonObjectAgg) UpdatePartialResult(sctx sessionctx.Context, rowsInGroup | |||
keyString = stringutil.Copy(keyString) | |||
|
|||
realVal := value.Clone().GetValue() | |||
// Special handling for varbinary | |||
if e.args[1].GetType().Tp == mysql.TypeVarchar && mysql.HasBinaryFlag(e.args[1].GetType().Flag) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's not only for json_objectagg(). json_object() also has same behavior.
mysql> select json_object( col_2, col_3 ) from tbl_0;
+-----------------------------+
| json_object( col_2, col_3 ) |
+-----------------------------+
| {"1": "base64:type15:bw=="} |
+-----------------------------+
We also need handle binary type.
mysql> select json_object( col_2, col_3 ) from tbl_0;
+------------------------------+
| json_object( col_2, col_3 ) |
+------------------------------+
| {"1": "base64:type254:bwA="} |
+------------------------------+
@wzru could you look up in mysql's doc about what is type:15? |
What problem does this PR solve?
Issue Number: close #25053
Problem Summary:
expected:
obtained:
What is changed and how it works?
What's Changed:
func (e *jsonObjectAgg) UpdatePartialResult
implementationHow it Works:
add special handling for varbinary
Check List
Tests
Side effects
Documentation
Release note