Skip to content

Commit

Permalink
bugfix: pgstrom_partial_nrows() didn't return correct value if '0' is…
Browse files Browse the repository at this point in the history
… given as an argument.

this issue was reported #829
  • Loading branch information
kaigai committed Oct 16, 2024
1 parent 9d2df1d commit ff92fbb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/aggfuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pgstrom_partial_nrows(PG_FUNCTION_ARGS)

for (i=0; i < PG_NARGS(); i++)
{
if (PG_ARGISNULL(i) || !PG_GETARG_BOOL(i))
if (PG_ARGISNULL(i))
PG_RETURN_INT64(0);
}
PG_RETURN_INT64(1);
Expand Down
12 changes: 6 additions & 6 deletions src/executor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,6 @@ static TupleTableSlot *
pgstromExecScanAccess(pgstromTaskState *pts)
{
TupleTableSlot *slot;
XpuCommand *resp;

slot = pgstromFetchFallbackTuple(pts);
if (slot)
Expand All @@ -1652,11 +1651,12 @@ pgstromExecScanAccess(pgstromTaskState *pts)
if (pts->curr_resp)
xpuClientPutResponse(pts->curr_resp);
pts->curr_resp = __fetchNextXpuCommand(pts);
if (!pts->curr_resp)
return pgstromFetchFallbackTuple(pts);
resp = pts->curr_resp;
if (resp->tag == XpuCommandTag__Success)
if (pts->curr_resp)
{
XpuCommand *resp = pts->curr_resp;

if (resp->tag != XpuCommandTag__Success)
elog(ERROR, "unknown response tag: %u", resp->tag);
if (resp->u.results.final_plan_task)
{
ExecFallbackCpuJoinOuterJoinMap(pts, resp);
Expand All @@ -1673,7 +1673,7 @@ pgstromExecScanAccess(pgstromTaskState *pts)
}
else
{
elog(ERROR, "unknown response tag: %u", resp->tag);
return pgstromFetchFallbackTuple(pts);
}
}
slot_getallattrs(slot);
Expand Down

0 comments on commit ff92fbb

Please sign in to comment.