Skip to content

Regression in FB 4.x : "Unexpected end of command" with incorrect line/column info #6807

@pavel-zotov

Description

@pavel-zotov

Consider following INCORRECT script (it contains wrong token in RETURNUNG clause: "AS" instead of "INTO"):

recreate table test(id int);
insert into test(id) values(null);
set term ^;
execute block as
    declare v_id int;
begin
    update test set id = -id returning id as v_id; -- this is WRONG; "INTO" must be here
end
^
set term ;^

Its output will be:

  1. in FB 2.5:

Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 4, column 43
-as

  1. in FB 3.0.8.33465:

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

(looks strange because all commands appear to have tokens of completion; but anyway, we can easy find problem place because of non-zero line/column values)

  1. in FB 4.0.0.2479:

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

This output is much worse: we can not find problem place because of zeroes for line/column.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions