Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.32 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.32 KB

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