You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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)
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;
============
1
SQL> select mon$sql_text from mon$statements;
=================
0:1
MON$SQL_TEXT:
Statement failed, SQLSTATE = 42000
invalid BLOB ID
SQL> commit;
SQL> select mon$sql_text from mon$statements;
=================
0:1
MON$SQL_TEXT:
select mon$sql_text from mon$statements
SQL> select mon$sql_text from mon$statements;
=================
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
The text was updated successfully, but these errors were encountered: