Skip to content

Feature SET AUTOTERM in ISQL #7868

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

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Feature SET AUTOTERM in ISQL #7868

merged 1 commit into from
Nov 23, 2023

Conversation

asfernandes
Copy link
Member

No description provided.

@dmitry-lipetsk
Copy link
Contributor

recreate package body PACKAGE1
as
begin
 procedure P001
  (a1 integer not null=0,
   a2 double precision=3,
   a3 character varying(12) character set utf8 not null collate utf8 = _win1251 x'ABCDEF')
  returns
  (r1 integer not null,
   r2 double precision,
   r3 character varying(12) character set utf8 not null collate utf8);

 procedure P001
  (a1 integer not null=0,
   a2 double precision=3,
   a3 character varying(12) character set utf8 not null collate utf8 = _win1251 x'ABCDEF')
  returns
  (r1 integer not null,
   r2 double precision,
   r3 character varying(12) character set utf8 not null collate utf8)

 as
  declare procedure SUB_SP1(aa integer) returns (bb double precision)
  as
    declare procedure SUB2_SP1(aa integer) returns (bb double precision)
    as
      declare procedure SUB3_SP1(aa integer) returns (bb double precision)
      as
        declare procedure SUB4_SP1(aa integer) returns (bb double precision)
        as
        begin
         bb=case when (aa)<(case when (aa)<1 then (1) else (case when (aa)<1 then (1) else (2) end) end) then (case when (aa)<1 then (case when (aa)<1 then (1) else (2) end) else (2) end) else (3) end;
        end
      begin
       bb=case when (aa)<(case when (aa)<1 then (1) else (case when (aa)<1 then (1) else (2) end) end) then (case when (aa)<1 then (case when (aa)<1 then (1) else (2) end) else (2) end) else (3) end;
      end
    begin
     bb=case when (aa)<(case when (aa)<1 then (1) else (case when (aa)<1 then (1) else (2) end) end) then (case when (aa)<1 then (case when (aa)<1 then (1) else (2) end) else (2) end) else (3) end;
    end
  begin
   bb=case when (case when (case when (aa)<(case when (aa)<1 then (1) else (case when (aa)<1 then (1) else (2) end) end) then (case when (aa)<1 then (case when (aa)<1 then (1) else (2) end) else (2) end) else (3) end)<(case when (aa)<1 then (1) else (case when (aa)<1 then (1) else (2) end) end) then (case when (aa)<1 then (case when (aa)<1 then (1) else (2) end) else (2) end) else (3) end)<(case when (aa)<1 then (1) else (case when (aa)<1 then (1) else (2) end) end) then (case when (aa)<1 then (case when (aa)<1 then (1) else (2) end) else (2) end) else (3) end;
  end

  declare variable v1 char(32) character set win1251;
  declare variable v2 varchar(64) character set win1251;

 begin
 end
end

@asfernandes
Copy link
Member Author

recreate package body PACKAGE1

What you mean?

@dmitry-lipetsk
Copy link
Contributor

Hello.

What you mean?

Test case :)

@asfernandes
Copy link
Member Author

Do you found a problem or no?

@dmitry-lipetsk
Copy link
Contributor

Hello,

Do you found a problem or no?

No, I don't have.

It was example for testing your new feature.

If it can be process such SQL without any problems, I'm sorry.

@asfernandes
Copy link
Member Author

It give error about inexistent package, so it worked.

@dyemanov
Copy link
Member

Wasn't it merged too fast? I hoped to have it reviewed more closely.

@hvlad
Copy link
Member

hvlad commented Nov 23, 2023

Debug build throws immediately at start of isql:

"cannot decrement string_view iterator before begin"

Call stack:

isql.exe!std::_String_view_iterator<std::char_traits>::operator--() Line 966 C++
isql.exe!trim(std::basic_string_view<char,std::char_traits> str={...}) Line 43 C++
isql.exe!FrontendLexer::isBufferEmpty() Line 77 C++
isql.exe!StatementGetter::getStatement() Line 7560 C++
isql.exe!do_isql() Line 6168 C++
isql.exe!ISQL_main(int argc=2, char * * argv=0x0000000000533980) Line 1886 C++
isql.exe!main(int argc=2, char * * argv=0x0000000000533980) Line 32 C++
[External Code]

@pavel-zotov
Copy link

It would be nice to see hints about this feature in:

  1. inside ISQL ("help set;")
  2. outside, i.e. when we get help via 'ISQL -?'

@pavel-zotov
Copy link

PS.
Such a welcome change... Thank you, Adriano! From all who have to run ISQL scripts! :-)

asfernandes added a commit that referenced this pull request Nov 23, 2023
@asfernandes
Copy link
Member Author

Debug build throws immediately at start of isql:

"cannot decrement string_view iterator before begin"

Should be fixed.

@asfernandes
Copy link
Member Author

Wasn't it merged too fast? I hoped to have it reviewed more closely.

It was discussed in devel, and this implementation is much simpler (but still as discussed) after fact that I give up to treat multibyte alternate strings (say q'ç...ç' for example) in engine instead of client.

So maybe the merge was fast, but we have no standard here. We have features for many times with opened PR and not commented. We have features commented and stuck with bugs and merged, etc.

@pavel-zotov
Copy link

Some strange case encountered with affecting of semicolon that is specified within single-lines comments ("-- ").
Consider script:

set bail on;
set list on;

shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';
show version;

set echo on;

create table test (
     x int
    ,y int -- 1;2;3
);
-- q;w;e

commit;

select 'Script completed successfully.' as "Message:" from rdb$database;
quit;

This script output is:

Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 3, column 8

Please note on two places:

-- 1;2;3
-- q;w;e

If I remove ";3" from "-- 1;2;3" then script will go further but again fails on next similar line, which is outside of table definition. Output will be:

Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 1
-e

And, if we remove ";e" from second line, then script finishes OK.
So, the problem somehow relates to ";" specified in the single-lined comment.
But only when such comment contains more than 1 semicolon.

This case encountered during QA auxiliary script execution which failed because of that.
So, currently we have no ability to see overall QA results for FB 6.x :-)

asfernandes added a commit that referenced this pull request Nov 24, 2023
@asfernandes
Copy link
Member Author

Some strange case encountered with affecting of semicolon that is specified within single-lines comments ("-- ").
Consider script:

Fixed, thanks.

@asfernandes
Copy link
Member Author

There will be a difference in tests.

v5:

SQL> -- comment
SQL> select error from rdb$database;
Statement failed, SQLSTATE = 42S22
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-ERROR
-At line 1, column 8

master:

SQL> -- comment
CON> select error from rdb$database;
Statement failed, SQLSTATE = 42S22
Dynamic SQL Error
-SQL error code = -206
-Column unknown
-ERROR
-At line 2, column 8

Before this change, ISQL eats leading comments and do not pass them to the engine.

IMO, this is an error and the new behavior is much more logical.

@asfernandes
Copy link
Member Author

Another change was the "inside comment indicator", that I extended one character to align correctly:

v5:

SQL> /* x
--> */

master:

SQL> /*
---> x

@pavel-zotov
Copy link

There will be a difference in tests.

Instead of this:

SQL> -- comment
CON> select error from rdb$database;
Statement failed, SQLSTATE = 42S22

i see (on WINDOWS!) a bit different:

Database: /:employee, User: SYSDBA
SQL> SQL> -- comment
CON> select error from rdb$database;
Statement failed, SQLSTATE = 42S22

i.e. SQL> SQL> - duplicated prompt.

@pavel-zotov
Copy link

Another change was the "inside comment indicator",

This also differs on Windows (and i've sent recently small report by email).
Let us put these lines to some script:

/* x
--> */

Then let's run:

type set-autoterm5.sql | isql /:employee
Database: /:employee, User: SYSDBA
SQL> ---> CON>

SQL> ---> CON>

@pavel-zotov
Copy link

Let's check again after reducing the noise about the Windows bug.

I've checked just now snapshot 6.0.0.142 from github Actions, with timestamp: 09:00
Performed same commands:
type <script.sql> | %FB_BIN_PATH%\isql.exe -q localhost:employee

Result: it seems perfect now :-)

  1. script containing only comments:
/*
*/

/*
1
*/

/*
1
2
3
*/

/*
1
2
3
4
*/

-- produces zero output

  1. same for script:
/* x
--> */

(i.e. no output)

  1. script
select error from rdb$database;

-- produces:

Dynamic SQL Error
-SQL error code = -206
-Column unknown
-ERROR

(i.e. no noise characters/tokens)

@dmitry-lipetsk
Copy link
Contributor

dmitry-lipetsk commented Nov 24, 2023

Hello Adriano,

Could you test another SQL with '\r' char?

This is a C-string:

select 1 from rdb$database -- THIS_IS_COMMENT \r WHERE 1=0

My results (through IBP) are:
FB2.5: one record
FB4: empty result set

Thanks.

@asfernandes
Copy link
Member Author

My results (through IBP) are:
FB2.5: one record
FB4: empty result set

I changed isql and looks like you are reporting differences unrelated to isql.

I'm avoiding to give an opinion which is correct now because I'm sure will appear one or two to be contrary. :)

@dmitry-lipetsk
Copy link
Contributor

dmitry-lipetsk commented Nov 24, 2023

I asked because I had not seen a test for single '\r' in:

BOOST_AUTO_TEST_CASE(SkipSingleLineCommentsTest)
{
	FrontendLexer lexer(
		"-- comment 0\r\n"
		"set -- comment 1\n"
		"stats -- comment 2\r\n"
		"- -- comment 3\n"
		"-- comment 4"
	);

I think this case should be tested here (in this patch).

@pavel-zotov
Copy link

I have following results for case when .sql contains only CR (i.e. ASCII_CHAR(13)) for EOL:

ISQL Version: WI-V2.5.9.27156 Firebird 2.5
Server version:
WI-V2.5.9.27156 Firebird 2.5
WI-V2.5.9.27156 Firebird 2.5/tcp (Image-PC1)/P12
WI-V2.5.9.27156 Firebird 2.5/tcp (Image-PC1)/P12
 WHERE 1=0;om rdb$database -- THIS_IS_COMMENT
Expected end of statement, encountered EOF

C:\FB\30SS\isql /:employee -z -i make-SQL_using_cr_only_as_EOL.tmp.sql
ISQL Version: WI-V3.0.12.33724 Firebird 3.0
Server version:
WI-V3.0.12.33724 Firebird 3.0
WI-V3.0.12.33724 Firebird 3.0/tcp (Image-PC1)/P15:C
WI-V3.0.12.33724 Firebird 3.0/tcp (Image-PC1)/P15:C
 WHERE 1=0;om rdb$database -- THIS_IS_COMMENT
Expected end of statement, encountered EOF

C:\FB\40SS\isql /:employee -z -i make-SQL_using_cr_only_as_EOL.tmp.sql
ISQL Version: WI-V4.0.5.3031 Firebird 4.0
Server version:
WI-V4.0.5.3031 Firebird 4.0
WI-V4.0.5.3031 Firebird 4.0/tcp (Image-PC1)/P17:C
WI-V4.0.5.3031 Firebird 4.0/tcp (Image-PC1)/P17:C
 WHERE 1=0;om rdb$database -- THIS_IS_COMMENT
Expected end of statement, encountered EOF

C:\FB\50SS\isql /:employee -z -i make-SQL_using_cr_only_as_EOL.tmp.sql
ISQL Version: WI-V5.0.0.1277 Firebird 5.0 RC 2
Server version:
WI-V5.0.0.1277 Firebird 5.0 RC 2
WI-V5.0.0.1277 Firebird 5.0 RC 2/tcp (Image-PC1)/P18:C
WI-V5.0.0.1277 Firebird 5.0 RC 2/tcp (Image-PC1)/P18:C
 WHERE 1=0;om rdb$database -- THIS_IS_COMMENT
Expected end of statement, encountered EOF

C:\FB\60SS\isql /:employee -z -i make-SQL_using_cr_only_as_EOL.tmp.sql
ISQL Version: WI-T6.0.0.142 Firebird 6.0 Initial
Server version:
WI-T6.0.0.142 Firebird 6.0 Initial
WI-T6.0.0.142 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C
WI-T6.0.0.142 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C
select 1 from rdb$database -- THIS_IS_COMMENT 
 WHERE 1=0;
Records affected: 0

NOTE-1: 6.x does not issue error message, but this is the only branch which reports about affected records (all others "swallow" it)
NOTE-2: 6.x produces line "select 1 from rdb$database -- THIS_IS_COMMENT" only when its output is redirected to file. This line will be "overwritten" by next one if output is directed to STDOUT.

Script is in attached .zip
It contains single chr(13) character between 'THIS IS COMMENT' and 'WHERE'.
make-SQL_using_cr_only_as_EOL.tmp.sql.zip

@pavel-zotov
Copy link

PS. small part of screen with hex codes of .sql
make-SQL_using_cr_only_as_EOL hex

@dyemanov
Copy link
Member

@pavel-zotov And on Linux your test shows no error and "Records affected: 0" in all FB versions ;-)

@pavel-zotov
Copy link

The sooner isql behavour on Windows will be as on Linux - the better for [almost] all of us ;-)

@pavel-zotov
Copy link

Unfortunately, we still have problems with some tests from QA. And all of them seem to be related to new ISQL feature.
Please see attached .zip: there are several examples for 6.0.0.150 (all of them passes Ok on 5.x)
set-autoterm-failed-on-6_0_0_150_-_examples.zip

@pavel-zotov
Copy link

PS. And this also looks strange:

C:\Users\PashaZ>isql localhost:employee -z
ISQL Version: WI-T6.0.0.150 Firebird 6.0 Initial
Server version:
WI-T6.0.0.150 Firebird 6.0 Initial
WI-T6.0.0.150 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C
WI-T6.0.0.150 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C
Database: localhost:employee, User: SYSDBA
SQL>
SQL> /* foo */
CON>
CON>
CON> ;
SQL>
SQL> -- bar
CON>
CON>
CON>
CON> ;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Unexpected end of command - line 1, column 1
SQL>

(i mean: why we have to put semicolon at the end of any comment - either multi-line or single-lined ?

@asfernandes
Copy link
Member Author

Unfortunately, we still have problems with some tests from QA. And all of them seem to be related to new ISQL feature. Please see attached .zip: there are several examples for 6.0.0.150 (all of them passes Ok on 5.x) set-autoterm-failed-on-6_0_0_150_-_examples.zip

All the problems seems for me as clear bugs of ISQL (before the change).

They have no logic for me.

If we can't fix this things in major versions, then we can't improve anything.

I see no reason to adapt code to accept these cases.

@pavel-zotov
Copy link

OK, but is it documented somewhere that one can not specify TWO delimiters without any command between them ?
Like this:

create domain dm_int int;;

or

SET TERM ^;
EXECUTE BLOCK AS
BEGIN
    -- nop --
END ^^
SET TERM ;^

-- ?

@pavel-zotov
Copy link

PS And what about #7868 (comment) ?

- This option can also be activated with command line parameter -autot(erm)
- It can only be used with Firebird engine/server v6 or later
- SET TERM command automatically sets AUTOTERM to OFF
- SET AUTOTERM ON command automatically sets TERM to semicolon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What terminator will be set after SET AUTOTERM OFF ?
Will it remains semicolon or will be returned to the state as before SET AUTOTERM ON ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put in the docs that it is set to semicolon. For me it was clear that it's not reverted when AUTOTERM is turned OFF, but we may improve it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was about a bit more clear docs.

@pavel-zotov
Copy link

SET TERM command automatically sets AUTOTERM to OFF

Yes, it is so:

-- ######
-- check: "SET TERM command automatically sets AUTOTERM to OFF" ?
-- ######
set echo on;
set list on;
set bail on;
shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';

set autoterm on;
recreate table test(id int, x int);
create procedure sp_test(a_id int) returns(o_x int) as
begin
    for select x from test where id = :a_id into o_x do suspend;
end;
commit;

set term $;
alter procedure sp_test(a_id int) returns(o_x_quad bigint) as
begin
    for select x*x from test where id = :a_id into o_x_quad do suspend;
end$
set$
set term ;$
commit;

Output:

set list on;
set bail on;
shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';

set autoterm on;
recreate table test(id int, x int);
create procedure sp_test(a_id int) returns(o_x int) as
begin
    for select x from test where id = :a_id into o_x do suspend;
end;
commit;

set term $;
alter procedure sp_test(a_id int) returns(o_x_quad bigint) as
begin
    for select x*x from test where id = :a_id into o_x_quad do suspend;
end$
set$
. . .
Auto Term:               OFF
Terminator:              $
. . .
set term ;$
commit;

(i.e. no errors)

SET AUTOTERM ON command automatically sets TERM to semicolon

This is not so (or at least i could not achieve such result):

-- ######
-- check: "SET AUTOTERM ON command automatically sets TERM to semicolon" ?
-- ######
set echo on;
set list on;
set bail on;
shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';

set term $;
set$
set autoterm on;
set;
recreate table test(id int);

Output:

set list on;
set bail on;
shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';

set term $;
set$
. . .
Auto Term:               OFF
Terminator:              $
. . .
set autoterm on;
set;
recreate table test(id int);
Expected end of statement, encountered EOF

@asfernandes
Copy link
Member Author

OK, but is it documented somewhere that one can not specify TWO delimiters without any command between them ?

I will review this case as well the one with comments preceeding the semicolon with an empty statement.

But this one is old bug for me:

SQL> set term ^;
SQL> set term ^;

@aafemt
Copy link
Contributor

aafemt commented Nov 25, 2023

What exactly you consider a bug in this example? Is it in the tracker?

@asfernandes
Copy link
Member Author

I didn't knew that SET TERM without a specified term would change it to semicolon.
So looks like all the cases are about trying to execute empty statements.

@aafemt
Copy link
Contributor

aafemt commented Nov 25, 2023

No, SET TERM must raise an error if new terminator is not given/empty but it doesn't. Did you put this bug into the tracker?

@asfernandes
Copy link
Member Author

No, SET TERM must raise an error if new terminator is not given/empty but it doesn't. Did you put this bug into the tracker?

The code is clear, see DEFTERM = ";".

@asfernandes
Copy link
Member Author

@pavel-zotov the cases you reported (except things about '\r') should be fixed.

@asfernandes
Copy link
Member Author

This is not so (or at least i could not achieve such result):

-- ######
-- check: "SET AUTOTERM ON command automatically sets TERM to semicolon" ?
-- ######
set echo on;
set list on;
set bail on;
shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';

set term $;
set$
set autoterm on;

There is an error here, it should be set autoterm on$

set;
recreate table test(id int);

@pavel-zotov
Copy link

One more example. Consider script:

shell del g:\temp\tmp4test.fdb 2>nul;
create database 'localhost:g:\temp\tmp4test.fdb' user sysdba password 'masterkey';
alter database set linger to 0;

set list on;
set blob all;

recreate table test(sid int, tid int, txt blob, txt_len computed by (octet_length(txt)) );
commit;

set echo OFF;


/*
    1. Lorem ipsum dolor sit amet, consectetur adipiscing elit
    2. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
    3. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
    4. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur
    5. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
*/

insert /* #1 */ into test(sid, tid, txt)
select s.mon$statement_id, s.mon$transaction_id, s.mon$sql_text
from mon$statements s
where
    s.mon$transaction_id = current_transaction
rows 1
;
commit;

-- ######################################################################################

--    1. Lorem ipsum dolor sit amet, consectetur adipiscing elit
--    2. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
--    3. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
--    4. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur
--    5. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

insert /* #2 */ into test(sid, tid, txt)
select s.mon$statement_id, s.mon$transaction_id, s.mon$sql_text
from mon$statements s
where
    s.mon$transaction_id = current_transaction
rows 1
;
commit;

select * from test;
quit;

Run it. Outcome will include comments, multi- and single- lined (as they are part of executed statements):

ISQL Version: WI-T6.0.0.154 Firebird 6.0 Initial
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-T6.0.0.154 Firebird 6.0 Initial"
Firebird/Windows/AMD/Intel/x64 (remote server), version "WI-T6.0.0.154 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C"
Firebird/Windows/AMD/Intel/x64 (remote interface), version "WI-T6.0.0.154 Firebird 6.0 Initial/tcp (Image-PC1)/P19:C"
on disk structure version 13.2

SID                             153
TID                             7
TXT                             80:0
/*
    1. Lorem ipsum dolor sit amet, consectetur adipiscing elit
    2. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
    3. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
    4. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur
    5. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum
*/

insert /* #1 */ into test(sid, tid, txt)
select s.mon$statement_id, s.mon$transaction_id, s.mon$sql_text
from mon$statements s
where
    s.mon$transaction_id = current_transaction
rows 1
TXT_LEN                         669

SID                             174
TID                             10
TXT                             80:1
-- ######################################################################################

--    1. Lorem ipsum dolor sit amet, consectetur adipiscing elit
--    2. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
--    3. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
--    4. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur
--    5. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

insert /* #2 */ into test(sid, tid, txt)
select s.mon$statement_id, s.mon$transaction_id, s.mon$sql_text
from mon$statements s
where
    s.mon$transaction_id = current_transaction
rows 1
TXT_LEN                         764

@asfernandes
Copy link
Member Author

It's not difficult to change it, but I question.

Comments are valid part of a statement text. Saying that engine don't need to parse them to avoid cycles is nonsense for me.

Not sending them has consequences in trace and monitoring, for example.

@pavel-zotov
Copy link

Comments are valid part of a statement text

Yes, in a statement like this:

select
    /* lorem 
    ipsum */
  pi()
from rdb$database;

-- we must see such comments in the trace and mon$statements.

But not when comments are placed between statements (like in previous example).

@aafemt
Copy link
Contributor

aafemt commented Nov 26, 2023

Comments are valid part of a statement text.

Which one? Below, above or both?

@pavel-zotov
Copy link

Most of examples which caused different output/outcome in v 6.x have been added in QA, test name:
tests/functional/basic/isql/test_autoterm_03.py

Example with comments that are unexpectedly shown ( #7868 (comment) ) not yet added. Waiting for fix / reply.

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

Successfully merging this pull request may close these issues.

6 participants