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
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 = ' '
where id = 2;
insert into test(id, bf) values( 3, ' ' );
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
' '
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.
summary: Blob literal with length >= 65536 bytes can not be displayed or handled correctly after its saving via INSERT or UPDATE statement => Maximum string length (32765 bytes) is not validated
Submitted by: @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 = ' '
where id = 2;
insert into test(id, bf) values( 3, ' ' );
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
' '
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.
Commits: 020126e bdbdc30 FirebirdSQL/fbt-repository@b15cfe7 FirebirdSQL/fbt-repository@951b75d
The text was updated successfully, but these errors were encountered: