Skip to content
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

Incorrect line number is shown in call stack [CORE5354] #5627

Open
firebird-automations opened this issue Sep 22, 2016 · 1 comment
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pcisar

Sample code below demonstrates incorrect line number in call stack.

Commenting out 'first 5' in another 'select' statement above
(in the code block which is not even executed)
fixes the line number shown in call stack.

(removing works the same as commenting out)

Some stored procedures are quite big and it would be really helpful
to know correct line number in case of similar errors.

set term ^;
create or alter procedure tmp_sp
returns (i integer )
as
declare variable j integer;
begin
if (1=2) then begin
for select first 5 RDB$TYPE from RDB$TYPES into :j /* not executed, comment out `first 5` to get correct line number in call stack */
do begin
/* ... */
end
end
else if (1=1) then begin
Select RDB$TYPE from RDB$TYPES into :j; /* line 13, multiple rows exception happens here */
/* ... */
suspend;
end else if (2=3) then begin
/* ... */
suspend;
end
end /* line 20, call stack shows this line when `first 5` is used above */
^
set term ;^
commit;

select * from tmp_sp; /* should raise multiple rows exception at line 13, not 20 */
/*multiple rows in singleton select
-At procedure 'TMP_SP' line: 20, col: 1*/

drop procedure tmp_sp;
commit;

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Worth testing against v3.0.1, it has the lexer reworked and better line/column position parsing.

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

No branches or pull requests

1 participant