aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2012-10-05 16:37:45 +0200
committerMichael Meskes <meskes@postgresql.org>2012-10-05 17:49:17 +0200
commit6e41fa2e5cd84d0970f1ee1d9c9767dbc974952a (patch)
treecb56d2bb71ac66abb811abe3fac0df231a6c233c /src/interfaces
parentfd5942c18f977a36fec66a8d1281092805f2a55e (diff)
downloadpostgresql-6e41fa2e5cd84d0970f1ee1d9c9767dbc974952a.tar.gz
postgresql-6e41fa2e5cd84d0970f1ee1d9c9767dbc974952a.zip
Fixed test for array boundary.
Instead of continuing if the next character is not an array boundary get_data() used to continue only on finding a boundary so it was not able to read any element after the first.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/ecpg/ecpglib/data.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c
index db975035df9..dcccd924ece 100644
--- a/src/interfaces/ecpg/ecpglib/data.c
+++ b/src/interfaces/ecpg/ecpglib/data.c
@@ -422,6 +422,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
ecpg_raise(lineno, ECPG_CONVERT_BOOL,
ECPG_SQLSTATE_DATATYPE_MISMATCH,
NULL);
+ pval++;
break;
}
else if (pval[0] == 't' && pval[1] == '\0')
@@ -434,6 +435,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
ecpg_raise(lineno, ECPG_CONVERT_BOOL,
ECPG_SQLSTATE_DATATYPE_MISMATCH,
NULL);
+ pval++;
break;
}
else if (pval[0] == '\0' && PQgetisnull(results, act_tuple, act_field))
@@ -777,7 +779,7 @@ ecpg_get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
++pval;
}
}
- } while (*pval != '\0' && array_boundary(isarray, *pval));
+ } while (*pval != '\0' && !array_boundary(isarray, *pval));
return (true);
}