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

MAX_INT / 1 results in overflow #629

Open
DominicWuest opened this issue Apr 11, 2024 · 1 comment
Open

MAX_INT / 1 results in overflow #629

DominicWuest opened this issue Apr 11, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@DominicWuest
Copy link

I found a discrepancy when running two semantically equivalent queries against an empty database:


1:

RETURN 9223372036854775807

Produces:

9223372036854775807

2:

RETURN 9223372036854775807 / 1

Produces:

-9223372036854775808

I believe the queries mentioned above are semantically equivalent and thus their result should be the same.

Also, I think it may be unexpected behaviour to have an overflow when dividing MAX_INT by 1.

I encountered this issue when testing queries on the FalkorDB master branch in a Docker container running redis:7.2.3-bookworm.

Steps to reproduce

Run the aforementioned, semantically equivalent, queries against an empty database and observe that their results differ.

Expected behavior

The queries should result in the same behavior

Actual behavior

The query results differ

@swilly22
Copy link
Contributor

Hi @DominicWuest,

Thank you for brining this to our attention, to be honest I'm not if this issue will get priority as int64 overflows are quite rare to encounter and the overhead of checking for an overflow on each operation might not be worth it.

I'm going to leave this issue open for the time being.

@swilly22 swilly22 added the bug Something isn't working label Apr 12, 2024
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

No branches or pull requests

2 participants