Hi,

I had a report about ECPG code crashing which involved
a query using a date field. Attached is a one liner fix to make
the date type's offset computed consistently across
sqlda_common_total_size(), sqlda_compat_total_size() and
sqlda_native_total_size().

This must have been a cut and paste bug and is incorrect
in 9.0.x, 9.1.x and GIT HEAD. It would be nice to have it
applied before the next point releases come out.

Best regards,
Zoltán Böszörményi

-- 
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
     http://www.postgresql.at/

diff -durp postgresql-9.1.1.orig/src/interfaces/ecpg/ecpglib/sqlda.c 
postgresql-9.1.1/src/interfaces/ecpg/ecpglib/sqlda.c
--- postgresql-9.1.1.orig/src/interfaces/ecpg/ecpglib/sqlda.c   2011-09-22 
23:57:57.000000000 +0200
+++ postgresql-9.1.1/src/interfaces/ecpg/ecpglib/sqlda.c        2011-11-11 
14:24:17.794761458 +0100
@@ -124,7 +124,7 @@ sqlda_common_total_size(const PGresult *
                                }
                                break;
                        case ECPGt_date:
-                               ecpg_sqlda_align_add_size(offset, sizeof(int), 
sizeof(date), &offset, &next_offset);
+                               ecpg_sqlda_align_add_size(offset, sizeof(date), 
sizeof(date), &offset, &next_offset);
                                break;
                        case ECPGt_timestamp:
                                ecpg_sqlda_align_add_size(offset, sizeof(int), 
sizeof(timestamp), &offset, &next_offset);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to