Improve the Error message thrown in case the JS code in stored function returns special number like Infinity, -Infinity or NaN.
General
Escalation
General
Escalation
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.
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.