Sign in to follow this  
Buzz1982

UDF in mysql

Recommended Posts

Buzz1982    122
Hello, I want to create a user defined function in mysql. I have used c language to develop the function and created a .dll file named udf.dll . I have placed this .dll file in mysql bin directory. But when I run create function query I get the following error, When I run this query create function Rank returns real soname 'udf.dll'; i get this error error 1126 (HY000) can`t open shared library `udf.dll` (errno: 22 udf.dll: cannot open shared object file: No such file or directory) Following is the code in c language that I am using, Please help me solve this problem. #ifdef STANDARD #include <stdio.h> #include <string.h> #ifdef __WIN__ typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */ typedef __int64 longlong; #else typedef unsigned long long ulonglong; typedef long long longlong; #endif /*__WIN__*/ #else #include <my_global.h> #include <my_sys.h> #endif #include <mysql.h> #include <m_ctype.h> #include <m_string.h> // To get strmov() static pthread_mutex_t LOCK_hostname; /* These must be right or mysqld will not find the symbol! */ extern "C" double Rank( UDF_INIT *initid, UDF_ARGS *args, char *is_null, char *error ) { return 99.65; }

Share this post


Link to post
Share on other sites
Antheus    2409
A few things are a bit puzzling here.

The "soname" and "shared object" make me thing this is Linux-ish OS, and DLLs are Windows libraries.

What's the compiler and OS you're using, how was the DLL compiled, you'll need to provide more information.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this