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

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: 27/May/15 07:59 PM
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

Issue Links:

QA Status: Done successfully
Test Details:
Note for 2.5.
Parameters in SQLDA have type from src/dsql/sqlda_pub.h, but bit_0 is ON if this parameter is Nullable, i.e.:
#define SQL_BLOB 520 ==> 521 for Nullable (see also: core_4156.fbt)

Note for 3.0.
NB: output in 3.0 will contain values of sqltype with ZERO in bit_0, so it will be: 520 instead of previous 521.

 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   Change History   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.



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

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.