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

sql: panic with POW #10311

Closed
maddyblue opened this issue Oct 30, 2016 · 2 comments
Closed

sql: panic with POW #10311

maddyblue opened this issue Oct 30, 2016 · 2 comments

Comments

@maddyblue
Copy link
Contributor

SELECT pow(4.58966308373723e-06, -3.1962622854859143e+33)

The panic is in the inf package.

Found with RSG.

@maddyblue
Copy link
Contributor Author

@RaduBerinde could you investigate this? If you add

{"0.00000458966308373723", "-3196262285", ""},

to util/decimal/decimal_test.go:TestDecimalPow it'll produce the panic.

It's because the exponent precision calculation in pow is computing a large value for numDigits*yu, which overflows to a negative when converted to an int32.

@maddyblue
Copy link
Contributor Author

I've figured this out I think. No need to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant