Skip to content

Commit d0d870a

Browse files
committed
Fix #8592 - Presence of 'ROWS <n_limit>' causes garbage in error message when string conversion problem raises.
1 parent db691d3 commit d0d870a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/jrd/cvt2.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,16 @@ static int cmp_numeric_string(const dsc* arg1, const dsc* arg2, Firebird::Decima
221221
Decimal128 buffer; // enough to fit any required data
222222
SSHORT scale = 0;
223223
UCHAR* text = arg2->dsc_address;
224+
USHORT textLen = TEXT_LEN(arg2);
225+
224226
if (arg2->dsc_dtype == dtype_varying)
227+
{
225228
text += sizeof(USHORT);
229+
textLen -= sizeof(USHORT);
230+
}
226231

227232
dsc num2;
228-
num2.dsc_dtype = CVT_get_numeric(text, TEXT_LEN(arg2), &scale, &buffer);
233+
num2.dsc_dtype = CVT_get_numeric(text, textLen, &scale, &buffer);
229234
num2.dsc_address = (UCHAR*)&buffer;
230235
num2.dsc_scale = scale;
231236
num2.dsc_length = type_lengths[num2.dsc_dtype];

0 commit comments

Comments
 (0)