> does it segfault in operator[] or when accessing the value?

Sorry for not being precise. It segfaults when accessing the value (with 
getString() in my case). 

> You must not fetch a value 
> from a tntdb::Value, which is actually null. If you do, the reaction is 
> the same as accessing a std::vector outside its bounds. And that is 
> undefined. Most probably a segfault.

Should it not rather throw a tntdb::NullValue exception? 

> For every value you fetch from a database, which may be null you should 
> always first ask, if it is null.

I will keep that in mind, although it is somewhat counterintuitive for string 
values, where I would expect that an empty field results in an empty string 
(""). It may however be best to keep things consistent with the other 
get-methods.

For now, I am working around the issue like this:
string my_string = ( my_row.isNull(1)  ?  ""  :  my_row[1].getString() );

Carlos

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to