Re: PEAR::DB and oracle question

From: Date: Mon, 08 Dec 2003 16:00:32 +0000
Subject: Re: PEAR::DB and oracle question
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-24274@lists.php.net to get a copy of this message
Hi, thanks a lot for the info. While the patch would certainly solve the issue i think it is best to leave up to the user, forcing the option to portability just because of oracle isn't the best option. I'll notify the bug reporter about this and tell him to add the option to his conf array. Thanks again ! Juan Manuel Caicedo wrote:
Hi I had the same problem (array keys in upper case) when I used the oci8 library (without PEAR), so it's not a PEAR:DB issue. But now I see the problem is solved with PEAR. I don't know exactly since which version, but I remember it was one year ago. The cause of the bug is that Oracle 'always' returns the keys of an associative array in upper case, so we will have to make something with the result of the query. In PHP 4.2 the function array_change_key_case was introduced and that's exactly the solution that PEAR uses. In the class DB_oci8 the function is called in the method fetchInto (DB/oci.php [version 1.10] lines 194 - 211 ). But notice that the function will be called only if the attribute $this->options['optimize'] has the value 'portability'. The default value is 'performance' (DB/common.php [version 1.21] lines 91 - 102), so I think that is the cause of problem. Indeed, i see that in the LiveUser_Auth_Container_DB class, in the class constructor we have the following: (lines numbers based on version 1.33) 128: if (!DB::isError($this->dbc)) {
129:    $this->init_ok = true;
130: } I think that the following will solve the problem: 128: if (!DB::isError($this->dbc)) {
129:    this->init_ok = true;
130:    $this->dbc->setOption('optimize','portability');
131: } I don't have a CVS account, so if you think that it's an adequate solution, you can fix it. Hope that helps, Juan Manuel Caicedo cavorite.com


« previous php.pear.dev (#24274) next »