Skip to content

A MySQL/MariaDB module and plugin to calculate the formula and calculate mathematical expression in SQL Query.

License

Notifications You must be signed in to change notification settings

BaseMax/MysqlCalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

M-Calc, MCalc

MCalc Exmaple

select mcalc('5+5*2/2') as valu;
select mcalc('5+cos(0)') as valu;
select mcalc('5+pi*2)') as valu;

MariaDB-MySQL Calculator

A MySQL/MariaDB module and plugin to calculate the formula and calculate mathematical expression.

MariaDB-Mysql UDF

Extend your MySQL server with additional functions

UDF Plugin-Module for MySQL

Compiling

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

Installing module

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

Uninstalling module

DROP FUNCTION mcalc;

MariaDB-MySQL Calc

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

Releases

No releases published

Packages

No packages published