apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dubov <oa...@yahoo.com>
Subject [PATCH]: support for types and fixes of apr_dbd_mysql.c
Date Tue, 28 Feb 2006 01:53:09 GMT
I'm developing an application that requires exchange
of binary and numeric information between MySQL and
apr app. To reduce overhead, I introduced the
following changes (more in the comments):
1. Data types are obeyed both for arguments and
results of prepared queries
2. printf-style type formatters in prepared query
3. dbd_mysql_get_entry still returns pointer to char*,
so programmer must have advance knowledge of data
types involved.

The patch was tested with mysql 5.0.18 and
apr-util-1.2.2. It's made against a recent
webthing.com version.

Compatible behavior:
To achieve a pre-patch behavior, one can use '%c' type
specifier for all arguments and sql's CAST(x AS CHAR)
for all result columns.

Non-prepared queries work as before.

I was thinking whether it will be better to return a
complex data types instead of char* from
dbd_*_get_entry. It seems that in vast majority of
cases all the data types are known in compile time, so
some clutter can be saved by keeping things simpler
(except for blobs, whom I've wrapped into a trivial

P.S. By the way, was there any progress with inclusion
of apr_dbd_mysql into apr distribution? May be mysql
folks can give a permission for apr to include

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