
18 Aug
2005
18 Aug
'05
1:18 p.m.
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Jonathan Wakely
How do you handle NULL values? the postgresql::row_set_imp::get() function doesn't seem to account for NULL, which would crash strlen(), atof() etc.
I see from the docs that PQgetvalue() never returns a NULL char*. Does that mean some way of distinguishing empty strings from NULL fields is needed? i.e. a wrapper for PQgetisnull.
We could make abstract_row_set::get return an optional<field> instead of a field. Then row::get_field could return an optional as well. I'd suggest that row::get, however, continue its current behavior which is to return a default constructed value in the presence of null fields.