MySQL Internals Manual  /  Writing a Procedure  /  Calling Sequence

18.3 Calling Sequence

The init callback is always called first at the beginning of a query, followed by a call to the Section 18.1.2, “change_columns()”. The Section 18.1.6, “end_of_records()” member is always called last at the very end.

For simple non-grouping queries only Section 18.1.3, “send_row()” is called once for each result row.

For grouping queries add() is called once for each source row. Section 18.1.5, “end_group()” is called once at the end of each group followed by a call to Section 18.1.3, “send_row()”.

You cann use the CALLTRACE() procedure to check in which sequence the member functions are called on any query. This procedure will send one result row for each member function call, every row contains a single text field with one of the values add, end_group, end_of_records or send_row.

User Comments
Sign Up Login You must be logged in to post a comment.