17.1.3 send_row()

Prototype: virtual int send_row(List<Item> &fields);

This member is called for every result row in the original result set. Whatever you do here is up to you, it is important to note though that to pass on the result row to the client you have to call result->send_data() yourself.

PROCEDURE ANALYSE() for example does not send any data here, it only produces result rows after aggregating information across all result rows so its send_row() member only aggregates but doesn't send anything.

A simple example which modifies the result value for a single field in the field list before sending it on to the client:

int proc_rownum::send_row(List<Item> &field_list __attribute__((unused)))
   // increment row count and set its new value in result row

   // now send the modified results
   if (result->send_data(field_list))

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