Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Bug #4854 Oracle Easy Connect syntax only works with array DSN
Submitted: 2005-07-19 05:26 UTC
From: cjbj at hotmail dot com Assigned: quipo
Status: Closed Package: MDB2
PHP Version: 5.0.4 OS: Linux x86
Roadmaps: (Not assigned)    
Subscription  


 [2005-07-19 05:26 UTC] cjbj at hotmail dot com
Description: ------------ Oracle's "Easy Connect" syntax works with MDB2's array DSN, but not the string form. To use Easy Connect, Oracle 10g client libs are required. The Easy Connect syntax is username/password@[//]host[:port][/service_name] e.g. sqlplus scott/tiger@//mymachine:1521/orcl Reproduce code: --------------- require_once 'MDB2.php'; // This works $dsn = array( 'phptype' => 'oci8', 'hostspec' => '//mymachine/orcl', 'username' => 'scott', 'password' => 'tiger', ); // This doesn't connect $dsn = 'oci8://scott:tiger@//mymachine/oracle'; $db = MDB2::connect($dsn); Expected result: ---------------- Successful connection Actual result: -------------- The connection fails and $db->getDebugInfo() gives: [Error message: it was not specified a valid Oracle Service Identifier (SID)] ** oci8:///frodo/oracle:xxx@//frodo/oracle

Comments

 [2005-07-19 05:32 UTC] cjbj at hotmail dot com
The service name typo in my example is not the cause of the problem. Even with "orcl" in the failure-case example, the connection does not succeed.
 [2005-08-09 14:33 UTC] david dot coallier at gmail dot com
What if you try this: $dsn = array( 'phptype' => 'oci8', 'hostspec' => 'hostname', 'username' => 'scott', 'password' => 'tiger', 'database' => 'orcacle', );
 [2005-08-13 16:00 UTC] davidc at phpsec dot org
Please reply, I will close this issue in 3 days. Thank you David
 [2006-12-18 23:37 UTC] cjbj at hotmail dot com
This bug still exists. The DSN parsing overwrites the username. Looking in _doConnect() in Driver/oci8.php, the DSNs oci8://hr:hr@localhost/XE and $dsn = array( 'phptype' => 'oci8', 'hostspec' => 'hostname', 'username' => 'scott', 'password' => 'tiger', 'database' => 'XE', ); were previously both parsed with username set to XE, hostspec set to localhost and database set to false. (BTW, protocol is set to "tcp" with the former but not the latter code) Workaround: This array DSN connects correctly: $dsn = array( 'phptype' => 'oci8', 'username' => 'hr', 'password' => 'hr', 'hostspec' => '//localhost/XE' );
 [2007-01-31 11:58 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-02-03 13:07 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-02-03 13:24 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2007-02-03 17:29 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!