Issue Details (XML | Word | Printable)

Key: CORE-3003
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: kdv
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Procedure suspend check may cause restore to fail

Created: 16/May/10 11:05 AM   Updated: 23/Feb/11 11:18 AM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.5 Beta 1, 2.5 Beta 2, 2.1.3, 3.0 Initial, 2.5 RC1, 2.5 RC2
Fix Version/s: 2.5 RC3, 2.1.4, 3.0 Alpha 1

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Firebird 2.5 have new funtionality, that checks existance of SUSPEND statement in procedure being called via SELECT statement. If procedure does not contain SUSPEND, SELECTing from procedure will cause an error:

Procedure ... is not selectable (it does not contain a SUSPEND statement).

This seems to be ok, but same error can happen during RESTORE, and restore will fail.

Example:

1.
create or alter procedure A
returns (
    OUT integer)
AS
declare variable i integer;
begin
 select emp_no from employee
 where EMP_NO = 1
 into :out;
 suspend;
end

2.
create or alter procedure B
AS
declare variable i int;
begin
 SELECT out from a
 into :i;
end

3.
create or alter procedure A
returns (
    OUT integer)
AS
declare variable i integer;
begin
 select emp_no from employee
 where EMP_NO = 1
 into :out;
end

This will not cause any error, because dependency from procedure B and procedure A call method is not checked.

4. make backup, make restore. You will get ERROR

gbak: ERROR:invalid request BLR at offset 30
gbak: ERROR: Procedure A is not selectable (it does not contain a SUSPEND statement)
gbak:Exiting before completion due to errors

This is exactly the same problem, that exists with the change of parameter number or type of the procedure being called from another procedure. So, we have new one case of non-restorable backup.

I suggest to change this at least from ERROR to WARNING.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 16/May/10 02:41 PM
This has been fixed a couple of weeks ago.

Vlad Khorsun added a comment - 16/May/10 02:53 PM
Small note, fix was not completely correct and gbak show no warnings :)


  if (tdbb->getAttachment()->att_flags & ATT_gbak_attachment)
  {
- PAR_warning(Arg::Gds(isc_illegal_prc_type) << Arg::Str(name));
+ PAR_warning(Arg::Warning(isc_illegal_prc_type) << Arg::Str(name));
  }
  else
  {


Dmitry Yemanov added a comment - 16/May/10 03:08 PM
Mea culpa :-) To be fixed ASAP.