apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dubov <oa...@yahoo.com>
Subject Re: [PATCH]: improved error reporting for apr_dbd_mysql.c - correct version
Date Mon, 22 May 2006 04:07:27 GMT

In general, my patch may remove a line or two without
a reason because I developed it using older version of
the apr_dbd_mysql, so may be I just missed something.

However, with CLIENT_FOUND_ROWS I would prefer the
"changed rows" behavior, not the "matched rows" one.
May be additional parameter to connection string will

> I'm a bit worried about things like this:
> ------------------------------------
> (*res)->bind[i].buffer_length =
> (*res)->res->fields[i].length;
> [..snip..]
> data[i] = apr_palloc(pool, sizeof(struct blob_t) +  
> (*res)->bind[i].buffer_length);
> ------------------------------------

I'm also well aware of the unbounded field length
problem. The proper thing to do is, of course, to
allocate some extent, fetch, then check for truncation
and re-allocate/report error. However, current api has
no way to do this cleanly. Frankly, I prefer to have
an out-of-memory error than silent data truncation (I
do not try to suggest that this is a way to go - only
a side comment). After all, it's not unreasonable to
have a MEDIUM TEXT/BLOB (24MB) fetched in one chunk on
modern machine. To conclude - do you have any thoughts
on how to implement this in apr way?

> OK. As long as segfaults are avoided (which used to
> be the case until  
> recently with driver from the head and MySQL 5.0),
> it should be OK.
Mysql likes to crash if parameter/result arrays are
not zeroed fully before bind calls. I'm using pcalloc
for everything because of that.

With your permission, I would like to return to mysqld
timeout problem. mod_dbd always does
apr_dbd_check_conn, which, in turn, happily fails with
"server has gone away" error. This leaves two
possibilities: add some code to mod_dbd to do a
reconnect or make apr_dbd_check_conn do it. The later
is nicer, but it requires a support for "reopen" -
whether additional driver hook or argument to
Luckily, mysql_real_connect can use existing

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

View raw message