mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 08:03:03 +01:00
More corrections to TRIM and NULLs
This commit is contained in:
parent
91dd820689
commit
f92e56a1b8
@ -1820,23 +1820,32 @@ void CMP_get_desc(thread_db* tdbb, CompilerScratch* csb, jrd_nod* node, DSC * de
|
||||
}
|
||||
|
||||
case nod_trim:
|
||||
CMP_get_desc(tdbb, csb, node->nod_arg[e_trim_value], desc);
|
||||
|
||||
if (desc->dsc_dtype != dtype_blob)
|
||||
{
|
||||
USHORT length = DSC_string_length(desc);
|
||||
CMP_get_desc(tdbb, csb, node->nod_arg[e_trim_value], desc);
|
||||
|
||||
if (!DTYPE_IS_TEXT(desc->dsc_dtype))
|
||||
if (node->nod_arg[e_trim_characters])
|
||||
{
|
||||
desc->dsc_ttype() = ttype_ascii;
|
||||
desc->dsc_scale = 0;
|
||||
DSC desc1;
|
||||
CMP_get_desc(tdbb, csb, node->nod_arg[e_trim_characters], &desc1);
|
||||
desc->dsc_flags |= desc1.dsc_flags & DSC_null;
|
||||
}
|
||||
|
||||
desc->dsc_dtype = dtype_varying;
|
||||
desc->dsc_length = length + sizeof(USHORT);
|
||||
}
|
||||
if (desc->dsc_dtype != dtype_blob)
|
||||
{
|
||||
USHORT length = DSC_string_length(desc);
|
||||
|
||||
return;
|
||||
if (!DTYPE_IS_TEXT(desc->dsc_dtype))
|
||||
{
|
||||
desc->dsc_ttype() = ttype_ascii;
|
||||
desc->dsc_scale = 0;
|
||||
}
|
||||
|
||||
desc->dsc_dtype = dtype_varying;
|
||||
desc->dsc_length = length + sizeof(USHORT);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
case nod_function:
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user