From 5bacc887d3db270bc1b9c1900bf764f8a416e184 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Sat, 26 Apr 2008 15:49:26 +0000 Subject: [PATCH] Fixed CORE-1859 - Arithmetic overflow or division by zero has occurred. in MAX function --- src/jrd/evl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jrd/evl.cpp b/src/jrd/evl.cpp index 4f303f23ce0..35d97dae3f4 100644 --- a/src/jrd/evl.cpp +++ b/src/jrd/evl.cpp @@ -1803,7 +1803,7 @@ USHORT EVL_group(thread_db* tdbb, RecordSource* rsb, jrd_nod *const node, USHORT SET_NULL(record, id); } else { - MOV_move(tdbb, &impure->vlu_desc, EVL_expr(tdbb, field)); + MOV_move(tdbb, &impure->vlu_desc, EVL_assign_to(tdbb, field)); CLEAR_NULL(record, id); } break; @@ -1823,7 +1823,7 @@ USHORT EVL_group(thread_db* tdbb, RecordSource* rsb, jrd_nod *const node, USHORT temp.dsc_sub_type = 0; temp.dsc_address = (UCHAR *) & d; d = MOV_get_double(&impure->vlu_desc) / impure->vlux_count; - MOV_move(tdbb, &temp, EVL_expr(tdbb, field)); + MOV_move(tdbb, &temp, EVL_assign_to(tdbb, field)); break; case nod_agg_average_distinct2: @@ -1851,7 +1851,7 @@ USHORT EVL_group(thread_db* tdbb, RecordSource* rsb, jrd_nod *const node, USHORT temp.dsc_address = (UCHAR *) & d; d = MOV_get_double(&impure->vlu_desc) / impure->vlux_count; } - MOV_move(tdbb, &temp, EVL_expr(tdbb, field)); + MOV_move(tdbb, &temp, EVL_assign_to(tdbb, field)); break; default: // Shut up some compiler warnings