Changeset 313

Show
Ignore:
Timestamp:
08/18/10 11:38:07 (18 months ago)
Author:
ol
Message:

Fix wrong count method in WFS Get Feature? hits. Thanks to rouault for reporting. Cf #52

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/wfs/wfs_get_feature.c

    r302 r313  
    324324    /* just count the number of features */ 
    325325    for (ln = request_list->first->value->first; ln != NULL; ln = ln->next) { 
     326        buffer_add_head_str(ln->value, "SELECT count(*) FROM ("); 
     327        buffer_add_str(ln->value, ") as foo"); 
    326328        res = PQexec(o->pg, ln->value->buf); 
    327329 
    328330        if (PQresultStatus(res) == PGRES_TUPLES_OK) 
    329             hits = hits + PQnfields(res); 
     331            hits = hits + atoi(PQgetvalue(res, 0, 0)); 
    330332 
    331333        PQclear(res);