Description:
SIGNAL always empties the diagnostics area. This is ok, reading this page:
http://dev.mysql.com/doc/refman/5.6/en/diagnostics-area.html
However, I think that some exceptions would be desirable:
SIGNAL SQLSTATE 'bad!' SET MYSQL_ERRNO=123, MESSAGE_TEXT='something happened';
generates this:
+-------+------+----------------------+
| Level | Code | Message |
+-------+------+----------------------+
| Error | 1407 | Bad SQLSTATE: 'bad!' |
+-------+------+----------------------+
If there are other conditions in the DA, they are lost forever. The problem which led to the execution of SIGNAL could be hard to repeat, and we have no hints about what caused it.
The same applies to 1064, syntax error.
How to repeat:
.