summaryrefslogtreecommitdiff
path: root/kohana/libraries/drivers/Database/Mysql.php
diff options
context:
space:
mode:
Diffstat (limited to 'kohana/libraries/drivers/Database/Mysql.php')
-rw-r--r--kohana/libraries/drivers/Database/Mysql.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/kohana/libraries/drivers/Database/Mysql.php b/kohana/libraries/drivers/Database/Mysql.php
index f54b6d81..04d7ed65 100644
--- a/kohana/libraries/drivers/Database/Mysql.php
+++ b/kohana/libraries/drivers/Database/Mysql.php
@@ -74,7 +74,7 @@ class Database_Mysql_Driver extends Database_Driver {
}
// Clear password after successful connect
- $this->config['connection']['pass'] = NULL;
+ $this->db_config['connection']['pass'] = NULL;
return $this->link;
}
@@ -94,6 +94,11 @@ class Database_Mysql_Driver extends Database_Driver {
// Set the cached object
self::$query_cache[$hash] = new Mysql_Result(mysql_query($sql, $this->link), $this->link, $this->db_config['object'], $sql);
}
+ else
+ {
+ // Rewind cached result
+ self::$query_cache[$hash]->rewind();
+ }
// Return the cached query
return self::$query_cache[$hash];
@@ -170,14 +175,14 @@ class Database_Mysql_Driver extends Database_Driver {
return $column;
}
- public function regex($field, $match = '', $type = 'AND ', $num_regexs)
+ public function regex($field, $match, $type, $num_regexs)
{
$prefix = ($num_regexs == 0) ? '' : $type;
return $prefix.' '.$this->escape_column($field).' REGEXP \''.$this->escape_str($match).'\'';
}
- public function notregex($field, $match = '', $type = 'AND ', $num_regexs)
+ public function notregex($field, $match, $type, $num_regexs)
{
$prefix = $num_regexs == 0 ? '' : $type;