| Bug #18466 | add REPLACE to CREATE FUNCTION, PROCEDURE, TRIGGER | ||
|---|---|---|---|
| Submitted: | 23 Mar 2006 18:37 | Modified: | 26 Apr 2006 13:26 |
| Reporter: | vadim likhota | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: DDL | Severity: | S4 (Feature request) |
| Version: | 5.0.x | OS: | Any (all) |
| Assigned to: | CPU Architecture: | Any | |
[23 Mar 2006 18:51]
vadim likhota
small fix in synopsis
[26 Apr 2006 13:26]
Valeriy Kravchuk
Thank you for a reasonable feature request. Maybe, more "MySQL way" to implement it would be: CREATE PROCEDURE [IF NOT EXISTS] proc_name ...
[13 Aug 2010 3:07]
Federico Razzoli
I agree with Vadim. With IF [NOT] EXISTS, I have to execute 2 statements: DROP ... IF EXISTS CREATE ... With REPLACE (wich is supported in CREATE VIEW) I can execute 1 statement. I whink this clause could be added to other statements too: * CREATE EVENT * CREATE USER * CREATE SERVER I agree with this request because I think it doesn't require too much work.

Description: Please, add the optional parameter OR REPLACE to CREATE FUNCTION, PROCEDURE, TRIGGER statements so that you don't have to use DROP FUNCTION, PROCEDURE, TRIGGER statements for replacement. How to repeat: now: CREATE [DEFINER = { user | CURRENT_USER }] PROCEDURE sp_name ([proc_parameter[,...]]) [characteristic ...] routine_body CREATE [DEFINER = { user | CURRENT_USER }] FUNCTION sp_name ([func_parameter[,...]]) RETURNS type [characteristic ...] routine_body CREATE [DEFINER = { user | CURRENT_USER }] TRIGGER trigger_name trigger_time trigger_event ON tbl_name FOR EACH ROW trigger_stmt Suggested fix: need: CREATE [OR REPLACE] [DEFINER = { user | CURRENT_USER }] PROCEDURE sp_name ([proc_parameter[,...]]) [characteristic ...] routine_body CREATE [OR REPLACE] [DEFINER = { user | CURRENT_USER }] FUNCTION sp_name ([func_parameter[,...]]) RETURNS type [characteristic ...] routine_body CREATE [OR REPLACE] [DEFINER = { user | CURRENT_USER }] TRIGGER trigger_name trigger_time trigger_event ON tbl_name FOR EACH ROW trigger_stmt