apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [users@httpd] apr_dbd error codes and SQLSTATE
Date Fri, 23 Jun 2006 10:21:40 GMT
On Friday 23 June 2006 04:36, Evgeny Shirykalov wrote:
> Dear All,
>
> Current version of Postgres driver for apr_dbd returns ExecStatusType
> values from query-like functions. This behaviour leads to two
> unconvenient consequences:

Yes, this has been discussed recently on the dev@apr list.
The underlying issue is to create new APR/APU error codes
to express conditions that aren't dealt with at present.

> My suggestion is to use SQLSTATE codes as return values. There are two
> difficulties: (i) SQLSATE code is 5-char line, but return type is
> 4-bytes integer, and (ii) query functions from Postgres client library
> do not return result object in some situations, and no SQLSTATE code
> available in this case.

We're more likely to implement things at the APR level, so they might
look like, for example, APR_ENODBD or APR_ESQLSYNTAX, with some
secondary means to retrieve the native database's original error.

> I've implemented and tested this scheme using version of apr_dbd_pgsql.c
> from httpd-2.2.2. But current CVS version contains a lot of changes, and
> I did not use it. Nevertheless, this error reporting scheme seems to me
> much more convenient than current one. And new Oracle driver may also
> use it.

Please feel free to hop over to the dev@apr list and contribute your
thoughts.  If you're happy to share what you've done with pgsql, we'll
be interested to take a look.

-- 
Nick Kew

Mime
View raw message