apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [PATCH]: improved error reporting for apr_dbd_mysql.c - correct version
Date Mon, 29 May 2006 10:24:46 GMT
On Monday 29 May 2006 03:25, Bojan Smojver wrote:
> On Sun, 2006-05-28 at 18:55 -0700, Alex Dubov wrote:
> > Yes, it was a reason why I started to play with
> > apr_dbd_mysql. I'm using a lot of binary data and I
> > must use 'pascal' style strings to do this (so there
> > is distinction between '%s' and '%c').
>
> I understand. However, this API is primarily a C API, so most people
> will associate %s with a zero terminated string. Maybe having a %b, for
> blob, would help?

The Oracle driver uses uppercase; %C for CLOB and %B for BLOB,
%L for LOB (hey, I can't even remember which of these are working
and which are placeholders!).  Is there any reason not to follow that 
convention for other drivers implementing LOBs?

> > I asked Nick if we can make this "struct blob_t"
> > common to apr_dbd. It's a handy little struct after
> > all.

And I replied that such discussions belong on-list:-)

The convention throughout apr_dbd is that datatypes belong
to the drivers, and are opaque in the public API.  If we depart
from this, we may be imposing unnecessary burdens on the
implementation of new drivers.

> I think this would actually be the correct approach. Something like:
>
> typedef struct apr_dbd_blob apr_dbd_blob_t;
> struct apr_dbd_blob {
>     apr_size_t length;
>     char       *data[];
> };
>
> Maybe there is such a structure in APR already that we're unaware of...

The bucket would seem more appropriate for LOB types.  Especially
if the underlying database wants to stream them, use indirection,
or do anything else 'clever'.

-- 
Nick Kew

Mime
View raw message