Issue Details (XML | Word | Printable)

Key: CORE-3233
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Paul Vinkenoog
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
Firebird Core

LIKE, STARTING and CONTAINING fail if second operand >= 32K

Created: 13/Nov/10 12:38 AM   Updated: 16/Jul/15 05:08 PM
Component/s: Engine
Affects Version/s: 2.1.3, 2.5.0
Fix Version/s: 2.5.1, 2.1.5, 3.0 Alpha 1

Issue Links:

QA Status: Done successfully

 Description  « Hide
create table blobz (zin blob sub_type 1);
/* 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.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 02/Feb/11 10:43 AM - edited
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.