Skip to content

Commit

Permalink
fix getpointv
Browse files Browse the repository at this point in the history
  • Loading branch information
vfroml committed Nov 4, 2014
1 parent 34fcbc1 commit 1664294
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions include/backends/vtapi_resultset.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ class PGResultSet : public ResultSet {
vector<float>* getFloatV(const int col);
time_t getTimestamp(const int col);
int getIntOid(const int col);
#if HAVE_POSTGRESQL
PGpoint getPoint(const int col);
vector<PGpoint>* getPointV(const int col);
#endif

pair< TKeys*,vector<int>* > getKeysWidths(const int row = -1, bool get_widths = 1, const int arrayLimit = 0);

Expand Down Expand Up @@ -615,7 +618,10 @@ class SLResultSet : public ResultSet {
vector<float>* getFloatV(const int col);
time_t getTimestamp(const int col);
int getIntOid(const int col);
#if HAVE_POSTGRESQL
PGpoint getPoint(const int col);
vector<PGpoint>* getPointV(const int col);
#endif

pair< TKeys*,vector<int>* > getKeysWidths(const int row = -1, bool get_widths = 1, const int arrayLimit = 0);

Expand Down
3 changes: 1 addition & 2 deletions src/backend_pg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1179,8 +1179,7 @@ vector<float>* PGResultSet::getFloatV(const int col) {
#ifdef HAVE_POSTGRESQL
PGpoint PGResultSet::getPoint(const int col) {
PGresult *pgres = (PGresult *) this->res;
PGpoint point;
memset(&point, 0, sizeof(PGpoint));
PGpoint point = {0.0, 0.0};
if (! CALL_PQT(fmap, PQgetf, pgres, this->pos, "%point", col, &point)) {
logger->warning(314, "Value is not a point", thisClass+"::getPoint()");
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend_sl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,8 @@ vector<float>* SLResultSet::getFloatV(const int col) {
// =============== GETTERS - GEOMETRIC TYPES ===============================
#ifdef HAVE_POSTGRESQL
PGpoint SLResultSet::getPoint(const int col) {
PGpoint point;
memset(&point, 0, sizeof(PGpoint));
PGpoint point = { 0.0, 0.0 };
// memset(&point, 0, sizeof(PGpoint));
// if (! PQgetf(select->res, this->pos, "%point", col, &point)) {
// logger->warning(314, "Value is not a point");
// }
Expand Down

0 comments on commit 1664294

Please sign in to comment.