Re: [PHP4BETA] cvs: /php4/pear DB.php /php4/pear/DB common.php mysql.php pgsql.php storage.php
| From: | Stig S. Bakken | Date: | Fri, 18 Feb 2000 21:47:09 +0000 |
| Subject: | Re: [PHP4BETA] cvs: /php4/pear DB.php /php4/pear/DB common.php mysql.php pgsql.php storage.php | ||
| References: | 1 2 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-10470@lists.php.net to get a copy of this message | ||
Rui Hirokawa wrote:
>
> ssb> --- php4/pear/DB/pgsql.php:1.1 Mon Feb 14 07:42:23 2000
> ssb> +++ php4/pear/DB/pgsql.php Thu Feb 17 12:21:02 2000
> ssb> @@ -20,15 +20,25 @@
> ssb> // Database independent query interface definition for PHP's PostgreSQL
> ssb> // extension.
> ssb> //
> ssb> +// [SSB] Problems in this code:
> ssb> +//
> ssb> +// 1. $this->row is used as a row counter
> ssb> +// for the fetchRow() implementation. There are two problems with this:
> ssb> +// First of all, $this->row is not reset when the result is freed. Also,
> ssb> +// If the user creates two DB_result objects on the same DB connection,
> ssb> +// it will break completely because both result sets will be using the
> ssb> +// same row counter. Solution: change $this->row into an array indexed
> ssb> +// by resource id.
>
> I understand the current implementation of DB_pgsql has some problems.
> I will try to fix these problems.
Sure. I just wanted to point them out.
> ssb> +//
> ssb> +// 2. The pgsql extension currently does not have error codes. This
> ssb> +// should be fixed so DB_pgsql can do portable error codes.
> ssb> +//
> ssb>
>
> The current implementation of DB_pgsql can't handle error codes because
> the current pgsql extention does not support any error codes.
> But the API change in error codes of the pgsql extention may causes some
> imcompatibility problem with the old codes which depend on the current
> error codes.
> I think the new function handling the error codes
> should be added to maintain the compatibility.
I just had a peek at the pgsql header files and it looks like PostgreSQL
doesn't have a notion of error codes the same way MySQL does. Maybe the
error strings have to be used as indexes in the errorcode map in
DB_pgsql? Yuck. :-)
- Stig