Skip to content

Commit

Permalink
Fixed CORE-1859 - Arithmetic overflow or division by zero has occurre…
Browse files Browse the repository at this point in the history
…d. in MAX function
  • Loading branch information
asfernandes committed Apr 26, 2008
1 parent 7d1761b commit 5bacc88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jrd/evl.cpp
Expand Up @@ -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;
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5bacc88

Please sign in to comment.