AaronCrane.co.uk

Archive for October 2007

Insanity with dumping MySQL stored procedures

Suppose you have a MySQL database containing stored procedures (which were added in MySQL 5.0.3). Now you dump that database using mysqldump, take the dump, and load it into a different server.

Oops, the dump didn’t contain the stored-procedure definitions, so your code fails. So you read the mysqldump manual, and discover that you need to add a -R (--routines) unbreak-me option. You regenerate the dump with -R, and load it into your other server. That worked; phew. (Assuming the user you dumped as has read permissions on the mysql.proc table, anyway.)

Then you load the dump into a third server. But you weren’t thinking very clearly at this point, and this third server is running 5.0.2, or 4.1, or some other version N−k. What should happen now?

More…

Spanish phonology and American accents

Among native speakers of American English who are learning Spanish, there’s a natural error that can easily mark them out as non-native Spanish speakers, and that seems to be fairly common. It’s all about the pronunciation and behaviour of the coronal consonants /t/ and /d/.

More…

Colour schemes in terminal emulators

Some people prefer dark-on-light colour schemes for their terminals. Others prefer light-on-dark.

I’m in the latter camp. I suspect that’s mainly just out of habit, rather than anything well-reasoned; certainly I find myself agreeing with the idea that matching the properties of paper is a good thing.

More…

Numbers and strings in MySQL

Here’s a MySQL query issued by some Perl code:

$db->do(q{
    CREATE TEMPORARY TABLE byline_age (
        byline_id int PRIMARY KEY,
        last_used int not null
    )
    SELECT byline_id, MAX(IfNull(published_at, ?)) AS last_used
    FROM article
    GROUP BY byline_id
}, undef, time());

Spot the bug? No, nor did I.

More…

Unix filesystem semantics are useful

There’s been a minor furore lately about ZFS and Mac OS and laptops.

First, AppleInsider reported that ZFS would play a larger role in future versions of Mac OS X. MWJ took that article to task, contending (once you ignore the snarky asides) that ZFS is inappropriate for laptops. Drew Thaler, previously a filesystem engineer for Apple, chimed in to extol the good qualities of ZFS.

Then MWJ responded, explaining their position in more depth. Which is all well and good, except that some of the things they said made no sense at all.

More…