forked from megastep/mysql-udf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
79 lines (49 loc) · 3.33 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
This is a set of UDF functions for MySQL originally written by Jan Steeman.
http://mysql-udf.sourceforge.net/
These functions have been brought up to date with the MySQL API, and I added some functions (such as STEYX from Excel).
I added a build system (simple Makefile) to easily compile all functions as a single library which can be installed with
other MySQL plugins. The development environment for this library is Ubuntu Linux (64bit). The library should build cleanly on any
standard Linux development machine with g++ and the MySQL development libraries and headers installed.
The import.sql script provides the necesary commands to import the UDF functions into MySQL. You need to be an administrator
to be able to do that.
The repository on GitHub is at http://github.com/megastep/mysql-udf
--
Stephane Peter
October 2011
----------
Then:
1. median() were merged with Steemann's (http://sourceforge.net/u/steemann/profile/) patch for available here:
http://sourceforge.net/p/mysql-udf/patches/2/
2. Misc functions merged with Paul's ("paul.w.b...") fixes from:
http://code.google.com/p/mysql-udf-moments
3. All remaining functions were patched to work against MySQL 5.5
4. Makefile fixed to run correctly against MySQL 5.5
5. Fixing import.sql for installing the functions.
6. Made drop.sql script for removing the functions.
The repository on GitHub is at https://github.com/nmmmnu/mysql-udf
# Steps to get started
1. Install mysql development package, on linux machines as on 2018-03-31 it can be installed by sudo apt-get install libmysqlclient-dev libmysqld-dev
2. $> make
3. make step will generate .o files and would make .so shared library file with all .o files.
4. check if udf_math.so is generated in the current directory.
5. copy this udf_math.so file by sudo cp udf_math.so /usr/lib/mysql/plugin/
6. now run the import.sql statements in your database. it will add the functions. now the functions are ready to use.
1. if you facing error like this during make
```
g++ -o udf_colwidth.o -O2 -fPIC -I/usr/src/mariadb-5.5.30/include/ -I/usr/include/mysql -DHAVE_DLOPEN=1 -c udf_colwidth.cc
udf_colwidth.cc:30:23: fatal error: my_global.h: No such file or directory
compilation terminated.
Makefile:48: recipe for target 'udf_colwidth.o' failed
make: *** [udf_colwidth.o] Error 1
```
then mysql development libraries are not installed on your system. my_global.h is part of header files present in mysql development library. on my linux machine doing sudo apt-get install libmysqlclient-dev libmysqld-dev fixed the issue and now header files are present in /usr/include/mysql/ which is included during make phase in Makefile.
--
Nikolay Mihaylov
https://github.com/nmmmnu/
21.September.2014
Documentation of added functions
strvalformin- usage strvalformax(float_val_col,str_val_col)- this udf finds the value of str_val_col corresponding to the minimum value in float_val_col
strvalformax - usage strvalformin(float_val_col,str_val_col)- this udf finds the value of str_val_col corresponding to the maximum value in float_val_col
realvalfordatemax - usage datevalformax(date_val_col,float_val_col)- this udf finds the value of flow_val_col corresponding to the maximum value in date_val_col
realvalformax - usage realvalformax(float_val_col,real_val_col)- this udf finds the value of real_val_col corresponding to the maximum value in float_val_col