The Audit Log UDF was invoked with a parameter whose data type does not match the function signature.
ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE occurs when a MySQL Audit Log user-defined function receives a parameter of the wrong data type. Check the UDF signature and cast or convert arguments to the expected types to resolve the error.
ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE
Error 3214 appears when a MySQL Audit Log user-defined function (UDF) receives a parameter whose data type does not match its definition.
The server raises this runtime error with SQLSTATE HY000 and message "Invalid argument type" starting from MySQL 5.7.22.
Passing a string to a UDF parameter declared as INT triggers the mismatch check and raises error 3214.
Implicit casting is not performed for Audit Log UDFs, so even compatible types like TINYINT and INT can fail if the exact type is required.
Upgrading MySQL without re-creating UDFs can leave outdated signatures that no longer match the calling code.
First, inspect the UDF definition with SHOW CREATE FUNCTION to confirm expected parameter types.
Next, modify calling SQL or application code to supply parameters in the correct types, using CAST or CONVERT if needed.
If the UDF definition itself is wrong, drop and recreate it with the correct parameter list.
Automated logging scripts often pass VARCHAR user IDs to a UDF expecting BIGINT. Apply CAST(? AS SIGNED) before calling.
JSON audit packages may store timestamps as strings. Convert them with STR_TO_DATE or UNIX_TIMESTAMP before invoking the UDF.
Legacy clients compiled against an older UDF version can break after server upgrades. Recompile and redeploy plugins to align signatures.
Always document UDF parameter types and enforce them in your API layer to catch mismatches early.
Version UDFs alongside application code and include automated tests that call the functions with representative data.
Use Galaxy's inline type hints and AI copilot to validate argument types during query authoring, preventing runtime failures.
ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARGUMENTS fires when too many arguments are supplied; verify the call count.
ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_POSITION appears when arguments are out of order; ensure correct parameter order.
General UDF errors such as ER_CANT_OPEN_LIBRARY can indicate plugin loading issues; check plugin_dir and file permissions.
Calling code sends a VARCHAR when the UDF signature expects INT, leading to an immediate error at runtime.
Audit Log UDFs disable automatic type promotion, so even minor discrepancies like SMALLINT vs INT fail.
Server upgrades can change expected types; if the UDF is not recreated, calls from new clients misalign with the old signature.
Supplying valid types in the wrong position effectively gives each parameter the wrong data type.
Raised when too many parameters are supplied to the Audit Log read UDF. Reduce the argument count.
Occurs when parameters are supplied in the wrong order. Reorder arguments to match the signature.
Indicates MySQL cannot load the shared library for the UDF. Check plugin_dir and file permissions.
No. It is specific to Audit Log UDFs introduced in MySQL 5.7.22.
MySQL does not allow implicit casting for these UDFs. Explicitly cast each parameter.
Dropping and recreating the UDF does not affect existing audit log tables or files.
Galaxy highlights type mismatches while writing SQL and suggests CAST or CONVERT operations through its AI copilot.