Search This Blog

14 January 2009

Table functions in MySQL

Less than 48 hours after starting to scratch this itch, I have table functions working in my WL820 repository on Launchpad.

It is pretty nifty:
mysql> INSTALL PLUGIN Deep_Thought SONAME 'psm_example.so';
Query OK, 0 rows affected (0.10 sec)

mysql> CREATE FUNCTION test.FooAnswer()
-> RETURNS TABLE(answer TEXT)
-> NO SQL LANGUAGE Deep_Thought EXTERNAL NAME 'compute';
Query OK, 0 rows affected (0.01 sec)

mysql> CREATE VIEW foobar AS SELECT * FROM TABLE(test.FooAnswer) AS wibble;
Query OK, 0 rows affected (0.01 sec)

mysql> SELECT * FROM foobar WHERE answer LIKE 'F%';
+-----------+
| answer |
+-----------+
| Forty-Two |
+-----------+
1 row in set (0.01 sec)


I'm quite pleased with the result. Now I can start playing with it and I expect to make use of it for my presentations at the MySQL conference this April.

12 November 2008

10th Anniversary

10 years ago, Monty Widenius released MySQL 3.22.10.

That version was the first release of MySQL which included my contributions. I would submit a few more patches and write a couple of storage engines before I finally accepted Monty and David's 3rd or 4th job offer, over 4 years later; I cannot remember if the first offer, which occurred with great humor in December 1998 was in jest or serious. I have seen lots of stuff happen to MySQL over the last 10 years. Its user-base has grown far larger than I would have imagined 10 years ago - MySQL was not the first free database, nor was it the first opensource database. But it is friendly and has great people involved who are helpful and care about their users.

Time flies...