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

Throw exception for cast of nan and infinity to int types #22917

Merged
merged 1 commit into from
Jun 5, 2024

Commits on Jun 5, 2024

  1. Throw exception for cast of nan and infinity to int types

    Fix cast of nan and infinity from DOUBLE/REAL to
    BIGINT/INT/SMALLINT/TINYTINT.  Previously all except double -> bigint
    would return zero.  Now they will all throw an INVALID_CAST_ARGUMENT
    exception.
    
    Fix silent overflow for casting from REAL to BIGINT type. We now throw
    an INVALID_CAST_ARGUMENT if the value is out of the BIGINT range.
    
    Change error code from NUMERIC_VALUE_OUT_OF_RANGE to
    INVALID_CAST_ARGUMENT for out of range values in casts from floating
    point to integer types.  With the library we now use for the
    implementaiton for these casts, we can't always tell by the exception
    type that the value is out of range, so we return the more generic, but
    still relevant INVALID_CAST_ARGUMENT instead.
    rschlussel committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    45ef7e3 View commit details
    Browse the repository at this point in the history