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

Restored the legacy logic that was zapping the output NULL descriptors to mimic some pseudo-empty values.

Just for symmetry, unconditionally applied the same logic to inputs (it was there for blobs only).
Finally, do the same in the original place, EXE_assignment(). A more complex original code that tried to care about character sets is removed.
This commit is contained in:
dimitr 2009-03-03 14:57:53 +00:00
parent 13abdddbe2
commit ca94ba9d07
2 changed files with 20 additions and 39 deletions

View File

@ -2191,14 +2191,18 @@ static void map_in_out( dsql_req* request,
}
}
if (!request)
{
desc.dsc_address = dsql_msg_buf + (IPTR) desc.dsc_address;
if (!flag || *flag >= 0)
{
desc.dsc_address = dsql_msg_buf + (IPTR) desc.dsc_address;
MOVD_move(&parameter->par_desc, &desc);
}
else
{
memset(desc.dsc_address, 0, desc.dsc_length);
}
}
else if (!flag || *flag >= 0)
{
@ -2209,8 +2213,10 @@ static void map_in_out( dsql_req* request,
MOVD_move(&desc, &parameter->par_desc);
}
}
else if (parameter->par_desc.isBlob())
else
{
memset(parameter->par_desc.dsc_address, 0, parameter->par_desc.dsc_length);
}
count--;
}

View File

@ -439,7 +439,9 @@ void EXE_assignment(thread_db* tdbb, jrd_nod* to, dsc* from_desc, bool from_null
BLB_move(tdbb, from_desc, to_desc, to);
}
else if (!DSC_EQUIV(from_desc, to_desc, false))
{
MOV_move(tdbb, from_desc, to_desc);
}
else if (from_desc->dsc_dtype == dtype_short)
{
*((SSHORT*) to_desc->dsc_address) = *((SSHORT*) from_desc->dsc_address);
@ -453,50 +455,23 @@ void EXE_assignment(thread_db* tdbb, jrd_nod* to, dsc* from_desc, bool from_null
*((SINT64*) to_desc->dsc_address) = *((SINT64*) from_desc->dsc_address);
}
else
{
memcpy(to_desc->dsc_address, from_desc->dsc_address, from_desc->dsc_length);
}
to_desc->dsc_flags &= ~DSC_null;
}
else if (missing2_node && (missing = EVL_expr(tdbb, missing2_node)))
{
MOV_move(tdbb, missing, to_desc);
to_desc->dsc_flags |= DSC_null;
}
else
{
USHORT l = to_desc->dsc_length;
UCHAR* p = to_desc->dsc_address;
switch (to_desc->dsc_dtype)
if (missing2_node && (missing = EVL_expr(tdbb, missing2_node)))
{
case dtype_text:
// YYY - not necessarily the right thing to do
// for text formats that don't have trailing spaces
if (l) {
const CHARSET_ID chid = DSC_GET_CHARSET(to_desc);
/*
CVC: I don't know if we have to check for dynamic-127 charset here.
If that is needed, the line above should be replaced by the commented code here.
CHARSET_ID chid = INTL_TTYPE(to_desc);
if (chid == ttype_dynamic)
chid = INTL_charset(tdbb, chid);
*/
const char pad = chid == ttype_binary ? '\0' : ' ';
memset(p, pad, l);
}
break;
case dtype_cstring:
*p = 0;
break;
case dtype_varying:
*(SSHORT *) p = 0;
break;
default:
memset(p, 0, l);
break;
MOV_move(tdbb, missing, to_desc);
}
else
{
memset(to_desc->dsc_address, 0, to_desc->dsc_length);
}
to_desc->dsc_flags |= DSC_null;
}