Skip to content

Commit

Permalink
fix type handling of min(money), max(money) and sum(money)
Browse files Browse the repository at this point in the history
issue reported at heterodb#720
  • Loading branch information
kaigai committed Jan 26, 2024
1 parent 20b0ea7 commit 3bd4304
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 25 deletions.
23 changes: 21 additions & 2 deletions src/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2164,8 +2164,9 @@ codegen_relabel_expression(codegen_context *context,
format_type_be(type_oid));
if (dtype->type_code != type_code)
__Elog("device type '%s' -> '%s' is not binary convertible",
format_type_be(relabel->resulttype),
format_type_be(type_oid));
format_type_be(type_oid),
format_type_be(relabel->resulttype));

return codegen_expression_walker(context, buf, curr_depth, relabel->arg);
}

Expand Down Expand Up @@ -4260,6 +4261,12 @@ __xpucode_aggfuncs_cstring(StringInfo buf,
__get_expression_cstring(css, dcontext,
desc->arg0_slot_id));
break;
case KAGG_ACTION__PMIN_CASH:
appendStringInfo(buf, "pmin::cash[slot=%d, expr='%s']",
desc->arg0_slot_id,
__get_expression_cstring(css, dcontext,
desc->arg0_slot_id));
break;
case KAGG_ACTION__PMAX_INT32:
appendStringInfo(buf, "pmax::int32[slot=%d, expr='%s']",
desc->arg0_slot_id,
Expand All @@ -4278,12 +4285,24 @@ __xpucode_aggfuncs_cstring(StringInfo buf,
__get_expression_cstring(css, dcontext,
desc->arg0_slot_id));
break;
case KAGG_ACTION__PMAX_CASH:
appendStringInfo(buf, "pmax::cash[slot=%d, expr='%s']",
desc->arg0_slot_id,
__get_expression_cstring(css, dcontext,
desc->arg0_slot_id));
break;
case KAGG_ACTION__PSUM_INT:
appendStringInfo(buf, "psum::int[slot=%d, expr='%s']",
desc->arg0_slot_id,
__get_expression_cstring(css, dcontext,
desc->arg0_slot_id));
break;
case KAGG_ACTION__PSUM_CASH:
appendStringInfo(buf, "psum::cash[slot=%d, expr='%s']",
desc->arg0_slot_id,
__get_expression_cstring(css, dcontext,
desc->arg0_slot_id));
break;
case KAGG_ACTION__PSUM_FP:
appendStringInfo(buf, "psum::fp[slot=%d, expr='%s']",
desc->arg0_slot_id,
Expand Down
Loading

0 comments on commit 3bd4304

Please sign in to comment.