MySQL is People!

I went skydiving yesterday. Here’s a short video of me voluntarily leaving an airborne and perfectly sound aeroplane:

What does this have to do with MySQL? Well, over the past few weeks there have been a bunch of conspiracy theories bouncing around. There are various topics, but the two favourite at the moment happen to be Oracle’s plans for MySQL, and the licensing of the MySQL documentation. There has been a long history of conspiracies surrounding MySQL, from Oracle’s original purchase of InnoDB, to our decision to create the Enterprise edition of the server, through to our long and bumpy release cycle.

Now, don’t get me wrong. I’m not making any calls to stifle discussion, I’m a big fan of community input. I was a member of the community before I joined MySQL, and I like to think that I still am. But I would like it if we could at least think about conspiracy theories before posting about them. We’re all people here at MySQL, we have evenings and weekends and lives just like you. Some of us are crazy enough to do silly things like jumping out of aeroplanes. We’re not out to get you, and we’re certainly not planning on turning into some sort of faceless corporate stereotype. We’re here to do what we love, creating and supporting a really good product.

Oh, and how do you know this isn’t some corporate play to make us seem human? Well, it’s 9:30pm on a Sunday night here, I’m yet to find a company who could pay me well enough to be shilling for them. But MySQL happens to be a group of people I like enough to defend them on my own time.

MySQL Workbench: My Impressions

I’ve been using the MySQL Workbench 5.1 beta for the past few days now, and I’m wondering how I designed databases without it.

Okay, so that’s a pretty strong statement, but I’m genuinely happy with it. 5.1 has fixed my main problem with 5.0, in that the EER diagram mode was horribly slow to render, now it’s all nice and smooth. The ability to easily visualise tables and their relationships makes design very simple.

In fact, I really only have one (minor) complaint, the ability to export without foreign keys would be nice. Sometimes you just don’t want to deal with the performance hit.

That’s about it. Go and download the OSS edition for free now, have a play around. Make it your Friday afternoon experiment. I promise you’ll like it.

Extracting a Database From a mysqldump File

Restoring a single database from a full dump is pretty easy, using the mysql command line client’s --one-database option:

mysql> mysql -u root -p --one-database db_to_restore < fulldump.sql

But what if you don’t want to restore the database, you just want to extract it out of the dump file? Well, that happens to be easy as well, thanks to the magic of sed:

shell> sed -n '/^-- Current Database: `test`/,/^-- Current Database: `/p' fulldump.sql > test.sql

You just need to change “test” to be the name of the database you want extracted.

Yohosie at The Tote, with Boom Pretty

This makes the second show of Yohosie‘s May residency at The Tote, and they’re rocking it.

First band up was Innerspace, with their rather loud wakeup for the neighbours. Sadly, they were a bit too loud for the small venue, I couldn’t really hear their music. Going by the recordings available on their MySpace, I would like to hear them again, but with slightly more favourable mixing. They’ll be playing next at Manchester Lane on the 7th of May.

Then came Boom Pretty. They’ve been absent from the Melbourne gig scene for a few months now, working on recording their new EP. That said, they haven’t lost any of their stage presence. With the addition of Dave on bass, and Nic taking on backing vocals, they’re producing a richer sound than we’ve previously heard.

As mentioned, Boom Pretty do have a new EP that they’ve been working on, and it’s sounding pretty good. The launch is on the 30th of May at The Evelyn, but those of you who are really keen can buy it already on iTunes.

Finally, the headline act, Yohosie. They’ve been a regular on the Melbourne scene for a year and a half now, and have earned themselves a loyal following. With quirky lyrics and an almost manic energy coming from Xani, the co-lead vocalist and electric violin virtuoso, they provide a very entertaining show.

Yohosie are also launching a pile of new material, on the 22nd of May, at The Evelyn. Keep an eye on their MySpace for more details. In the mean time, they still have three more shows at The Tote for this month’s residency. If you haven’t already been, go!

Finally, 2 shakycam videos from the gig!

Boom Pretty, performing their new single Winter Bend:

Yohosie, performing their single Train Song:

More gig pics available here.


Boom Pretty

Don’t put a NULL in the IN clause in 5.1

There seems to be an optimizer problem in 5.1, if you put a NULL in the IN clause of a SELECT. For example, given the following table:


Compare these two EXPLAINs:

mysql> EXPLAIN * FROM foo WHERE a IN (160000, 160001, 160002)\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: foo
         type: range
possible_keys: PRIMARY
          key: PRIMARY
      key_len: 4
          ref: NULL
         rows: 3
        Extra: Using where
1 row in set (0.06 sec)

mysql> EXPLAIN SELECT * FROM foo WHERE a IN (NULL, 160000, 160001, 160002)\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: foo
         type: ALL
possible_keys: PRIMARY
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 327680
        Extra: Using where
1 row in set (0.00 sec)

In the query with the NULL, it does a full table scan. So, if you’ve run into this problem under MySQL 5.1, the workaround is to remove the NULL. This doesn’t affect MySQL 4.x or 5.0.

You can also follow along with Bug #33139.