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
ISQL: Add "Stop on Error" switch to immediatelly stop script error occurs during execution [CORE4232] #4556
Comments
Commented by: Sean Leyne (seanleyne) The correct description of the switch would be "stop on error" It also would seem reasonable that this would become the default mode, and that the switch would 'ignore' the errors. |
Modified by: Sean Leyne (seanleyne)summary: ISQL: provide switch to immediatelly cancel script containing many 'heavy statements' if database in shutdown or any engine error occured => ISQL: Add "Stop on Error" switch to immediatelly stop script error occurs during execution |
Commented by: Sean Leyne (seanleyne) Does the script have the statements on separate lines or a single line? If single line, what happens if on multiple lines? |
Commented by: @pavel-zotov hm... Now (FB 3.0.x) - yes, the problem exists only in case of few commands in SINGLE line. I re-run simple test that did not stops in 2.5.x even when `-b` was specified: And when I run in session #1: - then issuing in session #2 gfix -shut full - force 0 causes session #1 to immediately to stop: So, my apologies: this switch DOES work correctly, at leat on FB 3.0.x |
Commented by: Sean Leyne (seanleyne) I'm not sure where your results leave this case. It seems that the requested functionality exists in v3.0 (although not for multiple statements on a single line -- but I would say that is a minor use-case) |
Submitted by: @pavel-zotov
I have a few huge scripts to be handled by ISQL. These scripts contains many EXECUTE BLOCKs delimited by COMMIT statement.
Each of EB, in turn, does a lot of DML.
For some test purpoces its needed to stop immediately all of ISQLs if server has been crashed or detected some serious error in database.
But ISQL will continue after error that enountered on N-th statement and will see that FB is (again) alive - due to fbguard that 'lifted up' FB process.
The "-b" switch (or the command issued inside ISQL prompt: set bail on) - doesn`t help in such situation:
sesson #1
########
-- run THREE 'heavy statement':
select count(*) from rdb$fields, rdb$fields, rdb$fields, rdb$fields; select count(*) from rdb$relations; select count(*) from rdb$relations;
session #2
#########
gfix -shut full -force 0
session #1
#########
COUNT
Statement failed, SQLSTATE = HY000
database C:\MIX\FIREBIRD\TB.FDB shutdown ----- (1)
Statement failed, SQLSTATE = HY000
database C:\MIX\FIREBIRD\TB.FDB shutdown ----- (2)
Statement failed, SQLSTATE = HY000
database C:\MIX\FIREBIRD\TB.FDB shutdown ----- (3)
As we can see, ISQL attempted to run 2nd and 3rd statements after first error.
Is it possible to implement such func. that (2) and (3) will NOT appear and ISQL immediately will finish ?
(not only on case db shutdown - i'm speaking about ANY error)
The text was updated successfully, but these errors were encountered: