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

Very large integers and non-numeric floats as parameters #671

Conversation

keitherskine
Copy link
Collaborator

This PR attempts to fix #670 . Currently, conversions from PyLongObject and PyFloatObject type python parameters to C-style values are not checked for success. This PR addresses that.

When converting integers, an Overflow exception is generated by PyLong_AsLongLong() if the integer value is larger than an 8-byte integer can contain. For floats, no exception is generated by PyFloat_AsDouble() for non-numeric float values, but a ProgrammingError is raised by the driver.

It may be better in future to raise DataError exceptions in both cases, but that would require more extensive code changes.

@mkleehammer
Copy link
Owner

Great catch - thanks. I like the tests.

@mkleehammer mkleehammer merged commit 1aef4bc into mkleehammer:master Feb 8, 2020
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

Successfully merging this pull request may close these issues.

Very large integers as parameters
2 participants