]> granicus.if.org Git - postgresql/commitdiff
ECPG: Fix offset to NULL/size indicator array.
authorMichael Meskes <meskes@postgresql.org>
Tue, 26 Nov 2013 16:16:39 +0000 (17:16 +0100)
committerMichael Meskes <meskes@postgresql.org>
Tue, 26 Nov 2013 16:31:45 +0000 (17:31 +0100)
Patch by Boszormenyi Zoltan <zb@cybertec.at>

src/interfaces/ecpg/ecpglib/data.c

index 436e74966c55a43e515e99b2733e49f0dbc3a9e1..c219aed1e9edecc7a3f507b90c05708277ad7028 100644 (file)
@@ -526,15 +526,15 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
                                                                {
                                                                        case ECPGt_short:
                                                                        case ECPGt_unsigned_short:
-                                                                               *((short *) (ind + offset * act_tuple)) = variable->len;
+                                                                               *((short *) (ind + ind_offset * act_tuple)) = variable->len;
                                                                                break;
                                                                        case ECPGt_int:
                                                                        case ECPGt_unsigned_int:
-                                                                               *((int *) (ind + offset * act_tuple)) = variable->len;
+                                                                               *((int *) (ind + ind_offset * act_tuple)) = variable->len;
                                                                                break;
                                                                        case ECPGt_long:
                                                                        case ECPGt_unsigned_long:
-                                                                               *((long *) (ind + offset * act_tuple)) = variable->len;
+                                                                               *((long *) (ind + ind_offset * act_tuple)) = variable->len;
                                                                                break;
 #ifdef HAVE_LONG_LONG_INT
                                                                        case ECPGt_long_long: