Some months ago, I wrote a MySQL user-defined procedure (based on sql_analyse.cc). It works well (has survived a test of 200M queries): however, at the moment, I'm reviewing the code and trying to make it more robust. As part of this, I'm trying to send error messages back to the mysql client, and am having considerable difficulty figuring out how to do this. The obvious candidate is net_printf, but this requires a THD object as the first argument, and I'm not clear on how to obtain this, if it is called from within a function which has not received a THD object as its own first argument.
I've tried using the current_thd macro: this apparently returns a valid THD object, but using it as the first argument in a call to net_printf seems to cause the connection with the client to be terminated, and the thread itself to die. Apologies if I'm missing something blatantly obvious (almost certainly the case): I'd be really grateful if someone could point me in the right direction. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]