Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug mysql user-defined function?

I have a mysql function, i want to debug it, set breakboints, see variables values on that time period etc. How to do it ?

like image 993
afftee Avatar asked Oct 21 '25 02:10

afftee


1 Answers

From my current search so far (though I might have missed something) I have to agree with Devart that you cannot debug UDF functions.

One extra advice to give you is to use the stderr for debugging. I've crafted something rather simple to work with:

void udf_debug( char *msg, ... ) {
#ifdef DEBUG
  va_list ap;

  va_start(ap, msg);
  vfprintf(stderr, msg, ap);
  va_end(ap);

  fflush(stderr);
#endif
}
like image 99
mobius Avatar answered Oct 25 '25 13:10

mobius