2011
MariaDBERRORNotableUDFHIGH confidence

Cannot find function symbol in shared library

Production Risk

Low — UDF creation is rejected.

What this means

The shared library for a UDF was opened successfully, but the expected entry-point symbol (function name) was not found in the library. The library must export the UDF symbol with the exact name specified in CREATE FUNCTION.

Why it happens
  1. 1UDF function name in CREATE FUNCTION does not match the exported symbol in the library.
  2. 2Library compiled without exporting the required symbols.
  3. 3C++ name mangling preventing symbol resolution (use extern "C" in C++ UDFs).
How to reproduce
trigger — this will error
trigger — this will error
CREATE FUNCTION my_func RETURNS STRING SONAME 'myfunc.so'; -- symbol 'my_func' not exported

expected output

ERROR 2011 (HY000): Can't find symbol 'my_func' in library.

Fix 1

Verify the exported symbol name matches the CREATE FUNCTION name

Verify the exported symbol name matches the CREATE FUNCTION name
-- On Linux: nm -D /path/to/plugin_dir/myfunc.so | grep my_func

Why this works

The library must export a symbol with the exact function name.

Fix 2

Use extern "C" in C++ UDF code to prevent name mangling

Use extern "C" in C++ UDF code to prevent name mangling
// In C++ UDF source:
extern "C" my_bool my_func_init(...) { ... }

Why this works

extern "C" ensures the symbol is exported with a C-style (unmangled) name.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 2011 ER_CANT_FIND_DL_ENTRY

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors