Following problem is most of all caused by changes in isql behavour related to 'SET AUTOTERM;' feature ( #7868 ), but I think that it will be better to separate its description.
It does exists at least since 6.0.0.150 (25-noiv-2023).
Following batch creates two trivial .sql scripts: one calls another via "IN" command:
@echo off
setlocal enabledelayedexpansion enableextensions
set FB_HOME=C:\FB\60SS
set TMP_DIR=g:\temp
set DB_NAME=!TMP_DIR!\tmp4test.fdb
set TMP_CALLER=!TMP_DIR!\caller.tmp.sql
set TMP_CALLEE=!TMP_DIR!\callee.tmp.sql
if exist !DB_NAME! del !DB_NAME!;
echo create database 'localhost:!DB_NAME!' user sysdba password 'masterkey'; | !FB_HOME!\isql -q -z
(
echo in !TMP_CALLEE!;
) > !TMP_CALLER!
(
echo set bail on;
echo set heading off;
echo select 'Hi. My name is "!TMP_CALLEE!" and I am called from main scenario "!TMP_CALLER!" via "IN" command.' as msg from rdb$database;
echo /* Hi. I am dummy comment that was
echo written after previous statement */
@rem echo select 'This is one more statement.' as msg from rdb$database;
) > !TMP_CALLEE!
!FB_HOME!\isql localhost:!DB_NAME! -q -i !TMP_CALLER!
if errorlevel 1 (
echo Script "!TMP_CALLER!" FAILED, errorlevel=!errorlevel!
) else (
echo Script "!TMP_CALLER!" completed SUCCESSFULLY.
)
Script which is called has two commands: SELECT from rdb$database and - this is important - COMMENT after this.
No matter single- or multi- lined comment, but it is exactly what causes problem.
If we adjust variables appropriately to OS environment and run this batch then its output for FB 6.x will be
ISQL Version: WI-T6.0.0.154 Firebird 6.0 Initial
Server version:
WI-T6.0.0.154 Firebird 6.0 Initial
WI-T6.0.0.154 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C
WI-T6.0.0.154 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C
Hi. My name is "g:\temp\callee.tmp.sql" and I am called from main scenario "g:\temp\caller.tmp.sql" via "IN" command.
Script "g:\temp\caller.tmp.sql" FAILED, errorlevel=1
And this is so since 6.0.0.150.
For previous snapshots output was expected:
ISQL Version: WI-T6.0.0.139 Firebird 6.0 Initial
SQL> Server version:
WI-T6.0.0.139 Firebird 6.0 Initial
WI-T6.0.0.139 Firebird 6.0 Initial/tcp (Image-PC1)/P18:C
WI-T6.0.0.139 Firebird 6.0 Initial/tcp (Image-PC1)/P18:C
SQL>
Hi. My name is "g:\temp\callee.tmp.sql" and I am called from main scenario "g:\temp\caller.tmp.sql" via "IN" command.
Script "g:\temp\caller.tmp.sql" completed SUCCESSFULLY.
PS.
::: NOTE :::
If we UNcomment following line in the batch:
@rem echo select 'This is one more statement.' as msg from rdb$database;
-- then no problem with recent FB 6.x
So, this is relates to case when script is FINISHED with comment but not about intermediate one.
Following problem is most of all caused by changes in isql behavour related to 'SET AUTOTERM;' feature ( #7868 ), but I think that it will be better to separate its description.
It does exists at least since 6.0.0.150 (25-noiv-2023).
Following batch creates two trivial .sql scripts: one calls another via "IN" command:
Script which is called has two commands: SELECT from rdb$database and - this is important - COMMENT after this.
No matter single- or multi- lined comment, but it is exactly what causes problem.
If we adjust variables appropriately to OS environment and run this batch then its output for FB 6.x will be
And this is so since 6.0.0.150.
For previous snapshots output was expected:
PS.
::: NOTE :::
If we UNcomment following line in the batch:
-- then no problem with recent FB 6.x
So, this is relates to case when script is FINISHED with comment but not about intermediate one.