Archive pour juin 2010

MySQL memo

Lundi 7 juin 2010

During my last job, I’ve had to migrate queries from Sybase to MySQL, and thus, I’ve noticed some important things which weren’t obvious at first in MySQL 5.1 :

  • concat function returns null if any of its argument is null. This leads to do things like concat(coalesce(f1, »), coalesce(f2, »), coalesce(f3, »)) which is a bit annoying.
  • you can’t reference a temporary table more than once in a query
  • if you define a write lock on a table, you can’t update or insert any other table without locking it before.

I’ve not checked if these issues/behaviors have changed in recent versions.