Add FunctionArgExpr and remove Expr::[Qualified]Wildcard, (#378)

* Add FunctionArgExpr and remove Expr::[Qualified]Wildcard,

There is no use case of `Expr::Wildcard` and `Expr::QualifiedWildcard` only except for function argments.
Add `FunctionArgExpr` to have `Wildcard` and `QualifiedWildcard`, and remove wildcards in `Expr`.

* Apply `FunctionArgExpr` to sqlparser_mysql tests
This commit is contained in:
Taehoon Moon 2021-12-15 20:35:37 +09:00 committed by GitHub
parent 4c121a92a6
commit 823635d2fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 120 additions and 61 deletions

View file

@ -314,9 +314,9 @@ fn parse_insert_with_on_duplicate_update() {
id: vec![Ident::new("description".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(Expr::Identifier(Ident::new(
"description"
)))],
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("description"))
))],
over: None,
distinct: false
})
@ -325,9 +325,9 @@ fn parse_insert_with_on_duplicate_update() {
id: vec![Ident::new("perm_create".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(Expr::Identifier(Ident::new(
"perm_create"
)))],
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_create"))
))],
over: None,
distinct: false
})
@ -336,9 +336,9 @@ fn parse_insert_with_on_duplicate_update() {
id: vec![Ident::new("perm_read".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(Expr::Identifier(Ident::new(
"perm_read"
)))],
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_read"))
))],
over: None,
distinct: false
})
@ -347,9 +347,9 @@ fn parse_insert_with_on_duplicate_update() {
id: vec![Ident::new("perm_update".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(Expr::Identifier(Ident::new(
"perm_update"
)))],
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_update"))
))],
over: None,
distinct: false
})
@ -358,9 +358,9 @@ fn parse_insert_with_on_duplicate_update() {
id: vec![Ident::new("perm_delete".to_string())],
value: Expr::Function(Function {
name: ObjectName(vec![Ident::new("VALUES".to_string()),]),
args: vec![FunctionArg::Unnamed(Expr::Identifier(Ident::new(
"perm_delete"
)))],
args: vec![FunctionArg::Unnamed(FunctionArgExpr::Expr(
Expr::Identifier(Ident::new("perm_delete"))
))],
over: None,
distinct: false
})