8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00

Revert to the bad (that works) commit for CORE-5062. It's difficult to work when both the original architects and the users do bad things in relation to CHAR and MBCS.

This commit is contained in:
asfernandes 2016-01-06 18:26:17 +00:00
parent 95d187c242
commit 3ab690bd21
2 changed files with 17 additions and 18 deletions

View File

@ -54,7 +54,6 @@
#include "../dsql/pass1_proto.h"
#include "../jrd/blb_proto.h"
#include "../jrd/cmp_proto.h"
#include "../jrd/evl_proto.h"
#include "../jrd/gds_proto.h"
#include "../jrd/inf_proto.h"
#include "../jrd/jrd_proto.h"
@ -2253,22 +2252,6 @@ static void map_in_out( thread_db* tdbb,
{
// Safe cast because desc is used as source only.
desc.dsc_address = const_cast<UCHAR*>(in_dsql_msg_buf) + (IPTR) desc.dsc_address;
if (desc.dsc_dtype == dtype_text)
{
const UCHAR* end = desc.dsc_address + desc.dsc_length;
EVL_adjust_text_descriptor(tdbb, &desc);
for (const UCHAR* p = desc.dsc_address + desc.dsc_length; p < end; ++p)
{
if (*p != ASCII_SPACE)
{
ERRD_post(
Arg::Gds(isc_arith_except) << Arg::Gds(isc_string_truncation));
}
}
}
MOVD_move(tdbb, &desc, &parameter->par_desc);
}
}

View File

@ -1383,9 +1383,23 @@ dsc* evlCharToUuid(Jrd::thread_db* tdbb, const SysFunction* function, Jrd::jrd_n
USHORT ttype;
UCHAR* data_temp;
const USHORT len = CVT_get_string_ptr(value, &ttype, &data_temp, NULL, 0);
USHORT len = CVT_get_string_ptr(value, &ttype, &data_temp, NULL, 0);
const UCHAR* data = data_temp;
if (len > GUID_BODY_SIZE)
{
// Verify if only spaces exists after the expected length. See CORE-5062.
data = data_temp + GUID_BODY_SIZE;
while (len > GUID_BODY_SIZE)
{
if (*data++ != ASCII_SPACE)
break;
--len;
}
}
// validate the UUID
if (len != GUID_BODY_SIZE) // 36
{
@ -1395,6 +1409,8 @@ dsc* evlCharToUuid(Jrd::thread_db* tdbb, const SysFunction* function, Jrd::jrd_n
Arg::Str(function->name));
}
data = data_temp;
for (int i = 0; i < GUID_BODY_SIZE; ++i)
{
if (i == 8 || i == 13 || i == 18 || i == 23)