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

LIKE, STARTING and CONTAINING fail if second operand >= 32K [CORE3233] #3605

Closed
firebird-issue-importer opened this issue Nov 13, 2010 · 7 comments

Comments

@firebird-issue-importer

Submitted by: @paulvink

Is related to QA283

create table blobz (zin blob sub_type 1);
commit;
/* insert stuff - or not... */

The following query:

select * from blobz where zin like cast(cast('woord' as char(32766)) as blob sub_type 1) || '!'

works, and returns a set which may or may not be empty, depending on what's in the table.

Now we add one more char:

select * from blobz where zin like cast(cast('woord' as char(32767)) as blob sub_type 1) || '!'

and we get: 335544321 - arithmetic exception, numeric overflow, or string truncation
(in 2.5, the following is added: blob truncation when converting to a string: length limit exceeded)

This happens with LIKE, STARTING and CONTAINING.

Commits: aafa381 1fc093e 3447e70 7e182bc a82fbb6 55f5ce3

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 13, 2010

Modified by: @paulvink

description: create table blobz (zin blob sub_type 1);
commit;
/* insert stuff - or not... */

The following query:

select * from blobz where zin like cast(cast('woord' as char(32766)) as blob sub_type 1) || '!'

works, and returns a set which may or may not be empty, depending on what's in the table.

Now we add one more char:

select * from blobz where zin like cast(cast('woord' as char(32767)) as blob sub_type 1) || '!'

and we get: 335544321 - arithmetic exception, numeric overflow, or string truncation
(in 2.5, the following is added: blob truncation when converting to a string: length limit exceeded

This happens with LIKE, STARTING and CONTAINING.

=>

create table blobz (zin blob sub_type 1);
commit;
/* insert stuff - or not... */

The following query:

select * from blobz where zin like cast(cast('woord' as char(32766)) as blob sub_type 1) || '!'

works, and returns a set which may or may not be empty, depending on what's in the table.

Now we add one more char:

select * from blobz where zin like cast(cast('woord' as char(32767)) as blob sub_type 1) || '!'

and we get: 335544321 - arithmetic exception, numeric overflow, or string truncation
(in 2.5, the following is added: blob truncation when converting to a string: length limit exceeded)

This happens with LIKE, STARTING and CONTAINING.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 2, 2011

Commented by: @dyemanov

Addition: if the BLOBZ.ZIN column is created without any explicit or implicit character set specified (i.e. NONE), then both queries throw: conversion error from string "BLOB". In other words, the second argument cannot be a blob (of any length) in this case.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 2, 2011

Modified by: @dyemanov

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 18, 2011

Modified by: @dyemanov

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

resolution: Fixed [ 1 ]

Fix Version: 2.5.1 [ 10333 ]

Fix Version: 3.0 Alpha 1 [ 10331 ]

Fix Version: 2.1.5 [ 10420 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 23, 2011

Modified by: @pcisar

Link: This issue is related to QA283 [ QA283 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 16, 2012

Modified by: @pmakowski

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 16, 2015

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Done successfully

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

Successfully merging a pull request may close this issue.

None yet
2 participants