Skip to content

Commit

Permalink
Postfix for CORE-5480, thanks to Mark Rotteveel.
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Mar 1, 2017
1 parent b993ed2 commit cec00e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dsql/ExprNodes.cpp
Expand Up @@ -10347,7 +10347,7 @@ dsc* SubstringNode::perform(thread_db* tdbb, impure_value* impure, const dsc* va
if (sStart < 0)
{
sLength = MAX(sLength + sStart, 0);
sStart = 1;
sStart = 0;
}

FB_UINT64 start = FB_UINT64(sStart);
Expand Down Expand Up @@ -10378,7 +10378,7 @@ dsc* SubstringNode::perform(thread_db* tdbb, impure_value* impure, const dsc* va
CharSet* charSet = INTL_charset_lookup(tdbb, valueDsc->getCharSet());

const FB_UINT64 byte_offset = start * charSet->maxBytesPerChar();
const FB_UINT64 byte_length = FB_UINT64(length) * charSet->maxBytesPerChar();
const FB_UINT64 byte_length = length * charSet->maxBytesPerChar();

if (charSet->isMultiByte())
{
Expand Down

0 comments on commit cec00e7

Please sign in to comment.