Skip to content
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

[14.0] Fix JSON functions parsing #11624

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -2519,23 +2519,20 @@ type (
Expr Expr
}

// JSONPathParam is used to store the path used as arguments in different JSON functions
JSONPathParam Expr

// JSONContainsExpr represents the function and arguments for JSON_CONTAINS()
// For more information, see https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-contains
JSONContainsExpr struct {
Target Expr
Candidate Expr
PathList []JSONPathParam
PathList []Expr
}

// JSONContainsPathExpr represents the function and arguments for JSON_CONTAINS_PATH()
// For more information, see https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-contains-path
JSONContainsPathExpr struct {
JSONDoc Expr
OneOrAll Expr
PathList []JSONPathParam
PathList []Expr
}

// JSONContainsPathType is an enum to get types of Trim
Expand All @@ -2545,14 +2542,14 @@ type (
// For more information, see https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-extract
JSONExtractExpr struct {
JSONDoc Expr
PathList []JSONPathParam
PathList []Expr
}

// JSONKeysExpr represents the function and arguments for JSON_KEYS()
// For more information, see https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-keys
JSONKeysExpr struct {
JSONDoc Expr
PathList []JSONPathParam
JSONDoc Expr
Path Expr
}

// JSONOverlapsExpr represents the function and arguments for JSON_OVERLAPS()
Expand All @@ -2569,14 +2566,14 @@ type (
OneOrAll Expr
SearchStr Expr
EscapeChar Expr
PathList []JSONPathParam
PathList []Expr
}

// JSONValueExpr represents the function and arguments for JSON_VALUE()
// For more information, see https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-value
JSONValueExpr struct {
JSONDoc Expr
Path JSONPathParam
Path Expr
ReturningType *ConvertType
EmptyOnResponse *JtOnResponse
ErrorOnResponse *JtOnResponse
Expand Down Expand Up @@ -2608,7 +2605,7 @@ type (
JSONAttributesExpr struct {
Type JSONAttributeType
JSONDoc Expr
Path JSONPathParam
Path Expr
}

// JSONAttributeType is an enum to get types of TrimFunc.
Expand Down
178 changes: 11 additions & 167 deletions go/vt/sqlparser/ast_clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading