cvs: pear /DB/DB sybase.php
| From: | Tomas V.V.Cox | Date: | Sun, 07 Sep 2003 10:55:51 +0000 |
| Subject: | cvs: pear /DB/DB sybase.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-12524@lists.php.net to get a copy of this message | ||
cox Sun Sep 7 06:55:51 2003 EDT
Modified files:
/pear/DB/DB sybase.php
Log:
If the database is passed in dsn, then switch to it at connect()
(bug 25389)
Index: pear/DB/DB/sybase.php
diff -u pear/DB/DB/sybase.php:1.12 pear/DB/DB/sybase.php:1.13
--- pear/DB/DB/sybase.php:1.12 Thu Aug 28 08:36:58 2003
+++ pear/DB/DB/sybase.php Sun Sep 7 06:55:51 2003
@@ -17,11 +17,15 @@
// | Antônio Carlos Venâncio Júnior <floripa@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: sybase.php,v 1.12 2003/08/28 12:36:58 cox Exp $
+// $Id: sybase.php,v 1.13 2003/09/07 10:55:51 cox Exp $
//
// Database independent query interface definition for PHP's Sybase
// extension.
//
+//
+// TODO
+// - This driver may fail with multiple connections under the same
+// user/pass/host and different databases
require_once 'DB/common.php';
@@ -100,6 +104,13 @@
if (!$conn) {
return $this->raiseError(DB_ERROR_CONNECT_FAILED);
+ }
+
+ if ($dsninfo['database']) {
+ if (!@sybase_select_db($dsninfo['database'], $conn)) {
+ return $this->raiseError(DB_ERROR_NODBSELECTED, null,
+ null, null, sybase_get_last_message());
+ }
}
$this->connection = $conn;