From 6753377f3141421b2cb515729616faab19e9ba7c Mon Sep 17 00:00:00 2001 From: dimitr Date: Wed, 14 Mar 2012 11:12:41 +0000 Subject: [PATCH] Backported CORE-3697: String truncation error when selecting from a VIEW with UNION inside. --- src/dsql/gen.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dsql/gen.cpp b/src/dsql/gen.cpp index 6d2492acb0..bbabf64bb1 100644 --- a/src/dsql/gen.cpp +++ b/src/dsql/gen.cpp @@ -1542,10 +1542,12 @@ static void gen_constant( dsql_req* request, const dsc* desc, bool negate_value) **/ static void gen_constant( dsql_req* request, dsql_nod* node, bool negate_value) { - if (node->nod_desc.dsc_dtype == dtype_text) - node->nod_desc.dsc_length = ((dsql_str*) node->nod_arg[0])->str_length; + dsc desc = node->nod_desc; - gen_constant(request, &node->nod_desc, negate_value); + if (desc.dsc_dtype == dtype_text) + desc.dsc_length = ((dsql_str*) node->nod_arg[0])->str_length; + + gen_constant(request, &desc, negate_value); }