From 6f72c8f6bcf0d87e1e490d3d157b48cf3f53caa9 Mon Sep 17 00:00:00 2001 From: wrenlu <15835214+wrenlu@user.noreply.gitee.com> Date: Wed, 21 May 2025 17:16:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E8=A1=8Cselect=20=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=B6=89=E5=8F=8Abinary=E8=BD=ACdecimal=E5=AF=BC=E8=87=B4core?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/item_sum.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 677c9d0df..618912863 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -2204,6 +2204,7 @@ bool Item_sum_avg::resolve_type(THD *thd) { f_precision = min(precision + DECIMAL_LONGLONG_DIGITS, DECIMAL_MAX_PRECISION); f_scale = args[0]->decimals; + f_scale = min(f_precision, args[0]->decimals); dec_bin_size = my_decimal_get_binary_size(f_precision, f_scale); } else { assert(hybrid_type == REAL_RESULT); -- Gitee