Skip to content

Commit

Permalink
Removed "dry execution" of queries (which just set autocommit = false…
Browse files Browse the repository at this point in the history
…). Removed port assignment as port has a default value now. Added a TRUE parameter to be passed to cubrid_connect() function to establish a new connection even if parameters are the same. This is how MySQL driver for CI does.
  • Loading branch information
kadishmal committed Feb 13, 2012
1 parent 7b298de commit 5e39169
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions system/database/drivers/cubrid/cubrid_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,9 @@ class CI_DB_cubrid_driver extends CI_DB {
*/
function db_connect()
{
// If no port is defined by the user, use the default value
if ($this->port == '')
{
$this->port = self::DEFAULT_PORT;
}

$conn = cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password);

if ($conn)
{
// Check if a user wants to run queries in dry, i.e. run the
// queries but not commit them.
if (isset($this->auto_commit) && ! $this->auto_commit)
{
cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_FALSE);
}
else
{
cubrid_set_autocommit($conn, CUBRID_AUTOCOMMIT_TRUE);
$this->auto_commit = TRUE;
}
}

return $conn;
// TRUE is passed to cubrid_connect to force to create a new link
// instead of reusing a possibly open connection.
return cubrid_connect($this->hostname, $this->port, $this->database, $this->username, $this->password, TRUE);
}

// --------------------------------------------------------------------
Expand Down

0 comments on commit 5e39169

Please sign in to comment.