Permalink
Browse files

Fixed serious bug in handling NUMERIC values (proper copy of the data).

  • Loading branch information...
1 parent 30cc987 commit ef3f1b2fa1c373a943105428ddb4d65cf3430f93 @tvondra committed Apr 3, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/trimmed.c
View
@@ -27,6 +27,7 @@
#include <unistd.h>
#include "postgres.h"
+#include "utils/datum.h"
#include "utils/palloc.h"
#include "utils/array.h"
#include "utils/lsyscache.h"
@@ -412,7 +413,7 @@ trimmed_append_numeric(PG_FUNCTION_ARGS)
data->nelements = data->nelements + SLICE_SIZE;
}
- data->elements[data->next++] = element;
+ data->elements[data->next++] = DatumGetNumeric(datumCopy(NumericGetDatum(element), false, -1));
}

0 comments on commit ef3f1b2

Please sign in to comment.