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

"BLOB not found" error after creation/altering of the invalid trigger [CORE3305] #3672

Closed
firebird-issue-importer opened this issue Jan 9, 2011 · 12 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Jan 9, 2011

Submitted by: Dzirt (dzirt)

Relate to CORE4390
Relate to CORE4678
Is related to QA602

Database in dialect 3, ODS 11.2. In isql execute next command:

C:\>isql localhost:test3 -user SYSDBA -pass masterkey
Database: localhost:test3, User: SYSDBA
SQL> recreate table H( VAL Integer );
SQL> commit;
SQL>
SQL> set TERM ^ ;
SQL>
SQL> create or alter trigger H_AI for H
CON> active after insert position 0
CON> as
CON> begin
CON> NEW.VAL = 1;
CON> end^
Statement failed, SQLSTATE = 42000
attempted update of read-only column
SQL>
SQL> set TERM ; ^
SQL>
SQL> rollback;
SQL>
SQL> insert into H( VAL ) values( 123 );
Statement failed, SQLSTATE = HY000
BLOB not found
SQL>

In this and any other connection established before the execution of the statement 'create or alter trigger ...', can not insert data into a table H.

Commits: 17978f5 bfc9a9c 7b9be79 FirebirdSQL/fbt-repository@921f014 FirebirdSQL/fbt-repository@60e6051 FirebirdSQL/fbt-repository@fab228f

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2011

Commented by: @helebor

The first exception is correct. You can't assign to NEW.anything in an AFTER trigger.
The exception for the second statement seems weird though - seems as though the engine created the BLR for the trigger and then didn't dispose of its pointers properly when the transaction rolled back - hence, DSQL is looking for the code of a non-existent trigger..

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 10, 2011

Commented by: @dyemanov

Error "BLOB not found" here means the missing RDB$DEBUG_INFO blob which has been destroyed after a rollback. But even if the debug info would not be a problem, then the "attempted update of read-only column" error would be thrown once more. So the actual problem is that the new trigger gets loaded into the metadata cache before its body is validated, and it's never released from the cache once it's proven to be invalid.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 2, 2011

Modified by: @dyemanov

assignee: Dmitry Yemanov [ dimitr ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 3, 2014

Modified by: @dyemanov

Link: This issue relate to CORE4390 [ CORE4390 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 12, 2014

Commented by: @dyemanov

As both tickets (CORE3305 and CORE4390) reference the same issue consisting of two independent bugs, I'm renaming CORE3305 to describe the "invalid BLOB ID" bug while CORE4390 will describe the metadata cache bug.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 12, 2014

Modified by: @dyemanov

summary: 'BLOB not found' error in insert statement => "BLOB not found" error after creation/altering of the invalid trigger

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 12, 2014

Modified by: @dyemanov

Version: 3.0 Alpha 2 [ 10560 ]

Version: 3.0 Alpha 1 [ 10331 ]

Version: 2.5.2 Update 1 [ 10521 ]

Version: 2.1.5 Update 1 [ 10522 ]

Version: 2.5.2 [ 10450 ]

Version: 2.1.5 [ 10420 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 12, 2014

Modified by: @dyemanov

Fix Version: 2.5.3 [ 10461 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 13, 2014

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 12, 2015

Modified by: @dyemanov

Link: This issue relate to CORE4678 [ CORE4678 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 29, 2015

Modified by: @pavel-zotov

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

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 25, 2015

Modified by: @pcisar

Link: This issue is related to QA602 [ QA602 ]

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