There’s a lot of great new features in MySQL 5.6 DMRs – almost
too many to keep track of. And while a lot of (justified)
attention is given to the headline-grabbing features of 5.6
(memcached APIs! global transaction ids! improved
PERFORMANCE_SCHEMA!), I’m often curious about the new features
that don’t make as big a splash. I thought I would look at
one such new feature – WorkLog #5217. I’m not telling you
what this WorkLog is yet; test your knowledge of 5.6 features by
seeing if you can figure it out from the following
scenario. Imagine the following table data:
mysql> SELECT * FROM p;
+------+------+
| a | b |
+------+------+
| 1 | 1 |
| 11 | 1 |
| 21 | 1 |
+------+------+
3 rows in set (0.00 sec)
OK, try to write an UPDATE statement that increments b for the
row where a = 11. Easy, right?
UPDATE p SET b = b+1 WHERE a = 11;
OK, now do it without a …
[Read more]