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

Error evaluating clause where COL_BIGINT < 1e100 (Found by SQLancer-NoREC) #11252

Closed
2010YOUY01 opened this issue Jul 3, 2024 · 1 comment · Fixed by #11297
Closed

Error evaluating clause where COL_BIGINT < 1e100 (Found by SQLancer-NoREC) #11252

2010YOUY01 opened this issue Jul 3, 2024 · 1 comment · Fixed by #11297
Assignees
Labels
bug Something isn't working

Comments

@2010YOUY01
Copy link
Contributor

Describe the bug

When a BIGINT typed column is comparing with a large DOUBLE literal, it's not evaluated correct if it's in where clause

> create table t0(v0 BIGINT);
0 row(s) fetched.
Elapsed 0.003 seconds.

> insert into t0 values (1),(2),(3);
+-------+
| count |
+-------+
| 3     |
+-------+
1 row(s) fetched.
Elapsed 0.003 seconds.

> select * from t0 where v0>1e100;
Arrow error: Cast error: Can't cast value 1.0000000000000002e100 to type Int64

But if this comparison clause is in SELECT clause, it can be evaluated successfully. Such inconsistency should be a bug.

> select v0>1e100 from t0;
+------------------------------------------------------------------------------------------------------------------------+
| t0.v0 > Float64(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) |
+------------------------------------------------------------------------------------------------------------------------+
| false                                                                                                                  |
| false                                                                                                                  |
| false                                                                                                                  |
+------------------------------------------------------------------------------------------------------------------------+
3 row(s) fetched.
Elapsed 0.003 seconds.

To Reproduce

No response

Expected behavior

No response

Additional context

PostgreSQL and DuckDB can evaluate both queries successfully.

Found by SQLancer #11030

@2010YOUY01 2010YOUY01 added the bug Something isn't working label Jul 3, 2024
@Lordworms
Copy link
Contributor

take

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.

2 participants