DELAEMON BLOG

Live as if you were to die tomorrow. Learn as if you were to live forever.

MySQL UDF UDF_ARGS, UDF_INIT

mysql_com.h

487 typedef struct st_udf_args
488 {
489   unsigned int arg_count;>-->---/* Number of arguments */
490   enum Item_result *arg_type;>-->---/* Pointer to item_results */
491   char **args;>->--->--->---/* Pointer to argument */
492   unsigned long *lengths;>-->---/* Length of string arguments */
493   char *maybe_null;>>--->---/* Set to 1 for all maybe_null args */
494   char **attributes;                    /* Pointer to attribute name */
495   unsigned long *attribute_lengths;     /* Length of attribute arguments */
496   void *extension;
497 } UDF_ARGS;
498
499   /* This holds information about the result */
500
501 typedef struct st_udf_init
502 {
503   my_bool maybe_null;          /* 1 if function can return NULL */
504   unsigned int decimals;       /* for real functions */
505   unsigned long max_length;    /* For string functions */
506   char *ptr;                   /* free pointer for function data */
507   my_bool const_item;          /* 1 if function always returns the same value */
508   void *extension;
509 } UDF_INIT;