This is my second article about hacking MySQL. If you are interested in this topic, you may want to read my previous Hacking MySQL: SIGNAL support (I)
The problem
If I tell you there is a function called TRUNCATE,
what do you think it does? which are its arguments?
For me, the obvious behaviour would be something like:
mysql> SELECT TRUNCATE(123.45); +--------------------+ | TRUNCATE(123.45) | +--------------------+ | 123 | +--------------------+ 1 row in set (0.08 sec)
But the actual behaviour is this:
mysql> SELECT TRUNCATE(123.45);
ERROR 1064 (42000): You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the
right syntax to use near ')' at line 1
This is because …
[Read more]