Issue Details (XML | Word | Printable)

Key: CORE-4598
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Pavel Zotov
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

'set bail on' command is ignored when script is run "inside" ISQL using 'IN <test.sql>' (rather than from command line switch, i.e. isql -i <test.sql>)

Created: 06/Nov/14 07:42 PM   Updated: 20/Apr/20 09:56 AM
Component/s: ISQL
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
Consider following script (name = 'test_bail.sql'):

--- begin of script ---
show version;
set bail on;
set autoddl off;
commit;

set term ^;
execute block as
begin
  begin
    execute statement 'recreate exception ex_exclusive_required ''At least one concurrent connection detected.''';
    when any do begin end
  end
end
^
set term ;^
commit;

set term ^;
execute block as
begin
    if ( exists( select * from mon$attachments a
                 where a.mon$attachment_id<>current_connection
                 and a.mon$remote_protocol is not null
                )
       )
    then
        exception ex_exclusive_required;

end
^
set term ;^
commit;

select current_timestamp as dts,'set bail on is ignored!' as msg from rdb$database;
--- end of script ---

Session #1: connect to database


Session #2: run this script in two cases.

Case-1:
======
Using command-line switch '-i':

isql 192.168.0.220/3253:/var/db/fb25/oltp25b.fdb -i test_bail.sql

Output:
======
Statement failed, SQLSTATE = HY000
exception 3
-EX_EXCLUSIVE_REQUIRED
-At least one concurrent connection detected.
After line 18 in file test_bail.sql

Case-2:
=======
Using 'IN <script>' command:

C:\MIX\firebird\OLTPTEST\trunk>isql 192.168.0.220/3253:/var/db/fb25/oltp25b.fdb
SQL> in test_bail.sql;

Output:
======

<. . .>
Statement failed, SQLSTATE = HY000
exception 5
-EX_EXCLUSIVE_REQUIRED
-At least one concurrent connection detected.
After line 18 in file test_bail.sql

                      DTS MSG
========================= =======================
2014-11-06 22:34:47.6290 set bail on is ignored!


Why 'set bail on' was ignored in case-2 ?

PS. Results are the same for 2.5 and 3.0
PPS. Adding '-b' switch to command that run ISQL (C:\...>isql 192.168.0.220/3253:/var/db/fb25/oltp25b.fdb -b) - does NOT help.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 06/Apr/20 06:50 PM
Up! Is any chance to see this feature in next FB major release ?
I mean that it will be usefult to stop execution of "some_script.sql" which was invoked using:

INPUT some_script.sql

-- immediately when first error is encountered there. Without quitting from ISQL, only return to prompt ("SQL> ").

Vlad Khorsun added a comment - 20/Apr/20 09:53 AM
Current behavior is explicitly described at \doc\README.isql_enhancements.txt
So - this is not a bug, definitely.
We could consider this ticket as feature request, though, but afer careful thinking only.

Pavel Zotov added a comment - 20/Apr/20 09:56 AM
> So - this is not a bug, definitely.

Changed type to 'New feature'.