MySQL Internals Manual  /  Writing a Procedure  /  Initialization Callback

17.2 Initialization Callback

The initialization callback is registered together with the procedure name in the sql_procs array in

The initialization callback prototype signature looks like this:

 Procedure *(*init)(THD *thd,ORDER *param,select_result *result,
List<Item> &field_list); 

In the initialization callback you usually just create and return an instance of your derived Procedure class:

// Create and register the actual procedure object
 Procedure *proc_rownum_init(THD *thd, 
                             ORDER *param, 
                             select_result *result,
 			     List<Item> &field_list) 
   proc_rownum *pc = new proc_rownum(result);

Download this Manual
EPUB - 0.8Mb
User Comments
Sign Up Login You must be logged in to post a comment.