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

Regression: Trigger with UPDATE OR INSERT statement and IIF() not working as expected [CORE4622] #4937

Closed
firebird-automations opened this issue Nov 23, 2014 · 8 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sascha Michel (datiscum1)

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 (http://new.pk , iif( 1 = 1 , 2 ,3) , new.b )

matching( pk , a );

end
^

SET TERM ; ^

Commits: c933fad FirebirdSQL/fbt-repository@d72a2dc

====== 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

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

priority: Trivial [ 5 ] => Minor [ 4 ]

Regression: 3.0 Beta 1 [ 10332 ]

Version: 3.0 Alpha 2 [ 10560 ]

Version: 3.0 Alpha 1 [ 10331 ]

Component: Engine [ 10000 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Sascha Michel (datiscum1)

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" )

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Is the error message the same, "invalid request BLR"?

@firebird-automations
Copy link
Collaborator Author

Commented by: Sascha Michel (datiscum1)

Yes

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

summary: trigger with update or insert iif not in matching value => Regression: Trigger with UPDATE OR INSERT statement and IIF() not working as expected

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

assignee: Dmitry Yemanov [ dimitr ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

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