Skip to content

Commit 54e921c

Browse files
committed
Fixed case-insensitive behavior in CONTAINING
1 parent d13fd3e commit 54e921c

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

src/common/dsc.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ typedef struct dsc
106106
UCHAR* dsc_address = nullptr; // Used either as offset in a message or as a pointer
107107

108108
#ifdef __cplusplus
109-
SSHORT dsc_blob_ttype() const noexcept { return dsc_scale | (dsc_flags & 0xFF00);}
110-
SSHORT& dsc_ttype() noexcept { return dsc_sub_type;}
111-
SSHORT dsc_ttype() const noexcept { return dsc_sub_type;}
109+
TTypeId dsc_blob_ttype() const noexcept
110+
{
111+
return TTypeId(dsc_scale | (dsc_flags & 0xFF00));
112+
}
112113

113114
bool isNullable() const noexcept
114115
{

src/dsql/BoolNodes.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,11 +891,19 @@ TriState ComparativeBoolNode::stringBoolean(thread_db* tdbb, Request* request,
891891
{
892892
SET_TDBB(tdbb);
893893

894-
TTypeId type1 = desc1->getTextType();
894+
TTypeId type1;
895895

896-
// No MATCHES support for blob
897-
if (desc1->isBlob() && (blrOp == blr_matching))
898-
return TriState(false);
896+
if (!desc1->isBlob())
897+
type1 = desc1->getTextType();
898+
else
899+
{
900+
// No MATCHES support for blob
901+
if (blrOp == blr_matching)
902+
return TriState(false);
903+
904+
// Non-text blob is treated here as NONE, not OCTETS
905+
type1 = desc1->dsc_sub_type == isc_blob_text ? desc1->dsc_blob_ttype() : ttype_none;
906+
}
899907

900908
Collation* obj = INTL_texttype_lookup(tdbb, type1);
901909
CharSet* charset = obj->getCharSet();

src/jrd/optimizer/Optimizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@ void Optimizer::generateAggregateSort(AggNode* aggNode)
15081508

15091509
if (sortKey->skd_dtype == SKD_varying || sortKey->skd_dtype == SKD_cstring)
15101510
{
1511-
if (desc->dsc_ttype() == ttype_binary)
1511+
if (desc->getTextType() == ttype_binary)
15121512
sortKey->skd_flags |= SKD_binary;
15131513
}
15141514

0 commit comments

Comments
 (0)