Regression: no more can change column from BLOB to VARCHAR or back
------------------------------------------------------------------

                 Key: CORE-6052
                 URL: http://tracker.firebirdsql.org/browse/CORE-6052
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0.4
         Environment: any with Firebird 3.x
            Reporter: Arioch


Expanding columns from VarChar(nn) to BLOB SUB_TYPE TEXT (or  shrinking it 
back) is working in Firebird 2.1.7 and 2.5.8 but it fails in Firebird 3.0.4

P.S. I know there is a workaround for this regression: creating extra column 
and copying data there. Still, it is just a workaround, and slow one on large 
tables.
https://stackoverflow.com/questions/34368282

------------

CREATE DOMAIN T_TEXT_BLOB AS
BLOB SUB_TYPE 1;

CREATE DOMAIN T_TEXT_VC AS
VARCHAR(20);

CREATE TABLE ALTER_TEXT (
    TARGET T_TEXT_VC);

INSERT INTO ALTER_TEXT(TARGET) VALUES('aaa');
INSERT INTO ALTER_TEXT(TARGET) VALUES('bbb');
INSERT INTO ALTER_TEXT(TARGET) VALUES('ccc');

COMMIT;

--  now we want to change the column WITHOUT copying data


update RDB$RELATION_FIELDS set
RDB$FIELD_SOURCE = 'T_TEXT_BLOB'
where (RDB$FIELD_NAME = 'TARGET') and
(RDB$RELATION_NAME = 'ALTER_TEXT')

/* works like a charm in FB 2.1 and FB 2.5, but fails in FB 3.0.4.

Unsuccessful execution caused by a system error that precludes successful 
execution of subsequent statements.
UPDATE operation is not allowed for system table RDB$RELATION_FIELDS.  */

/* ALTER TABLE ALTER_TEXT ALTER COLUMN TARGET TYPE T_TEXT_BLOB;

This operation is not defined for system tables.
unsuccessful metadata update.
ALTER TABLE ALTER_TEXT failed.
Cannot change datatype for column TARGET.  Changing datatype is not supported 
for BLOB or ARRAY columns. */

Fails with internal errors on both FB 2.1, FB 2.5, FB 3.0.4

So, the operation that worked (albeit in an "obsolete" way) on Firebird 2.1 and 
2.5 is no more working in 3.x

This regression is twice sad since "BLOB and array data types are not supported 
for move operation" was reportedly  fixed in BLOB and array data types are not 
supported for move operation





        

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to