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

Invalid BLOB ID when working with monitoring tables [CORE2632] #3040

Closed
firebird-issue-importer opened this issue Sep 16, 2009 · 8 comments
Closed

Comments

@firebird-issue-importer

Submitted by: @hvlad

Is related to QA245

If first query with monitoring tables in transaction not returned blob fields to the client (i.e. blob fields was not present in SELECT list) than subsequent queries in the same transaction which referenced blob fields will fail with "Invalid BLOB ID" error.

The reason is :
- first query in transaction involving any monitoring table triggers creation of monitoring snapshot for this transaction
- when snapshot is created some temporary blobs is created too and bound to the transaction and to the request
- if this blobs not passed to the client its remains bound to the request
- when request finish its execution all temporary blobs bound to it released
- when another request going to open blob it fails

Example

firebird\bin>isql -user SYSDBA -pass masterkey s:\TEST.FDB -ch UNICODE_FSS
Database: s:\TEST.FDB, User: SYSDBA
SQL> select 1 from mon$database;

CONSTANT

============
1

SQL> select mon$sql_text from mon$statements;

 MON$SQL\_TEXT

=================
0:1

MON$SQL_TEXT:
Statement failed, SQLSTATE = 42000
invalid BLOB ID

SQL> commit;
SQL> select mon$sql_text from mon$statements;

 MON$SQL\_TEXT

=================
0:1

MON$SQL_TEXT:
select mon$sql_text from mon$statements

SQL> select mon$sql_text from mon$statements;

 MON$SQL\_TEXT

=================
0:1

MON$SQL_TEXT:
select mon$sql_text from mon$statements

SQL> exit;

Note, i used UNICODE_FSS connection charset. This is needed to avoid involving transliteration filter which is used by the engine if connection charset is different from blob field charset (see also patch for CORE2602)

Commits: f51d9e5 d9d8bf7

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 16, 2009

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 16, 2009

Commented by: @hvlad

The solution is to unbind from request temporary blob's created for monitoring tables

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 16, 2009

Modified by: @hvlad

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

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC1 [ 10362 ]

Fix Version: 2.1.4 [ 10361 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 16, 2009

Commented by: @hvlad

Workaround for FB 2.1.3 could be

a) Issue only one query of monitoring tables in transaction, or

b) Run
select mon$sql_text from mon$statements where mon$sql_text is not null

as the first query in transaction (you don't have to read blobs, just obtain its ID's)

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 16, 2009

Modified by: @pcisar

Link: This issue is related to QA245 [ QA245 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2011

Commented by: @pcisar

QA test added.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2011

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

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

Modified by: @pavel-zotov

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

QA Status: Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants