Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
If i create a stored procedure with an input parameter specified as an INT, I expect the procedure to fail when a non-INT value is provided in a call.
Instead, if a user calls a procedure thus:
call my_db.my_sproc(5.47);
|
mariadb rounds 5.47 to 5.
I expect the stored procedure to throw an error. If the input procedure is VARCHAR(10) and the user inputs a VARCHAR(20) the procedure throws an error. It does not truncate the input parameter to 10 characters and silently move on.
Worse, I don't even have the opportunity to intercept the input variable and check it. By the time it is available in the body of the stored procedure it is already rounded to an INT.
The work around that I can do is specify the input parameter as a DOUBLE and then it is not rounded. I can then access it in the body of the stored procedure and see if it is actually an int or not. However this is not ideal. We have many stored procedures with input parameters specified as INTs.
I thought perhaps there would be a way to determine the treatment of INTs in sql_mode or some other setting, but was unable to find anything.
Thanks,
Kevin