Skip to content

Commit 8b38916

Browse files
committed
Fixed incorrect expected/inferred order in UnexpectedType error for SQL UPDATE.
1 parent c99dc82 commit 8b38916

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/expr/src/statement.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ pub fn type_insert(insert: SqlInsert, tx: &impl SchemaView) -> TypingResult<Tabl
132132
values.push(AlgebraicValue::String(v));
133133
}
134134
(SqlLiteral::Bool(_), _) => {
135-
return Err(UnexpectedType::new(&AlgebraicType::Bool, ty).into());
135+
return Err(UnexpectedType::new(ty, &AlgebraicType::Bool).into());
136136
}
137137
(SqlLiteral::Str(_), _) => {
138-
return Err(UnexpectedType::new(&AlgebraicType::String, ty).into());
138+
return Err(UnexpectedType::new(ty, &AlgebraicType::String).into());
139139
}
140140
(SqlLiteral::Hex(v), ty) | (SqlLiteral::Num(v), ty) => {
141141
values.push(parse(&v, ty).map_err(|_| InvalidLiteral::new(v.into_string(), ty))?);
@@ -199,10 +199,10 @@ pub fn type_update(update: SqlUpdate, tx: &impl SchemaView) -> TypingResult<Tabl
199199
values.push((*col_id, AlgebraicValue::String(v)));
200200
}
201201
(SqlLiteral::Bool(_), _) => {
202-
return Err(UnexpectedType::new(&AlgebraicType::Bool, ty).into());
202+
return Err(UnexpectedType::new(ty, &AlgebraicType::Bool).into());
203203
}
204204
(SqlLiteral::Str(_), _) => {
205-
return Err(UnexpectedType::new(&AlgebraicType::String, ty).into());
205+
return Err(UnexpectedType::new(ty, &AlgebraicType::String).into());
206206
}
207207
(SqlLiteral::Hex(v), ty) | (SqlLiteral::Num(v), ty) => {
208208
values.push((

0 commit comments

Comments
 (0)