mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-23 23:44:07 +00:00
add support for update statements that contain tuple assignments (#1317)
This commit is contained in:
parent
0330f9def5
commit
345e2098fb
7 changed files with 114 additions and 24 deletions
|
@ -1557,7 +1557,7 @@ fn parse_pg_on_conflict() {
|
|||
assert_eq!(
|
||||
OnConflictAction::DoUpdate(DoUpdate {
|
||||
assignments: vec![Assignment {
|
||||
id: vec!["dname".into()],
|
||||
target: AssignmentTarget::ColumnName(ObjectName(vec!["dname".into()])),
|
||||
value: Expr::CompoundIdentifier(vec!["EXCLUDED".into(), "dname".into()])
|
||||
},],
|
||||
selection: None
|
||||
|
@ -1588,14 +1588,14 @@ fn parse_pg_on_conflict() {
|
|||
OnConflictAction::DoUpdate(DoUpdate {
|
||||
assignments: vec![
|
||||
Assignment {
|
||||
id: vec!["dname".into()],
|
||||
target: AssignmentTarget::ColumnName(ObjectName(vec!["dname".into()])),
|
||||
value: Expr::CompoundIdentifier(vec![
|
||||
"EXCLUDED".into(),
|
||||
"dname".into()
|
||||
])
|
||||
},
|
||||
Assignment {
|
||||
id: vec!["area".into()],
|
||||
target: AssignmentTarget::ColumnName(ObjectName(vec!["area".into()])),
|
||||
value: Expr::CompoundIdentifier(vec!["EXCLUDED".into(), "area".into()])
|
||||
},
|
||||
],
|
||||
|
@ -1645,7 +1645,7 @@ fn parse_pg_on_conflict() {
|
|||
assert_eq!(
|
||||
OnConflictAction::DoUpdate(DoUpdate {
|
||||
assignments: vec![Assignment {
|
||||
id: vec!["dname".into()],
|
||||
target: AssignmentTarget::ColumnName(ObjectName(vec!["dname".into()])),
|
||||
value: Expr::Value(Value::Placeholder("$1".to_string()))
|
||||
},],
|
||||
selection: Some(Expr::BinaryOp {
|
||||
|
@ -1682,7 +1682,7 @@ fn parse_pg_on_conflict() {
|
|||
assert_eq!(
|
||||
OnConflictAction::DoUpdate(DoUpdate {
|
||||
assignments: vec![Assignment {
|
||||
id: vec!["dname".into()],
|
||||
target: AssignmentTarget::ColumnName(ObjectName(vec!["dname".into()])),
|
||||
value: Expr::Value(Value::Placeholder("$1".to_string()))
|
||||
},],
|
||||
selection: Some(Expr::BinaryOp {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue