From d7b6b57fb7e4e7f2c15df79128a096a358eef6ff Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Fri, 3 Mar 2017 19:55:37 +0300 Subject: [PATCH] Support altering type to decfloat --- src/dsql/DdlNodes.epp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/dsql/DdlNodes.epp b/src/dsql/DdlNodes.epp index 643dc06b0c..3e9133e2aa 100644 --- a/src/dsql/DdlNodes.epp +++ b/src/dsql/DdlNodes.epp @@ -4475,6 +4475,8 @@ void AlterDomainNode::checkUpdate(const dyn_fld& origFld, const dyn_fld& newFld) case blr_d_float: case blr_double: case blr_float: + case blr_dec64: + case blr_dec128: switch (newFld.dyn_dtype) { case blr_blob: @@ -4571,6 +4573,44 @@ void AlterDomainNode::checkUpdate(const dyn_fld& origFld, const dyn_fld& newFld) } break; + case blr_dec64: + switch (origFld.dyn_dtype) + { + case blr_short: + case blr_long: + case blr_float: + case blr_d_float: + case blr_double: + case blr_dec64: + break; + + default: + // Cannot change datatype for column %s. Conversion from base type %s to base type %s is not supported. + errorCode = isc_dyn_invalid_dtype_conversion; + break; + } + break; + + case blr_dec128: + switch (origFld.dyn_dtype) + { + case blr_short: + case blr_long: + case blr_int64: + case blr_float: + case blr_d_float: + case blr_double: + case blr_dec64: + case blr_dec128: + break; + + default: + // Cannot change datatype for column %s. Conversion from base type %s to base type %s is not supported. + errorCode = isc_dyn_invalid_dtype_conversion; + break; + } + break; + // If the original field is a numeric field and the new field is a character field, // is there enough space in the new field? case blr_text: