Skip to content

Sample repository to extend MySQL server by develop additional function. (Mysql UDF)

License

Notifications You must be signed in to change notification settings

BaseMax/FirstMysqlUDF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

First Mysql UDF

Sample repository to extend MySQL server by develop additional function. (MySQL UDF)

UDF Repository for MySQL

screenshot - Extend your MySQL server with additional functions

Extend your MySQL server with additional functions

Compiling

gcc -shared -o mcalc.so sample.cc -std=c++11 -fPIC
cd sql
make mcalc.o

Installing module

Return Integer:

CREATE FUNCTION mcalc RETURNS int SONAME "mcalc.so";

(Not for this repo) Return Double:

CREATE FUNCTION mcalc RETURNS double SONAME "mcalc.so";

(Not for this repo) Return String:

CREATE FUNCTION mcalc RETURNS STRING SONAME "mcalc.so";

Uninstalling module

DROP FUNCTION mcalc;

Add module as mysql plugins

It will show path where to put the .so file:

SHOW VARIABLES LIKE 'plugin_dir';

Tested on: MariaDB 10.3.18

MariaDB-MySQL References


Max Base

My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers.

Asrez Team

A team includes some programmer, developer, designer, researcher(s) especially Max Base.

Asrez Team