48 my_bool
rand_mt_init(UDF_INIT *initid, UDF_ARGS *args,
char *message) {
51 strcpy(message,
"libsqlstat plugin is not loaded. "
52 "Use 'INSTALL PLUGIN' for installation.");
56 if (args->arg_count != 0) {
57 strcpy(message,
"rand_mt() requires no argument");
61 initid->maybe_null = 0;
63 initid->max_length = 13 + initid->decimals;
65 initid->const_item = 0;
81 double rand_mt(UDF_INIT *initid, UDF_ARGS *args,
char *is_null,
char *error) {
Definition of functions for UDFs and plugins.
double rand_mt(UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
Retrieve Mersenne Twister random number.
Definitions for random number generations.
my_bool rand_mt_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
Called before first usage of function.
static double nextDouble()
Returns random double number.
void rand_mt_deinit(UDF_INIT *initid)
Called after last access to function.
#define NOT_FIXED_DEC
Maximum number of digits in double As defined in mysql/sql_string.h.
Mersenne Twister random number generator.
int sqlstat_plugin_isloaded()
Check if plugin loaded.