I have been looking for creating a user defined function in MariaDB to perform a simple task
What I have tried:
For that I created a sample c++ program for adding two numbers,and compiled using the below command g++ -fPIC -shared Hello.cc -o add .so after that I copied the shared object file to plugin directory.
When Iam calling the Create function syntax CREATE FUNCTION add RETURNS integer SONAME ' add.so' ; it gives the below error ERROR 1127 (HY000): Can ' t find symbol ' add ' in library. Kindly give a solution for the same. Probably is due to C++ function name mangling. Try to surround function declaration with
C++
extern " C" { // your function declaration here... See, for instance, Name mangling (C++ only) - IBM Knowledge Center [ ^ ].
  • Read the question carefully.
  • Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  • If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  • Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. Let's work to help developers, not make them feel stupid.
  •