Issue Details (XML | Word | Printable)

Key: CORE-4622
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Dmitry Yemanov
Reporter: Sascha Michel
Votes: 0
Watchers: 3
Operations

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

Regression: Trigger with UPDATE OR INSERT statement and IIF() not working as expected

Created: 23/Nov/14 08:10 PM   Updated: 23/Sep/15 11:31 AM
Component/s: Engine
Affects Version/s: 3.0 Alpha 1, 3.0 Alpha 2
Fix Version/s: 3.0 Beta 2

Environment: Linux x64 Firebird-3.0.0.31441

QA Status: Done successfully
Test Details:
Confirmed on WI-T3.0.0.31374 Firebird 3.0 Beta 1:
Statement failed, SQLSTATE = HY000
invalid request BLR at offset 51
-undefined variable number


 Description  « Hide
When the values list contain a iif and that field is in the matching clause i got an error .
/*
cant format message 13:896 -- message file C:\windows\firebird.msg not found.
invalid request BLR at offset 43.
unknown ISC error 335545059.
*/
But in firebird 2.5 it works.

e.g.

CREATE TABLE "ATest" (
    PK INTEGER NOT NULL,
    A INTEGER,
    B INTEGER
);

ALTER TABLE "ATest" ADD CONSTRAINT "PK_ATest" PRIMARY KEY (PK);

CREATE OR ALTER VIEW "VW_ATest"(
    PK,
    A,
    B)
AS
select
    pk,
    a,
    b
from "ATest"
;

SET TERM ^ ;


CREATE OR ALTER TRIGGER "VW_ATest_BU" FOR "VW_ATest"
ACTIVE BEFORE UPDATE POSITION 0
AS
BEGIN
  POST_EVENT 'DUMMY_EVENT';
END
^

CREATE OR ALTER TRIGGER "VW_ATest_BU" FOR "VW_ATest"
ACTIVE BEFORE UPDATE POSITION 0
as
begin

  update or insert into "ATest" ( PK , A , B)

!!! Here comes the problem with iif !!!!!!!!!!!!!!!!
    values (new.pk , iif( 1 = 1 , 2 ,3) , new.b )

  matching( pk , a );


end
^

SET TERM ; ^



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sascha Michel added a comment - 24/Nov/14 10:02 AM
Another problem rdb$get_context worked in 2.5 but not in firebird 3
 values ( rdb$get_context( 'USER_SESSION' , 'MANDANT_GP_ID' ) , new."Gesch_Partner_ID" , new."RGMGP_RabattGruppenID" )

Dmitry Yemanov added a comment - 24/Nov/14 10:14 AM
Is the error message the same, "invalid request BLR"?

Sascha Michel added a comment - 24/Nov/14 10:20 AM
Yes