Provide compiler warning in case when there is EXCEPTION command WITHOUT name 
specified OUTSIDE handling block
--------------------------------------------------------------------------------------------------------------

                 Key: CORE-4474
                 URL: http://tracker.firebirdsql.org/browse/CORE-4474
             Project: Firebird Core
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 3.0 Alpha 2
            Reporter: Pavel Zotov
            Priority: Minor


The following code compiles without any warnings but also it does not raise any 
exception as it might be expected when reading such code (yes, unfortunately 
I've forgot the documentation issues about it at that moment!):

create or alter procedure px as begin end;
commit;
recreate exception ex_bad_rows_found 'ex_bad_rows_found';
commit;

recreate table td(id int); commit;
recreate table tlog(dts timestamp default 'now', msg varchar(30) ); commit;

set term ^;
create or alter procedure px as
  declare v_id int;
begin
  select id from td rows 1 into v_id;
  if ( v_id is not null  ) then
  begin
    in autonomous transaction do
      insert into tlog(msg) values('found rows in td, id='||:v_id);

    --#######
    exception; -- instead of correct: exception ex_bad_rows_found;
    --#######

  end
end
^set term ;^
commit;
insert into td values(1);
commit;


If we run the following EB:

execute block as
begin
  execute procedure px;
end

-- there will be no ecxeption and it corresponds with documentation.
But such *logic* error can be hardly found because of absence any compiler 
warnings about no-named exception command OUTSIDE when-block.

Is it possible to add such warning ? Or (better) issue an ERROR for such BAD 
code ?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to