[RDBI] Input pointers not tested for null

Mateusz Loskot mateusz at loskot.net
Wed Aug 23 11:37:54 EDT 2006


Hi,

I wonder why there are no null tests for input pointer parameters
in the RDBI layer functions and may I add some for PostGIS driver?

For example, in following function

int mysql_connect(mysql_context_def *context,...);

I understand that the pre-condition is that context is never NULL,
so, as you already know :-), I'd set assertion for this pre-condition:

assert(NULL != context);

but I understand FDO policy prefers return code, for example

if (NULL == context) return RDBI_GENERIC_ERROR;

It's not important what kind of tests are used,
but in my opinion it's important to use some null pointer tests
in RDBI functions, at least in early stage of development as
I'm with my PostGIS stuff :-)
So, am I allowed to add tests of input parameters in PostGIS
Rdbi driver?

Best regards
-- 
Mateusz Loskot
http://mateusz.loskot.net




More information about the Fdo-internals mailing list