Improve the Error message thrown in case the JS code in stored function returns special number like Infinity, -Infinity or NaN.

Description

In JS function if there is division by zero then JS code returns Infinity which is of type Number. But the resulting datatype in mysql by the JS stored routine is of String type with value 'Infinity'. Hence if such error occurs in some function which has Integer return type and the resulting return value is Infinity we get the error "ERROR 1366 (HY000): Incorrect integer value: 'Infinity' for column 'test(231)' at row 1"

Better to have more meaningful error message maybe like out of range ERROR as we see in case the RETURN type is DOUBLE/FLOAT.

Environment

None

Activity

Show:

Details

Assignee

Reporter

Needs QA

Yes

Priority

Smart Checklist

Created February 18, 2025 at 9:48 AM
Updated February 18, 2025 at 11:22 AM