Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum string length (32767 bytes) is not validated [CORE4781] #5080

Closed
firebird-automations opened this issue May 4, 2015 · 7 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Attachment: DML-blob-literal-65535-vs-65536-characters.zip [ 12741 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Component: Engine [ 10000 ]

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Version: 3.0 Beta 1 [ 10332 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

summary: Maximum string length (32765 bytes) is not validated => Maximum string length (32767 bytes) is not validated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants