Skip to content

Commit

Permalink
bugfix: numeric value==0 makes no sense with weight != 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kaigai committed Dec 14, 2023
1 parent 103984b commit 6ac1340
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/xpu_numeric.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ __xpu_numeric_to_varlena(char *buffer, int16_t weight, int128_t value)
n_data[PG_MAX_DATA - ndigits] = mod;
}
}
else
{
/* value == 0 makes no sense on 'weight' */
weight = 0;
}

while (value != 0)
{
Expand Down

0 comments on commit 6ac1340

Please sign in to comment.