[Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
Hello, All. Must multiple error handlers be allowed for the same block? I.e. something like this: BEGIN WHEN SQLCODE -803 DO WHEN GDSCODE isc_key_violation DO WHEN ANY DO . END -- WBR, SD.

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Mark Rotteveel
On Fri, 09 May 2014 11:15:36 +0200, Dimitry Sibiryakov s...@ibphoenix.com wrote: Hello, All. Must multiple error handlers be allowed for the same block? I.e. something like this: BEGIN WHEN SQLCODE -803 DO WHEN GDSCODE isc_key_violation DO WHEN ANY DO . END

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 13:52, Mark Rotteveel wrote: So although multiple WHENs might be handy, they are - afaik - currently not allowed, and this limitation can be worked around. Actually, according to my test, they are allowed now, but their behavior seems strange to me. That's why I ask. For

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 14:37, Dmitry Yemanov wrote: They were always allowed, so we cannot even think about breaking this. The only thing that may be treated like a bug is CORE-3275. Ok. From your comment in the ticket I conclude that _every_ matching handler must be executed. Am I right? I.e. in

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dmitry Yemanov
09.05.2014 16:45, Dimitry Sibiryakov wrote: 09.05.2014 14:37, Dmitry Yemanov wrote: They were always allowed, so we cannot even think about breaking this. The only thing that may be treated like a bug is CORE-3275. Ok. From your comment in the ticket I conclude that _every_ matching handler

Re: [Firebird-devel] Multiple WHEN handlers

2014-05-09 Thread Dimitry Sibiryakov
09.05.2014 15:37, Dmitry Yemanov wrote: Looking at the code, the problem is that the first successfully matched WHEN block clears the status vector, so only WHEN ANY can be matched after that. And this code (inherited from InterBase) seems to be written intentionally. BTW, this is not the