Blob literal with length >= 65536 bytes can not be displayed or handled 
correctly after its saving via INSERT or UPDATE statement
---------------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4781
                 URL: http://tracker.firebirdsql.org/browse/CORE-4781
             Project: Firebird Core
          Issue Type: Bug
            Reporter: Pavel Zotov
         Attachments: DML-blob-literal-65535-vs-65536-characters.zip

Consider these statements:

recreate table test(
    id int,
    bf blob
); 
commit;
insert into test(id) values(1);
insert into test(id) values(2);
commit;

update test set bf = rpad('',32760, 
'ldlkdw89dw89d2kssdjkcsuic3892343kbmvasjhcvsdyucg872348234ejwehsjksi2ljkqwejklwo19ll.ajqa28976a;1kla')
where id = 1;
update test set bf = bf || rpad('',32760, 
'ldlkdw89dw89d2kssdjkcsuic3892343kbmvasjhcvsdyucg872348234ejwehsjksi2ljkqwejklwo19ll.ajqa28976a;1kla')
where id = 1;
update test set bf = bf || '1234567890abcdef'
where id = 1;

-- they all works fine, resulting blob will be written so that:
1) it could be displayed later using SET BLOB ALL 
2) its octet_length will return proper value (65536).

Now try to continue with following:

update test set bf = ' <character sequence with length = 65536>' 
where id = 2;

insert into test(id, bf) values( 3, ' <character sequence with length = 65536>' 
);
commit;

set blob all;
set list on;
select 
    id, 
    coalesce(bf, '$$$ NULL $$$') blob_content, 
    iif(bf is null, 'is-null!','not-null') bf_is_null, 
    octet_length(bf), 
    char_length(bf) 
from test;

Result will be:

ID                              1
BLOB_CONTENT                    ac:f1
' <character sequence with length = 65536>'
OCTET_LENGTH                    65536
CHAR_LENGTH                     65536

ID                              2
BLOB_CONTENT                    ac:f0

OCTET_LENGTH                    0
CHAR_LENGTH                     0

ID                              3
BLOB_CONTENT                    ac:f2

OCTET_LENGTH                    0
CHAR_LENGTH                     0


PS. Scripts for char_len = 65535 and 65536 bytes (and logs) see in attached 
file.

-- 
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

        

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to