Skip to content
Newer
Older
100644 32 lines (19 sloc) 900 Bytes
382d94f @toddtreece alpha
authored Oct 25, 2011
1 #include "common.h"
2
3 my_bool mongodb_udf_version_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
4 char *mongodb_udf_version(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error);
5
6 my_bool mongodb_udf_version_init(UDF_INIT *initid, UDF_ARGS *args, char *message) {
7
8 char *version_string;
9
10 if(args->arg_count > 0) {
11 strncpy(message, "This function requires no arguments: mongodb_udf_version()", MYSQL_ERRMSG_SIZE);
12 return 1;
13 }
14
15 version_string= calloc(1, VERSION_STRING_LENGTH + 1);
16 strncpy(version_string, VERSION_STRING, VERSION_STRING_LENGTH);
17 initid->ptr= version_string;
18
19 return 0;
20
21 }
22
23 char *mongodb_udf_version(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, char *is_null, char *error) {
24
25 char *version_string= initid->ptr;
26 *length= VERSION_STRING_LENGTH;
27
28 return (version_string);
29
30 }
31
Something went wrong with that request. Please try again.