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

Unexpected results when integer overflow #7094

Closed
2 tasks done
DerZc opened this issue Apr 15, 2023 · 2 comments
Closed
2 tasks done

Unexpected results when integer overflow #7094

DerZc opened this issue Apr 15, 2023 · 2 comments
Labels

Comments

@DerZc
Copy link

DerZc commented Apr 15, 2023

What happens?

Consider the following program:

CREATE TABLE t0(c1 INT8);
INSERT INTO t0(c1) VALUES ((1));

SELECT t0.c1 FROM t0 WHERE (((-1314689763))+((-1947665992))<=((false)));  -- 1

SELECT t0.c1 FROM t0 WHERE (((-1314689763))+((-1947665992))<=( EXISTS(SELECT t0.c1 FROM t0 WHERE false)));  --  0 rows

In the second query, the condition of subquery is FLASE, so these two queries should be equivalent. But these two queries have different results.

I tried this query SELECT ((-1314689763))+((-1947665992)) FROM t0; and get an error message Error: near line 20: Out of Range Error: Overflow in addition of INT32 (-1314689763 + -1947665992)!. I am not sure if the second query didn't catch the integer overflow.

To Reproduce

I build duckdb from the latest commit version eaf5070

OS:

ubuntu 22.04

DuckDB Version:

eaf5070

DuckDB Client:

CLI

Full Name:

Chi Zhang

Affiliation:

Nanjing University, National University of Singapore

Have you tried this on the latest master branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree
@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Jul 29, 2023
@github-actions
Copy link

This issue was closed because it has been stale for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant