Category: Development
-
MariaDB Hidden Gem: Create Aggregate Function

Have you ever written a query where the GROUP BY was easy, but the aggregate was the problem?
You know how to group the rows.You know what result you want for each group.But none of the built-in aggregate functions really match your logic.
So you end up with a long expression using SUM(), CASE, IF(), GROUP_CONCAT(), JSON functions, or application-side code. It works, but it is not beautiful. And if you need the same logic in several places, it becomes […]
-
Vibe-coding an Audit Plugin in Under 3 Minutes
Who says developing MariaDB plugins is hard? I was able to produce one in under 3 minutes!
I of course did it by asking Grok nicely:
The produced result is actually very decent:
It even produced a Makefile:
And compilation instructions:
The plugin has even compiled and worked on my Mac!
Tests are Important!
While I had Grok’s attention I’ve given it a follow up task:
Note the “please” part! It’s important!
This second prompt made it realize its naiveté […]
-
Documented: The MariaDB Server (Community) Contribution Process
If you ever considered contributing code to the MariaDB server, you should know that this is an intricate process involving multiple steps and multiple actors. To help you see your contributions successfully merged into the MariaDB Server codebase I’ve compiled a comprehensive description of the contribution process itself, the roles involved into it, the sequence of actions and conditions for transition from one to another. There’s even a diagram!
Please go to COMMUNITY_CONTRIBUTIONS.md.
This of course is going to be […]
-
Unleashing Innovation Through Plugins

One of the corner stones in MariaDB Foundation’s mission is:
We strive to increase adoption by users and across use cases, platforms and means of deployment. https://mariadb.org/about/
MariaDB Server plugins are definitely a prime “means of deployment” for server features. But a relatively neglected one so far. They have been around for many years. But, somehow, they have escaped the user’s focus. Why that happened is a very interesting topic. And one that I’d definitely like to hear your opinion […]
-
Adding a New Data Type to MariaDB with Type_handler – Part 5

We are concluding our series related to new data types using the Type_handler framework, with some limitations that are not yet covered by the framework:
It would have been handy for our MONEY datatype to have the possibility to define, for example, the currency to show. Or the format to have something like this:
Unfortunately, we can’t create new field attributes for our data type. As you probably already know, a column has an extra attribute called COMMENT. We can […]
-
Adding a New Data Type to MariaDB with Type_handler – Part 4

This is part 4 of a series related to extending MariaDB with a custom data type using the Type_handler framework.
You can find the previous articles below:
Overriding Existing Types
In the previous examples, our MONEY data type inherits from DOUBLE and then we override some methods.
But all the methods of every type cannot be overridden. For example, if we would like to change how the money column is sorted, we would have to override the Field_double::sort_string() method. But […]
-
Adding a New Data Type to MariaDB with Type_handler – Part 3

In the previous article, we wrote, compiled, and tested our first custom data type for MariaDB using the Type_handler framework.
But currently, aside from allowing the use of its new name (MONEY) and listing it in the metadata, our new data type behaves exactly like a DOUBLE, the class it inherits from.
In this article, we will extend our data type just a bit by transforming the result into a VARCHAR and adding a currency sign to it: the dollar […]
-
Adding a New Data Type to MariaDB with Type_handler – Part 2

After having discovered the Type_hander framework and learned how to build MariaDB Server from source, it’s time to code our first data type!
We will create a MariaDB plugin that registers a new MONEY type and instantiates a custom field object.
Our component won’t be exciting, but we want to understand how to use the framework and test it.
We want to prove that
Everything else comes later.
Step 1: start with a minimal build file
The very first step […]