JRD_receive() and warnings

8 views
Skip to first unread message

Dimitry Sibiryakov

unread,
May 20, 2025, 12:16:26 PMMay 20
to firebir...@googlegroups.com
Hello All,

in JRD_receive I see following code:

> if (request->req_flags & req_warning)
> {
> request->req_flags &= ~req_warning;
> ERR_punt();
> }

AFAIU it throws an exception on warnings. But warning are not supposed to
abort execution. When JRD_receive() is called from JRequest::receive() it is ok,
because exception handler immediately follows the call and exception is simply
stored in the user status, but in DSQL there is no such handler and the
exception aborts execution of DsqlDmlReques::execute().
How is it supposed to work?

--
WBR, SD.

Dmitry Yemanov

unread,
May 20, 2025, 1:23:44 PMMay 20
to firebir...@googlegroups.com
req_warning is not really about regular warnings. This flag is set by
ERR_warning() while regular warnings are thrown using ERR_post_warning()
-- and it makes a lot of difference ;-)

ERR_warning() is only called from EVL_field() to produce a famous "no
current record for fetch operation" error. I honestly don't know why
such a weird solution was designed in this place. Maybe EVL_field()
could be originally called from the code paths not prepared to handle
exceptions gracefully, maybe some other reason exists (or existed
before). But we still have this code in place.


Dmitry

Reply all
Reply to author
Forward
0 new messages