apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dubov <oa...@yahoo.com>
Subject Re: LONGs and LOBs [Was: improved error reporting for apr_dbd_mysql.c]
Date Thu, 01 Jun 2006 02:03:52 GMT

> Second, instead of paying attention to various
> letters like %B, %L, %s  
> and so on, which come from when the statement was
> prepared, we ignore  
> them in p[v]bquery/bselect, but we pass
> apr_dbd_entry_t ** instead of  
> const char ** into the function. Then we have both
> the type/length  
> figured out explicitly and can pass binary data in
> safely, without the  
> need to do dubious strlen()'s.
I'm afraid that this will unnecessary complicate an
already ugly code. That is, data types are most often
known in advance and any above typical database code
is not a pretty picture even without the need to 
assemble additional data structures. I would rather
prefer something like:

void* apr_dbd_get_entry_as(apr_dbd_type_t type)

or may be even

int apr_dbd_get_entries(char *format, ...)

(akin to scanf) which returns data cast as desired
type if possible, or null.
NULLs are moderately rare type to fetch - I think it's
always better to filter them out on SQL level.

int apr_dbd_entry_is_null(const apr_dbd_row_t *row,
int n)

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

View raw message