Skip to content

MDEV-40672: Pluggable Aggregate Function - #5522

Draft
drrtuy wants to merge 6 commits into
MariaDB:13.0from
drrtuy:pluggable_aggregate_funcs
Draft

MDEV-40672: Pluggable Aggregate Function#5522
drrtuy wants to merge 6 commits into
MariaDB:13.0from
drrtuy:pluggable_aggregate_funcs

Conversation

@drrtuy

@drrtuy drrtuy commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Add pluggable aggregate function support

What

Implement MDEV-40672 by extending function plugins to provide aggregate functions through the standard Item_sum lifecycle. Support grouped aggregation, DISTINCT, window functions, native and pluggable data types, and safe plugin lifetime management.

Key changes

  • Extend Plugin_function descriptors to distinguish scalar and aggregate functions.
  • Add Item_sum_plugin as the base class for plugin-provided aggregates.
  • Support DISTINCT argument replay and pluggable result types such as UUID.
  • Enable plugin aggregates as window functions, including moving-frame removal.
  • Add test aggregates and MTR coverage for grouping, windows, prepared statements, plugin unloading, invalid descriptors, and type preservation.

How to test

Run:

/git/BuildOf_mdb-13/mysql-test/mtr function_plugin function_plugin_extra

Both tests pass.

@drrtuy
drrtuy requested review from abarkov and vuvova August 10, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants