<div>Hi,</div><div>I've been doing some research for routines, triggers and events. I feel that comparing to the Ajaxify job, this job may give me greater sense of achievement. But, I insist, as the ajaxification of PMA is just started, it's very essential to build a common framework on request processing and do some refactor work. So I still hope that I can take the Ajaxify work,rather than 'Support for Procedure'.</div>
<div><br></div><div>So the following is my ideas for 'Support for Procedure', please give me some suggestions.</div><div><br></div><div>1 main page for routines,triggers and events.</div><div>I prefer to create a new tab in table view for routines,triggers and events together, create three (or four) html table for them, in each table their metadatas and some operation icons are displayed. the operation icons include "alter","delete", and for functions and procedures, "call". Besides, User can create new items and perform multi-item operation.</div>
<div>INFORMATION_SCHEMA does not have a PARAMETERS Table until MySQL 5.5, so for the older version the parameter of routines cannot be seen in this main page.</div><div><br></div><div>Then I'll develop seperate mananging module for routines,triggers and events.In ajax mode, it'll display in a popup JQuery UI Dialog and as a new page otherwise.</div>
<div>2 stored procedures and functions</div><div>User need to fill in:</div><div>Definer;(select;default:current user, this should set unchangable if user do not have SUPER privilege;else it will be a list box)</div><div>
Routine Type:(select;Procedure or Function)</div><div>Procedure or Function Name;(text-input)</div><div>Parameter List;(including:select:[IN | OUT | INOUT],text-input:param_name and select:type. for function, every param is IN;the type options should include the enum type which is defined in the table. for MySQL 5.5- , we need to fetch the parameter list from SHOW CREATE PROCEDURE command)</div>
<div>Characteristic:</div><div>COMMENT;(text-input)</div><div>LANGUAGE;(According to the MYSQL official doc, actually only SQL is accepted)</div><div>DETERMINISTIC;(checkbox;default:Yes )</div><div>SQL SECURITY;(radio;default:Definer)</div>
<div>other characteristics;(radio{CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA},only advisory to the server)</div><div>Return type;(the same as type in Parameter List.for function only)</div><div>Routine_body;(textarea)</div>
<div><br></div><div>users can call a procedure or function in the main page. If a Procedure returns by OUT or INOUT params, we'll add a select statement after calling.</div><div><br></div><div>3 triggers</div><div>CREATE Trigger requires SUPER priviledge, so non-SUPER user shouldn't access the this managing page.</div>
<div><br></div><div>User need to fill in:</div><div>Definer;(select;default:current user)</div><div>Trigger name;(text-input)</div><div>Trigger time;(select;BEFORE or AFTER)</div><div>Trigger event;(select;INSERT|UPDATE|DELETE)</div>
<div>Trigger body;(textarea)</div><div><br></div><div>Users don't have to input table name because we already know which table this trigger attached to.</div><div><br></div><div>4 events</div><div>User need to fill in:</div>
<div>Definer;(select;default:current user, this should set unchangable if user do not have SUPER privilege;else it will be a combo box)</div><div>Event_name;(text-input)</div><div>Schedule:</div><div>At timestamp(+ interval)(text-input + select)</div>
<div>or</div><div>Every interval Starts(...) Ends(...)(text-input + select);</div><div>ON COMPLETION [OR NOT] PRESERVE;(selet;defautl no)</div><div>ENABLE | DISABLE | DISABLE ON SLAVE;(select;default ENABLE)</div><div>COMMENT;(text-input)</div>
<div>Event Body;(textarea)</div><div><br></div><div>5 editor for routines,triggers and events</div><div>There are plenty of restrictions for them, in <a href="http://dev.mysql.com/doc/mysql-reslimits-excerpt/5.5/en/stored-program-restrictions.html">http://dev.mysql.com/doc/mysql-reslimits-excerpt/5.5/en/stored-program-restrictions.html</a></div>
<div>so IMO, we can warn the user when he's inputting some illegal statements. </div><div><br></div><div>And still, I have some questions. Does mysql have some statistics on triggers and events?Can a procedure output some data directly and meanwhile return some value with OUT|INOUT param?</div>
<div><br></div>