|
What tools do you use?
I use SQL Manager for InterBase and Firebird
My Firebird version is 3.0.2.32703 I still have the problem.
Any help would be appreciated. Do you have explicit COMMIT after DDL statements ?
I do confirm that error also occured using ISQL:
=== set echo on; reCREATE TABLE Operation ( ID BIGINT NOT NULL, Operation_Type BIGINT NOT NULL, DATE_CREATE BIGINT NOT NULL, DATE_OPERATION BIGINT NOT NULL, Code BIGINT NOT NULL, NAME BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, D_VALUE DOUBLE PRECISION DEFAULT 0 NOT NULL ); ALTER TABLE Operation ADD CONSTRAINT operation_pk_1 PRIMARY KEY ( ID ); set term ^; execute block as declare i bigint = 1; begin while (i <= 20) do begin update or insert into Operation(ID, Operation_Type,DATE_CREATE,DATE_OPERATION,Code,NAME,D_VALUE) values (:i,0,132345666243423423,132345666243423423,:i,'test',1); i = i + 1; end end ^ set term ;^ commit; -- We need this, otherwise get lock conflict on no wait transaction / -unsuccessful metadata update / -object TABLE "OPERATION" is in use ALTER TABLE Operation ADD surname BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL; update operation set code=2 where id=2; --commit; -- ### [ 1 ] ### NB: this will suppress 'invalid blob id' error (temp workaround ?..) set blob all; set list on; Select * from Operation where id in (1,2,3); quit; === If we uncomment line " --commit; -- ### [ 1 ] ###" than no errors will be. Checked on: WI-T4.0.0.687; WI-V3.0.3.32798 Is there any way to fix this problem?
The issue is that id of temporary blob was stored within the record, i.e. temporary blob was not materialized when created from default value.
It should be fixed now. Note, it is very bad idea to assign default values to the new blob field, it could make high memory\disk space usage when table with such is field is read. Better to assign some real values to the new blob field soon after ALTER TABLE. |
Another test (commit after second step), also works without problem.