|
From: Tom L. <tg...@ss...> - 2011-08-05 18:26:00
|
Hi folks,
I package libdbi for Red Hat. While investigating a user's bug report
I found out that 0.8.3's dbi_result.c was fetching the wrong union
member when returning result values that are wider than the type
returned by the database. Looking into your CVS, I see that this was
fixed back in May 2009 ... for all cases but one. I believe you still
need the attached patch.
regards, tom lane
*** libdbi-0.8.3/src/dbi_result.c~ Fri Aug 5 13:53:18 2011
--- libdbi-0.8.3/src/dbi_result.c Fri Aug 5 13:54:42 2011
***************
*** 1133,1138 ****
--- 1133,1139 ----
switch (RESULT->field_attribs[fieldidx] & DBI_DECIMAL_SIZEMASK) {
case DBI_DECIMAL_SIZE4:
+ return RESULT->rows[RESULT->currowidx]->field_values[fieldidx].d_float;
case DBI_DECIMAL_SIZE8:
return RESULT->rows[RESULT->currowidx]->field_values[fieldidx].d_double;
default:
|