What problem does it solve? MariaDB has three distinct CREATE FUNCTION forms — stored functions, stored aggregate functions, and loadable user-defined functions — that share a keyword but differ in syntax, privileges, and behavior, and AI-generated SQL frequently conflates them or misses MariaDB-specific rules like the NOT DETERMINISTIC default and binlog creation gates. ## Core Features & Use Cases - Stored Function Guidance: Covers RETURNS vs RETURN, IN/OUT/INOUT parameters with DEFAULT values, characteristics like DETERMINISTIC and SQL SECURITY, and restrictions such as no result sets, no recursion, and no dynamic SQL. - Stored Aggregate Functions: Explains CREATE AGGREGATE FUNCTION with FETCH GROUP NEXT ROW loops and NOT FOUND handlers for custom aggregates usable in GROUP BY and window queries. - Loadable UDF Registration: Details CREATE FUNCTION ... SONAME for shared libraries loaded from plugin_dir, the mysql.func privilege model, and name-collision precedence where UDFs shadow same-named stored functions. - Use Case: When asked to write a custom aggregate in MariaDB, produce a CREATE AGGREGATE FUNCTION with a FETCH GROUP NEXT ROW loop instead of an incorrect scalar function plus GROUP BY workaround. ## Quick Start Ask the AI to write or review a MariaDB CREATE FUNCTION statement, custom aggregate, or UDF registration for your specific use case.