Originally way to handle warnings and errors in MySQL stored
routine was designed as follows:
-
- if warning was generated during stored routine execution
which has a handler for such a warning/error, MySQL remembered
the handler, ignored the warning and continued execution
- after routine is executed MySQL checked if there is a
remembered handler and activated if any
This logic was not ideal and causes several problems,
particularly:
-
- it was not possible to choose right handler for an
instruction which generated several warnings or errors, because
only first one was chosen
- handling conditions in current scope messed with conditions
in different
- there were no generated warning/errors in Diagnostic Area
that is against SQL Standard.
…