You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'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
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 ---
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.
The text was updated successfully, but these errors were encountered:
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> ").
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.
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
========================= =======================
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.
The text was updated successfully, but these errors were encountered: