Issue Details (XML | Word | Printable)

Key: CORE-1417
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: michalk1
Votes: 0
Watchers: 0

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

"Invalid BLOB ID" in IBX insert operation

Created: 20/Aug/07 05:20 AM   Updated: 19/Sep/16 05:18 AM
Component/s: Engine
Affects Version/s: 2.1 Beta 1
Fix Version/s: 2.1 Beta 2

File Attachments: 1. Zip Archive (327 kB)

Environment: FB 2.1 Beta 1, Windows XP, IBX 6.01 (Delphi 6)

QA Status: Cannot be tested

 Description  « Hide
When executing two subsequent insert operations into a blob field, first one with arbitrary not null value and the second one with null value, "Invalid BLOB ID" error arises on condition that transaction is restarted between the two calls. It seems (my presumption) that when parameter is assigned a null value, IBX just sets some flag and leaves rest of the parameter structure intact, which allows the old "BLOB ID" to survive to the next call. Unlike previous Firebird versions, FB2.1 Beta1 probably tests validity of the "BLOB ID" even if the parameter contains null value, which fails after commit of the original transaction.


Ibsql.ParamByName('MEMOFLD').AsString := 'AAA'; // any not null value

Ibsql.ParamByName('MEMOFLD').Clear; // null value
Ibsql.ExecQuery; // "Invalid BLOB ID" raised here

The same code runs ok if
- ran against FB1.5 or FB2.0 OR
- inserts are executed within the same transaction OR
- CHARACTER SET is not specified in field definiton

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov made changes - 20/Aug/07 05:32 AM
Field Original Value New Value
Assignee Adriano dos Santos Fernandes [ asfernandes ]
Sean Leyne added a comment - 20/Aug/07 11:05 AM
IBX does not directly support Firebird, never has.

v2.1 contains changes to the treatment/definition of Blob's at the API level, which is the likely why the application no longer runs correctly.

You are advised to:

- investigate other database connection components (IBObjects or FIBPlus), or
- use the older FBClient/GDS32 DLLs for your client application

Adriano dos Santos Fernandes added a comment - 20/Aug/07 12:11 PM
No, Sean!

There is already a similar problem using .Net Provider, but I wasn't able to reproduce it using fbclient.

Adriano dos Santos Fernandes added a comment - 20/Aug/07 11:07 PM
Michal, could you please attach here a simple test case, that I can configure database location to test?

michalk1 added a comment - 21/Aug/07 03:27 AM
Test case application

michalk1 made changes - 21/Aug/07 03:27 AM
Attachment [ 10530 ]
michalk1 added a comment - 21/Aug/07 03:30 AM
Sean, I know that IBX officially doesn't support Firebird and in long term its better to switch to a different component set, but so far it works ok. After all, IBX gurantees support of older interbase versions and FB API is said to be backward compatible as well, so theoretically this could work as long as I don't use new FB features. Since Delphi includes IBX sources, it is also possible to build modified IBX version.

Change of client library (IBX uses GDS32.DLL) doesn't help, the exception is still raised.

Adriano, I attached a test case. Just run the exe file, fill in database name, click at "Create Db" (once) and then at "Run insert". This should lead to the exception in FB2.1 Beta1.

Adriano dos Santos Fernandes added a comment - 21/Aug/07 10:27 PM
Thanks for the test case.

Adriano dos Santos Fernandes made changes - 21/Aug/07 10:27 PM
Fix Version/s 2.1 Beta 2 [ 10190 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Pavel Cisar made changes - 26/Dec/07 12:30 PM
Status Resolved [ 5 ] Closed [ 6 ]
Pavel Cisar made changes - 28/Jan/08 01:19 PM
Workflow jira [ 12850 ] Firebird [ 14621 ]
Pavel Zotov made changes - 19/Jan/16 05:07 AM
QA Status No test
Pavel Zotov made changes - 19/Sep/16 05:18 AM
Status Closed [ 6 ] Closed [ 6 ]
QA Status No test Cannot be tested