1
0
mirror of synced 2025-03-28 02:43:55 +03:00

[2.0] DDC-296 - Fix in quoting

This commit is contained in:
beberlei 2010-02-01 19:20:37 +00:00
parent 310d98cffe
commit 2fa58ee7b8
2 changed files with 3 additions and 3 deletions

View File

@ -64,8 +64,8 @@ class MysqlSessionInit implements EventSubscriber
*/ */
public function postConnect(ConnectionEventArgs $args) public function postConnect(ConnectionEventArgs $args)
{ {
$collation = ($this->_collation) ? " COLLATE '".$this->_collation : "'"; $collation = ($this->_collation) ? " COLLATE ".$this->_collation : "";
$args->getConnection()->executeUpdate("SET NAMES '".$this->_charset . "'" . $collation); $args->getConnection()->executeUpdate("SET NAMES ".$this->_charset . $collation);
} }
public function getSubscribedEvents() public function getSubscribedEvents()

View File

@ -16,7 +16,7 @@ class MysqlSessionInitTest extends DbalTestCase
$connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false); $connectionMock = $this->getMock('Doctrine\DBAL\Connection', array(), array(), '', false);
$connectionMock->expects($this->once()) $connectionMock->expects($this->once())
->method('executeUpdate') ->method('executeUpdate')
->with($this->equalTo("SET NAMES 'foo' COLLATE 'bar")); ->with($this->equalTo("SET NAMES foo COLLATE bar"));
$eventArgs = new ConnectionEventArgs($connectionMock); $eventArgs = new ConnectionEventArgs($connectionMock);