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

ILIKE string operator not working for NULL literal (SQLancer) #11872

Closed
2010YOUY01 opened this issue Aug 7, 2024 · 0 comments · Fixed by #12025
Closed

ILIKE string operator not working for NULL literal (SQLancer) #11872

2010YOUY01 opened this issue Aug 7, 2024 · 0 comments · Fixed by #12025
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

Describe the bug

ILIKE string operator is not working for NULL literal, see reproducer in datafusion-cli

DataFusion CLI v40.0.0
> select ((NULL) NOT ILIKE (NULL));
Arrow error: Invalid argument error: Invalid string operation: Null NILIKE Null

However, the same query is supported if null is a value within the table, it's better to keep the behaviour consistent

> create table t1(v1 text, v2 text);
0 row(s) fetched.
Elapsed 0.020 seconds.

> insert into t1 values ('foo', 'foo'), (null, null), ('foo', 'bar');
+-------+
| count |
+-------+
| 3     |
+-------+
1 row(s) fetched.
Elapsed 0.031 seconds.

> select v1 not ilike v2 from t1;
+-----------------------+
| t1.v1 NOT ILIKE t1.v2 |
+-----------------------+
| false                 |
|                       |
| true                  |
+-----------------------+
3 row(s) fetched.
Elapsed 0.013 seconds.

To Reproduce

No response

Expected behavior

No response

Additional context

Found by SQLancer #11030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant