Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.8.0
-
None
-
None
Description
Currently we are allowing setting a not matching data type value in a stored routine parameter default value. The error is caught when we invoke the routine at the run time. Ideally it should be handled at the creation time itself as it's done for CREATE TABLE.
Repro
------
11.8.0-opt>DELIMITER $$
|
11.8.0-opt>CREATE OR REPLACE PROCEDURE sp1(p1 INT DEFAULT 'x') BEGIN SELECT p1 FROM DUAL; END $$ |
Query OK, 0 rows affected (0.006 sec) |
 |
11.8.0-opt>DELIMITER ;
|
11.8.0-opt>CALL sp1();
|
ERROR 1366 (22007): Incorrect integer value: 'x' for column ``.``.`p1` at row 0 |
Expected behavior:
It should be similar to table creation.
11.8.0-opt>CREATE TABLE t2 (i INT DEFAULT 'x'); |
ERROR 1067 (42000): Invalid default value for 'i' |
Attachments
Issue Links
- is caused by
-
MDEV-10862 Stored procedures: default values for parameters (optional parameters)
- In Testing