November 1, 2006
Making Changes to MySQL Source Code
It's been an interesting last few weeks for me and MySQL. One of my side projects (I currently have three, two are MySQL-focused) provided an opportunity to really dig into the MySQL source code (5.1 tree). For many of my evenings for the past few weeks I've been hacking away, fiddling with the kind of MySQL customizations I've previously only seen other folks do.
The list of customizations:
- build a user defined function (UDF) that gets dynamically loaded into MySQL
- add a new native (built-in) function to the MySQL source code
- create a storage engine using the pluggable storage engine architecture
- create a new SHOW command
- create a new virtual table in the INFORMATION_SCHEMA database
And of course, while I was in there I threw myself into the authors list just to see what it looked like.
I've been compiling MySQL from source for years and have dug around a little to learn about what's going on under the hood, but never really in the mindset of what it takes to make changes or additions. I've always felt like source modifications required a huge learning curve, and would make the resulting binary very unstable. I don't think that anymore. I suppose it depends on what you're trying to do, but for the few items listed above I was suprised at how straightforward the changes were.
The sad truth is that my work isn't really destined for anywhere. I was doing the modifications simply to verify that they can be done, and offer suggestions on how to best do them.
How cool it would be to hash some of the experience around with other folks at the upcoming MySQL CAMP. Alas, it will have to wait, scheduling conflicts mean I need to be at home that weekend. Perhaps at the user conference in April.
Posted by mike at November 1, 2006 11:53 PM