From c4444713e964615de110d840d3509274b42d26e1 Mon Sep 17 00:00:00 2001 From: Parikshit Sarode Date: Thu, 19 Oct 2023 11:16:53 +0000 Subject: [PATCH] changes applied --- contrib/babelfishpg_tsql/runtime/functions.c | 21 +------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/contrib/babelfishpg_tsql/runtime/functions.c b/contrib/babelfishpg_tsql/runtime/functions.c index 55404de952..f17125e334 100644 --- a/contrib/babelfishpg_tsql/runtime/functions.c +++ b/contrib/babelfishpg_tsql/runtime/functions.c @@ -221,26 +221,7 @@ babelfish_concat_wrapper(PG_FUNCTION_ARGS) arg1_size = VARSIZE_ANY_EXHDR(arg1); arg2_size = VARSIZE_ANY_EXHDR(arg2); - if((arg1_size>0)&&(arg2_size>0)&&((arg1_size + VARHDRSZ ) > INT_MAX - arg2_size)) - { - //overflow detected - ereport(ERROR, - (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - errmsg("value overflows numeric format while adding"))); - } - else if((arg1_size < 0) && (arg2_size < 0) && ((arg1_size + VARHDRSZ ) < INT_MIN - arg2_size)) - { - //underflow detected - ereport(ERROR, - (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), - errmsg("value underflows numeric format while adding"))); - } - else - { - //safe to add - new_text_size = arg1_size + arg2_size + VARHDRSZ; - } - + new_text_size = arg1_size + arg2_size + VARHDRSZ; new_text = (text *) palloc(new_text_size); SET_VARSIZE(new_text, new_text_size);