Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'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>) [CORE4598] #4913

Open
firebird-issue-importer opened this issue Nov 6, 2014 · 4 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Nov 6, 2014

Submitted by: @pavel-zotov

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 6, 2020

Commented by: @pavel-zotov

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> ").

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 20, 2020

Commented by: @hvlad

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.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 20, 2020

Modified by: @pavel-zotov

priority: Major [ 3 ] => Minor [ 4 ]

issuetype: Bug [ 1 ] => New Feature [ 2 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 20, 2020

Commented by: @pavel-zotov

> So - this is not a bug, definitely.

Changed type to 'New feature'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant