Statistics for MySQL  0.9
Classes | Functions
skewness_samp.c File Reference

Sample moment coefficient of skewness. More...

#include "sqlstat.h"
Include dependency graph for skewness_samp.c:

Go to the source code of this file.

Classes

struct  skewness_samp_storage
 Storage for sample moment coefficient of skewness. More...

Functions

my_bool skewness_samp_init (UDF_INIT *initid, UDF_ARGS *args, char *message)
 Called before first usage of function.
void skewness_samp_reset (UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
 Reset function and add first group member Calls clear and add.
void skewness_samp_clear (UDF_INIT *initid, char *is_null, char *error)
 Called at start of group.
void skewness_samp_add (UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
 Add a member of the group.
double skewness_samp (UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error)
 Retrieve sample moment coefficient of skewness. Called at end of group.
void skewness_samp_deinit (UDF_INIT *initid)
 Called after last access to function.

Detailed Description

Sample moment coefficient of skewness.

CREATE AGGREGATE FUNCTION skewness_samp RETURNS REAL SONAME 'libsqlstat.so'; SELECT skewness_samp(x) FROM mytab; DROP FUNCTION skewness_samp;

Definition in file skewness_samp.c.


Function Documentation

double skewness_samp ( UDF_INIT *  initid,
UDF_ARGS *  args,
char *  is_null,
char *  error 
)

Retrieve sample moment coefficient of skewness. Called at end of group.

Parameters:
initidfunction description
argsargument values
is_nullresult is NULL
errorerror message
Returns:
sample moment coefficient of skewness

Definition at line 162 of file skewness_samp.c.

void skewness_samp_add ( UDF_INIT *  initid,
UDF_ARGS *  args,
char *  is_null,
char *  error 
)

Add a member of the group.

The counter and sums are updated

Parameters:
initidfunction description
argsargument values
is_null
errorerror message

Definition at line 128 of file skewness_samp.c.

Here is the caller graph for this function:

void skewness_samp_clear ( UDF_INIT *  initid,
char *  is_null,
char *  error 
)

Called at start of group.

void skewness_samp_clear(UDF_INIT *initid, char *is_null, char *error) The counter and sums are cleared.

Parameters:
initidfunction description
is_null
errorerror message

Definition at line 109 of file skewness_samp.c.

Here is the caller graph for this function:

void skewness_samp_deinit ( UDF_INIT *  initid)

Called after last access to function.

Deallocate memory for counter and sums.

Parameters:
initid

Definition at line 199 of file skewness_samp.c.

my_bool skewness_samp_init ( UDF_INIT *  initid,
UDF_ARGS *  args,
char *  message 
)

Called before first usage of function.

Check parameters.
Indicate type of return value.
Allocate memory for counter and sums.

Parameters:
initidfunction description
argsparameters
messageerror message
Returns:
success = 0

Definition at line 56 of file skewness_samp.c.

void skewness_samp_reset ( UDF_INIT *  initid,
UDF_ARGS *  args,
char *  is_null,
char *  error 
)

Reset function and add first group member Calls clear and add.

Parameters:
initidfunction description
argsargument values
is_null
errorerror message
Deprecated:
Reset is only called by MySQL 4.0 and below. It is implemented for backwards compatibility.

Definition at line 95 of file skewness_samp.c.

Here is the call graph for this function:

 All Classes Files Functions Variables Typedefs Defines