报错信息:对于decimal数据相乘报错:
报错一:ERROR: code: kActorInvokeError msg: "HGERR_code 22003 HGERR_msge numeric field overflow HGERR_detl A field with precision 38, scale 36 must round to an absolute value less than 10^2. HGERR_ctxt HGERR_erno 2 HGERR_end" err_data filename: "FunctionsCast.cc" lineno: 323 funcname: "DecimalOverflowCheck" sqlerrcode: 50331778 message: "numeric field overflow" detail: "A field with precision 38, scale 36 must round to an absolute value less than 10^2." context: "
报错二:ERROR: status { code: SERVER_INTERNAL_ERROR message: "[FunctionsArithmetic.h:971 apply] HGERR_code xx HGERR_msge value \"%s\" is out of range for %s HGERR_end[query_id:xxx][xxx]" err_data { filename: "FunctionsArithmetic.h" lineno: xx funcname: "apply" sqlerrcode: xx message: "value \"%s\" is out of range for %s" context: "[query_id:xxx]" } }
报错原因:
对于decimal类型的字段进行相乘,例如:numeric(38, 18)乘以numeric(38, 18) 会得到numeric(38, 36),小数点保存太多位数导致溢出。从而报错,出现问题版本:1.1.21及以下版本。
解决方案:
升级至最新版本。