From 2461d05460b0c9dfffa0cca94113fd491139fa41 Mon Sep 17 00:00:00 2001 From: dimitr Date: Tue, 23 Feb 2016 09:52:51 +0000 Subject: [PATCH] Removed "cast no-op" extensions as they break many tests, e.g. CAST('A' as CHAR(10)) remains CHAR(1) instead of being padded up to CHAR(10). Let's no-op only really equal descriptors for the time being. --- src/dsql/ExprNodes.cpp | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/dsql/ExprNodes.cpp b/src/dsql/ExprNodes.cpp index 21d4d76e0f..1b24a85840 100644 --- a/src/dsql/ExprNodes.cpp +++ b/src/dsql/ExprNodes.cpp @@ -2729,25 +2729,7 @@ ValueExprNode* CastNode::pass2(thread_db* tdbb, CompilerScratch* csb) dsc sourceDesc; source->getDesc(tdbb, csb, &sourceDesc); - // Let's check if the cast is required. - - if (desc.dsc_dtype == dtype_text) - { - desc.dsc_dtype = dtype_varying; - desc.dsc_length += sizeof(USHORT); - } - - if (sourceDesc.dsc_dtype == dtype_text) - { - sourceDesc.dsc_dtype = dtype_varying; - sourceDesc.dsc_length += sizeof(USHORT); - } - - if (desc.dsc_dtype == dtype_varying && sourceDesc.dsc_dtype == dtype_varying && - desc.dsc_length > sourceDesc.dsc_length) - { - desc.dsc_length = sourceDesc.dsc_length; - } + // Let's check if the cast is required dummyCast = !itemInfo && DSC_EQUIV(&sourceDesc, &desc, true); }