From ef8b688182f6d75682d65788acf2051de6085f53 Mon Sep 17 00:00:00 2001 From: zotov Date: Thu, 6 Oct 2022 13:20:40 +0300 Subject: [PATCH] BAIL switch must be returned to its default value when script is to be finished. See IMPORTANT NOTES inside this .sql: PIPE is handled differently on Windows vs Linux. --- files/gtcs-ref-integ-init.sql | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/files/gtcs-ref-integ-init.sql b/files/gtcs-ref-integ-init.sql index 886a8b21..eae4a88c 100644 --- a/files/gtcs-ref-integ-init.sql +++ b/files/gtcs-ref-integ-init.sql @@ -29,3 +29,29 @@ insert into employee( emp_no, last_name, dept_no) values (7, 'e7', 2); insert into employee( emp_no, last_name, dept_no) values (8, 'e8', 3); insert into employee( emp_no, last_name, dept_no) values (9, 'e9', 3); commit; + +-- ### ACHTUNG: IMPORTANT ### +-- On WINDOWS setting 'set bail on' is siletnly ignored when .sql commands +-- are passed via PIPE, i.e. using command like this: +-- type | %fb_home%\isql host/port:db_file +-- If some statement from failed then script +-- will be CONTINUED, thus ignoring SET BAIL ON! +-- The reason is that PIPE operator (vertical bar, "|") is considered +-- on Windows as *interactive*, i.e. like user manually types command-by-command. +-- On Linux this is not so, and any failed statement will stop execurion +-- of the whole script immediately. So, we have a +-- ############################################### +-- ### DIFFERENT BEHAVIOUR ON WINDOWS vs LINUS ### +-- ############################################### +-- See also: +-- 1. Discussion with pcisar, alex and dimitr: +-- subj: "[new-qa] ISQL "SET BAIL ON" problem on Windows when commands come from PIPE" +-- date: 12-mar-2022 16:04 +-- 2. doc\README.isql_enhancements.txt ("if the user loads isql interactively and later +-- executes a script with the input command, this is considered an interactive session +-- even though isql knows it's executing a script") + +-- BECAUSE OF THIS, IT IS MANDATORY TO RETURN BAIL TO ITS DEFAULT VALUE: +--############ +set bail off; +--############