implements setCharset for mysql, no exception if setCharset is not implemented (fixes #244)
This commit is contained in:
parent
a65e106ecc
commit
7a35e676a9
@ -450,13 +450,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
||||
* Set the charset on the current connection
|
||||
*
|
||||
* @param string charset
|
||||
* @param resource connection handle
|
||||
*
|
||||
* @throws Doctrine_Connection_Exception if the feature is not supported by the driver
|
||||
* @return true on success, MDB2 Error Object on failure
|
||||
* @return void
|
||||
*/
|
||||
public function setCharset($charset) {
|
||||
throw new Doctrine_Connection_Exception('Altering charset not supported by this driver.');
|
||||
}
|
||||
/**
|
||||
* fetchAll
|
||||
|
@ -88,6 +88,17 @@ class Doctrine_Connection_Mysql extends Doctrine_Connection_Common {
|
||||
|
||||
parent::__construct($manager, $adapter);
|
||||
}
|
||||
/**
|
||||
* Set the charset on the current connection
|
||||
*
|
||||
* @param string charset
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function setCharset($charset) {
|
||||
$query = 'SET NAMES '.$this->dbh->quote($charset);
|
||||
$this->dbh->query($query);
|
||||
}
|
||||
/**
|
||||
* Returns the next free id of a sequence
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user