Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Runji Wang <[email protected]>
  • Loading branch information
wangrunji0408 committed Sep 11, 2023
1 parent 31fccb7 commit 90fdc65
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
sql: |
create table t (v1 timestamp, v2 real);
insert into t select time '01:02:03', 4.5 from t;
binder_error: 'Bind error: cannot cast type "time without time zone" to "timestamp without time zone" in Assign context'
binder_error: 'Bind error: cannot cast type "time" to "timestamp" in Assign context'
- name: insert into select mismatch columns length
sql: |
create table t (v1 int, v2 real);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
Bind error: failed to bind expression: (country + country)
Caused by:
Feature is not yet implemented: Add[Struct, Struct]
Feature is not yet implemented: Add[Struct(StructType { field_names: ["address", "zipcode"], field_types: [Varchar, Varchar] }), Struct(StructType { field_names: ["address", "zipcode"], field_types: [Varchar, Varchar] })]
Tracking issue: https://github.com/risingwavelabs/risingwave/issues/112
create_source:
format: plain
Expand Down
7 changes: 4 additions & 3 deletions src/frontend/src/expr/type_inference/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub fn infer_some_all(
if !matches!(&element_type, Some(e) if sig.inputs_type[1].matches(e)) {
let SigDataType::Exact(t) = &sig.inputs_type[1] else {
return Err(ErrorCode::BindError(
"array of array/struct on left are not supported yet".into(),
"array/struct on left are not supported yet".into(),
)
.into());
};
Expand Down Expand Up @@ -756,9 +756,9 @@ fn narrow_category<'a>(
// candidate.
let Ok(selected) = &category else { continue };
// least_restrictive or mark temporary conflict err
if implicit_ok(formal.as_exact(), selected, true) {
if formal.is_exact() && implicit_ok(formal.as_exact(), selected, true) {
// noop
} else if implicit_ok(selected.as_exact(), formal, false) {
} else if selected.is_exact() && implicit_ok(selected.as_exact(), formal, false) {
category = Ok(formal);
} else {
category = Err(());
Expand All @@ -785,6 +785,7 @@ fn narrow_category<'a>(
};
formal == *selected
|| !is_preferred(selected)
&& formal.is_exact()
&& implicit_ok(formal.as_exact(), selected, false)
})
})
Expand Down

0 comments on commit 90fdc65

Please sign in to comment.