Bug #67201 Optional parameters in a stored procedure
Submitted: 12 Oct 2012 5:45 Modified: 30 Dec 2012 6:48
Reporter: Mikhail Gavrilov Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[12 Oct 2012 5:45] Mikhail Gavrilov
Description:
Be great if we can set optional parameters in a stored procedure by declatation.

for example:

CREATE DEFINER=`root`@`localhost` PROCEDURE `workflow_set_result`(
	IN par_id_result INT(10) UNSIGNED,
	IN par_id_task INT(10) UNSIGNED,
	IN par_id_user INT(10) UNSIGNED,
	IN par_note TEXT,
	IN par_id_user_assign INT(10) UNSIGNED DEFAULT NULL
)
BEGIN  
...
END$$

This means procedure workflow_set_result can be used
CALL workflow_set_result(par1, par2, par3, par4, par5)
and also without par5 
CALL workflow_set_result(par1, par2, par3, par4)
in this case par_id_user_assign inside procedure setted by NULL value.

How to repeat:
-
[30 Dec 2012 6:48] Shane Bester
duplicate of http://bugs.mysql.com/bug.php?id=15975