From 69e6fdd8d38d7b4573e46984cfeae3554595b912 Mon Sep 17 00:00:00 2001 From: dimitr Date: Fri, 4 Feb 2011 07:45:01 +0000 Subject: [PATCH] Corrections, thanks to Adriano. --- src/jrd/dfw.epp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index 32cfcf13ef..07da7b24b9 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -4892,7 +4892,16 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version, if (tfb->tfb_flags & TFB_computed) desc->dsc_dtype |= COMPUTED_FLAG; - format->fmt_defaults[tfb->tfb_id] = tfb->tfb_default; + impure_value& defRef = format->fmt_defaults[tfb->tfb_id]; + defRef = tfb->tfb_default; + + if (tfb->tfb_default.vlu_string) + { + fb_assert(defRef.vlu_desc.dsc_dtype == dtype_text); + defRef.vlu_desc.dsc_address = defRef.vlu_string->str_data; + } + else + defRef.vlu_desc.dsc_address = (UCHAR*) &defRef.vlu_misc; } // Compute the offsets of the various fields @@ -5259,11 +5268,11 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_ if (result) { dsc desc = *result; + MoveBuffer buffer; if (desc.isText() || desc.isBlob()) { UCHAR* ptr = NULL; - MoveBuffer buffer; const int len = MOV_make_string2(tdbb, &desc, CS_NONE, &ptr, buffer, true); fb_assert(ULONG(len) < ULONG(MAX_USHORT)); desc.makeText(len, ttype_none, ptr);