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

repr: make WMR type coercion more like SQL #23633

Closed
Closed
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
2 changes: 1 addition & 1 deletion src/repr/src/relation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl RelationType {
if col1.nullable && !col2.nullable {
return false;
}
if col1.scalar_type != col2.scalar_type {
if !col1.scalar_type.base_eq(&col2.scalar_type) {
return false;
}
}
Expand Down
11 changes: 11 additions & 0 deletions test/sqllogictest/with_mutually_recursive.slt
Original file line number Diff line number Diff line change
Expand Up @@ -607,3 +607,14 @@ statement error db error: ERROR: Invalid WITH MUTUALLY RECURSIVE recursion limit
WITH MUTUALLY RECURSIVE (RECURSION LIMIT 0)
cnt (i int) AS (SELECT 1 AS i UNION SELECT i+1 FROM cnt)
SELECT * FROM cnt;

# Test WMR coercion
statement ok
CREATE TABLE y (a BIGINT);

query I
WITH MUTUALLY RECURSIVE
bar(x NUMERIC) as (SELECT sum(a) FROM y)
SELECT * FROM bar
----
NULL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we adjust this test case to test something more interesting than the base case? Ideally something that lets us "see" the coercion.