-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
expression: fix the arg verification for json functions. #54145
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Yang Keao <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@YangKeao: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@YangKeao: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #54145 +/- ##
=================================================
- Coverage 72.8813% 56.0615% -16.8198%
=================================================
Files 1519 1639 +120
Lines 434852 605436 +170584
=================================================
+ Hits 316926 339417 +22491
- Misses 98376 242844 +144468
- Partials 19550 23175 +3625
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/hold Also consider #54044 (comment). Maybe it's not good to verify args type/charset in |
@@ -727,7 +727,7 @@ Error 3146 (22032): Invalid data type for JSON data in argument 1 to function js | |||
SELECT JSON_OVERLAPS('{}', 123); | |||
Error 3146 (22032): Invalid data type for JSON data in argument 2 to function json_overlaps; a JSON string or JSON type is required. | |||
SELECT 'abc' MEMBER OF(123); | |||
Error 3146 (22032): Invalid data type for JSON data in argument 2 to function member of; a JSON string or JSON type is required. | |||
Error 3146 (22032): Invalid data type for JSON data in argument 2 to function json_memberof; a JSON string or JSON type is required. |
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 this error need to be fixed.
MySQL v8.4.0:
mysql-8.4.0> SELECT 'abc' MEMBER OF (123);
ERROR 3146 (22032): Invalid data type for JSON data in argument 2 to function member of; a JSON string or JSON type is required.
This is a weird function syntax wise...
return ErrInvalidTypeForJSON.GenWithStackByArgs(2, "member of") | ||
} | ||
return nil | ||
return verifyJSONArgsType(ctx, c.funcName, true, args, 1) |
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.
return verifyJSONArgsType(ctx, c.funcName, true, args, 1) | |
return verifyJSONArgsType(ctx, "member of", true, args, 1) |
What problem does this PR solve?
Issue Number: close #54029
Problem Summary:
For some json functions, the arg verification is not implemented correctly:
json_type
, it didn't verify the type of args.What changed and how does it work?
Add a unified function to verify the args of json functions.
Check List
Tests
Release note