summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/odbc/odbc_driver.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-26 11:50:03 +0200
committerAndrey Andreev <narf@bofh.bg>2012-03-26 11:50:03 +0200
commit808f3a62f9ca97670e457e1307fe261c42879d28 (patch)
tree1a6f24d41251b2e8c77d326d512c58fb7e013603 /system/database/drivers/odbc/odbc_driver.php
parent0d87bae93d5558f03d8194df13020517e3e84364 (diff)
parent59ad0af04debb4e10e20fbdfc1827a620a88b7be (diff)
Merge upstream branch
Diffstat (limited to 'system/database/drivers/odbc/odbc_driver.php')
-rw-r--r--system/database/drivers/odbc/odbc_driver.php26
1 files changed, 8 insertions, 18 deletions
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index 6704264c6..ad773117f 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -57,12 +57,17 @@ class CI_DB_odbc_driver extends CI_DB {
protected $_count_string = 'SELECT COUNT(*) AS ';
protected $_random_keyword;
-
public function __construct($params)
{
parent::__construct($params);
$this->_random_keyword = ' RND('.time().')'; // database specific random keyword
+
+ // Legacy support for DSN in the hostname field
+ if ($this->dsn == '')
+ {
+ $this->dsn = $this->hostname;
+ }
}
/**
@@ -72,7 +77,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
public function db_connect()
{
- return @odbc_connect($this->hostname, $this->username, $this->password);
+ return @odbc_connect($this->dsn, $this->username, $this->password);
}
// --------------------------------------------------------------------
@@ -84,22 +89,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @odbc_pconnect($this->hostname, $this->username, $this->password);
- }
-
- // --------------------------------------------------------------------
-
- /**
- * Reconnect
- *
- * Keep / reestablish the db connection if no queries have been
- * sent for a length of time exceeding the server's idle timeout
- *
- * @return void
- */
- public function reconnect()
- {
- // not implemented in odbc
+ return @odbc_pconnect($this->dsn, $this->username, $this->password);
}
// --------------------------------------------------------------------