This article explains some advanced uses for MySQL and MariaDB’s error
HANDLERs. Some information is in MySQL documentation, but it’s rather sparse. Also, while MySQL manual is probably the best manual ever, I’ve found a major bug in errors documentation. So, these use cases are not so obvious. At least they weren’t for me, so I had to test them.
Notes about the examples in this article
All the examples are tested on MariaDB 10.0.3, but I’m sure that there is not difference in MySQL 5.6, and there should be no difference in any 5.* version.
In these examples we need to produce an error to test the server’s behavior. We’ll always use the same method: we’ll declare a `cur`[Read more...]