Issue Details (XML | Word | Printable)

Key: CORE-3353
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Joe Slater
Votes: 0
Watchers: 0
Operations

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

Predicate (blob_field LIKE ?) describes the parameter as VARCHAR(30) rather than as BLOB

Created: 17/Feb/11 07:15 AM   Updated: 17/Jul/11 07:51 AM
Component/s: Engine
Affects Version/s: 2.1.0, 2.1.1, 2.1.2, 2.1.3, 3.0 Initial, 2.5.0
Fix Version/s: 2.5.1, 2.1.5, 3.0 Alpha 1

Time Tracking:
Not Specified

Issue Links:
Relate

Planning Status: Unspecified


 Description  « Hide
It's expected that LIKE should behave similarly to basic comparison operators ("equal to" etc) in describing the parameter type if the known parameter is of the string/blob type. However, (blob_field = ?) expectedly describes the parameter as BLOB, but (blob_field LIKE ?) describes it as VARCHAR. The same issue applies to CONTAINING/STARTING/SIMILAR TO predicates.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ann Harrison added a comment - 17/Feb/11 06:00 PM
In the very bad, very old days, blob=blob tested to see if the blob handles were the rather
than comparing the contents of the blob. That model works very badly for containing,
starting, similar, like, etc. I trust that by now the concept of comparing blob handles has
disappeared into history.

Cheers,

Ann

Dmitry Yemanov added a comment - 17/Feb/11 06:25 PM
Ann,

The answer is both yes and no. All blob based booleans are evaluated properly, by comparing the contents (including charset/collation trickery for text blobs). However, there's one known issue in this area, see CORE-3278.

But there are cases where blob IDs are still compared. I mean sorting and all its derived operations (ORDER BY, GROUP BY, DISTINCT). With a fixed length sorting operations, it looks impossible to process the entire blob contents, at least easily. But an attempt to throw error in these cases failed due to backward compatibility issues. See CORE-859, CORE-3252, CORE-3253. Sigh.